From: Eric Bollengier Date: Tue, 14 Nov 2017 14:45:29 +0000 (+0100) Subject: regress: Add checks for Enabled flag X-Git-Tag: Release-9.0.6~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=83f964cf9f93c2b6177a4ad64c52a5d04a52bfe4;p=bacula%2Fbacula regress: Add checks for Enabled flag --- 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