From: Git Backport Process Date: Wed, 2 Sep 2020 13:11:54 +0000 (+0200) Subject: BEE Backport regress/tests/encrypt-test X-Git-Tag: Release-11.3.2~1231 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93cd99f584d2df9120a8e1b98a92844ef9208524;p=thirdparty%2Fbacula.git BEE Backport regress/tests/encrypt-test This commit is the result of the squash of the following main commits: Author: Eric Bollengier Date: Tue Jul 21 10:28:13 2020 +0200 regress: Add copyright to regress scripts Author: Kern Sibbald Date: Sat Jul 16 10:37:54 2016 +0200 regress: use correct variable to execute scripts Author: Eric Bollengier Date: Tue Dec 10 16:35:08 2013 +0100 regress: Add encrypt-test to test new PkiCipher and PkiDigest directives --- diff --git a/regress/tests/encrypt-test b/regress/tests/encrypt-test new file mode 100755 index 0000000000..010e515d15 --- /dev/null +++ b/regress/tests/encrypt-test @@ -0,0 +1,133 @@ +#!/bin/sh +# +# Copyright (C) 2000-2020 Kern Sibbald +# License: BSD 2-Clause; see file LICENSE-FOSS +# +# Run tests with encryption configuration (cipher and digest) +# +TestName="encrypt-test" +JobName=Crypto +. scripts/functions + +scripts/cleanup +scripts/copy-crypto-confs +echo "${cwd}/build" >${cwd}/tmp/file-list + +$bperl -e 'add_attribute("$conf/bacula-fd.conf", "Pki Cipher", "aes256", "FileDaemon")' + +change_jobname NightlySave $JobName +start_test + +cat <${cwd}/tmp/bconcmds +@output /dev/null +messages +@$out ${cwd}/tmp/log1.out +label storage=File volume=TestVolume001 +END_OF_DATA + +run_bacula + +cat <${cwd}/tmp/bconcmds +@$out ${cwd}/tmp/log1.out +@#setdebug level=10 fd +purge volume=TestVolume001 yes +run level=full job=$JobName yes +wait +messages +@# +@# now do a restore +@# +@$out ${cwd}/tmp/log2.out +@#setdebug level=10 fd +restore where=${cwd}/tmp/bacula-restores storage=File +5 +mark * +done +yes +wait +messages +quit +END_OF_DATA + +run_bconsole + +check_two_logs +check_restore_diff + +################################################################ +# test with a different combination + +$bperl -e 'add_attribute("$conf/bacula-fd.conf", "Pki Digest", "sha256", "FileDaemon")' +$bperl -e 'add_attribute("$conf/bacula-fd.conf", "Pki Cipher", "aes192", "FileDaemon")' +$scripts/bacula-ctl-fd restart + +rm -rf $cwd/tmp/bacula-restores + +run_bconsole +check_two_logs +check_restore_diff + +################################################################ + +# $bperl -e 'add_attribute("$conf/bacula-fd.conf", "Pki Digest", "sha512", "FileDaemon")' +# $scripts/bacula-ctl-fd restart +# +# rm -rf $cwd/tmp/bacula-restores +# +# run_bconsole +# check_two_logs +# check_restore_diff + +################################################################ + +$bperl -e 'add_attribute("$conf/bacula-fd.conf", "Pki Cipher", "blowfish", "FileDaemon")' +$scripts/bacula-ctl-fd restart + +rm -rf $cwd/tmp/bacula-restores + +run_bconsole +check_two_logs +check_restore_diff + +################################################################ + +touch $cwd/build/po/fr.po + +$bperl -e 'add_attribute("$conf/bacula-fd.conf", "Pki Cipher", "aes256", "FileDaemon")' + +# run incremental job with a different cipher +cat <${cwd}/tmp/bconcmds +@$out ${cwd}/tmp/log1.out +@#setdebug level=10 fd +run job=$JobName yes +wait +messages +@# +@# now do a restore +@# +@$out ${cwd}/tmp/log2.out +@#setdebug level=10 fd +restore where=${cwd}/tmp/bacula-restores storage=File +5 +mark * +done +yes +wait +messages +quit +END_OF_DATA + +$scripts/bacula-ctl-fd restart + +rm -rf $cwd/tmp/bacula-restores + +run_bconsole +check_two_logs +check_restore_diff + +################################################################ + +check_for_zombie_jobs storage=File +stop_bacula + +end_test