This commit is the result of the squash of the following main commits:
Author: Alain Spineux <alain@baculasystems.com>
Date: Fri Dec 23 11:01:56 2016 +0100
regress: tweak chmox a+x of some test
Author: Alain Spineux <alain@baculasystems.com>
Date: Fri Oct 21 16:11:47 2016 +0200
regress: make regress python friendly
- modules like bconsole.py and blab.py goes in regress/scrips
- regress/tests/regress.py is a helper that load modules in scripts
without boring with librady path
- py-sample-test.py is the first sample
- add new objects lab.{fd,sd,dir} that are manage the related Daemon
- add lab.sd.dde of class DDE that provides some basic helper for the DDE
- file FileReader can search a log or trace file
- lab.GetVolume(volname) return information about a volume
--- /dev/null
+#!/usr/bin/env python3
+from regress import blab
+
+lab=blab.Lab(testname='py-sample-test', shell=True)
+lab.Shell('scripts/copy-confs')
+lab.Shell('start_test')
+lab.StartBacula()
+
+lab.BconsoleScript("""\
+@{out} /dev/null
+messages
+@{out} {tmp}/log1.out
+setdebug level=4 storage=File1
+label volume=TestVolume001 storage=File1 pool=File slot=1 drive=0
+show job=BackupClient1
+run job=BackupClient1 yes
+@sleep 1
+status storage=File1
+@sleep 1
+status storage=File1
+wait
+messages
+@#
+@# now do a restore
+@#
+@{out} {tmp}/log2.out
+setdebug level=4 storage=File1
+restore where={tmp}/bacula-restores select all done
+yes
+wait
+messages
+quit
+""")
+
+lab.Shell('check_for_zombie_jobs storage=File1')
+lab.Shell('stop_bacula')
+
+lab.Shell('check_two_logs')
+lab.Shell('check_restore_diff')
+lab.Shell('end_test')
+lab.shell.Close()