From 83f964cf9f93c2b6177a4ad64c52a5d04a52bfe4 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 14 Nov 2017 15:45:29 +0100 Subject: [PATCH] regress: Add checks for Enabled flag --- regress/tests/reload-client-address-test | 49 ++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/regress/tests/reload-client-address-test b/regress/tests/reload-client-address-test index db020265d2..757345de41 100755 --- a/regress/tests/reload-client-address-test +++ b/regress/tests/reload-client-address-test @@ -20,6 +20,7 @@ change_jobname BackupClient1 $JobName start_test $bperl -e 'add_attribute("$conf/bacula-dir.conf", "Address", "127.0.0.1", "Client")' +$bperl -e 'add_attribute("$conf/bacula-dir.conf", "Enabled", "yes", "Client")' cat <$tmp/bconcmds @$out /dev/null @@ -48,32 +49,74 @@ END_OF_DATA run_bconsole +print_debug "Disable client" + +client=`awk '/Name=/ { gsub(/Name=/, "", $2); print $2; exit }' $tmp/log0.out` + cat <$tmp/bconcmds @$out $tmp/log3.out +disable client=$client +show client +@$out $tmp/log4.out +reload +show client +@$out $tmp/log5.out +enable client=$client +reload show client quit END_OF_DATA run_bconsole -grep "127.0.0.1" $tmp/log0.out +$bperl -e 'add_attribute("$conf/bacula-dir.conf", "Enabled", "no", "Client")' + +cat <$tmp/bconcmds +@$out $tmp/log6.out +reload +show client +@$out $tmp/log7.out +enabled client=$client +reload +show client +quit +END_OF_DATA + +grep "127.0.0.1" $tmp/log0.out > /dev/null if [ $? -ne 0 ]; then print_debug "ERROR: Should find 127.0.0.1 in $tmp/log0.out" estat=1 fi -grep "127.0.0.2" $tmp/log2.out +grep "127.0.0.2" $tmp/log2.out > /dev/null if [ $? -ne 0 ]; then print_debug "ERROR: Should find 127.0.0.2 in $tmp/log2.out" estat=1 fi -grep "127.0.0.2" $tmp/log3.out +grep "127.0.0.2" $tmp/log3.out > /dev/null if [ $? -ne 0 ]; then print_debug "ERROR: Should find 127.0.0.2 in $tmp/log3.out" estat=1 fi +grep "Enabled=0" $tmp/log3.out > /dev/null +if [ $? -ne 0 ]; then + print_debug "ERROR: Should find Enabled=0 in $tmp/log3.out" + estat=1 +fi + +grep "Enabled=0" $tmp/log4.out > /dev/null +if [ $? -ne 0 ]; then + print_debug "ERROR: Should find Enabled=0 in $tmp/log4.out" + estat=1 +fi + +grep "Enabled=1" $tmp/log5.out > /dev/null +if [ $? -ne 0 ]; then + print_debug "ERROR: Should find Enabled=1 in $tmp/log5.out" + estat=1 +fi stop_bacula -- 2.39.2