From: Alain Spineux Date: Wed, 2 Sep 2020 13:31:32 +0000 (+0200) Subject: BEE Backport regress/tests/py-sample-test.py X-Git-Tag: Release-11.3.2~1186 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2d0c12284055bcb628e8ee1c5dff13f4590c8fb6;p=thirdparty%2Fbacula.git BEE Backport regress/tests/py-sample-test.py This commit is the result of the squash of the following main commits: Author: Alain Spineux Date: Fri Dec 23 11:01:56 2016 +0100 regress: tweak chmox a+x of some test Author: Alain Spineux 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 --- diff --git a/regress/tests/py-sample-test.py b/regress/tests/py-sample-test.py new file mode 100755 index 0000000000..6aea3647ee --- /dev/null +++ b/regress/tests/py-sample-test.py @@ -0,0 +1,41 @@ +#!/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()