]> git.sur5r.net Git - bacula/bacula/commitdiff
regress: Add checks for Enabled flag
authorEric Bollengier <eric@baculasystems.com>
Tue, 14 Nov 2017 14:45:29 +0000 (15:45 +0100)
committerKern Sibbald <kern@sibbald.com>
Mon, 20 Nov 2017 06:54:50 +0000 (07:54 +0100)
regress/tests/reload-client-address-test

index db020265d2bb208e6ba492eebdcdd525f8d2078e..757345de41cf27c34fdf73130c5314595463765e 100755 (executable)
@@ -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 <<END_OF_DATA >$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 <<END_OF_DATA >$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 <<END_OF_DATA >$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