Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/bareos/bareos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Storz <philipp.storz@bareos.com>2022-10-25 15:24:57 +0300
committerAndreas Rogge <andreas.rogge@bareos.com>2022-11-07 17:56:58 +0300
commitc23c6bbbdb7393d73cd1b571077ccf55ae2e8bd7 (patch)
tree21d7e024476d993f1ca1acc609919011b558e34a /systemtests
parentf34420023c0260f3d1c5ef85fc3a5ba5962de68b (diff)
systemtest: verify that fileset text is updated in existing fileset db entries
Diffstat (limited to 'systemtests')
-rwxr-xr-xsystemtests/tests/bareos/testrunner-filesettext-is-updated68
1 files changed, 68 insertions, 0 deletions
diff --git a/systemtests/tests/bareos/testrunner-filesettext-is-updated b/systemtests/tests/bareos/testrunner-filesettext-is-updated
new file mode 100755
index 000000000..d3ec000bb
--- /dev/null
+++ b/systemtests/tests/bareos/testrunner-filesettext-is-updated
@@ -0,0 +1,68 @@
+#!/bin/bash
+set -e
+set -o pipefail
+set -u
+
+# Delete fileset text from database and check that it is readded
+# when estimate call uses the fileset
+TestName="$(basename "$(pwd)")"
+export TestName
+
+
+#shellcheck source=../environment.in
+. ./environment
+
+#shellcheck source=../scripts/functions
+. "${rscripts}"/functions
+
+start_test
+
+run_log=$tmp/run.out
+filesetwithtext=$tmp/fileset-with-filesettext
+filesetwithouttext=$tmp/fileset-without-filesettext
+JobName=backup-bareos-fd
+
+rm -f $run_log $filesetwithtext $filesetwithouttext
+
+
+cat <<END_OF_DATA >"$tmp/bconcmds"
+@$out /dev/null
+messages
+@$out $run_log
+@# first do an estimate to be sure the fileset db entry exists
+estimate listing job=$JobName
+
+@# remove filesettext from db entry
+sqlquery
+update fileset set filesettext='';
+
+@$out $filesetwithouttext
+@# display fileset entry (without filesettext)
+sqlquery
+select * from fileset;
+
+@# call estimate to update the fileset db entry and readd the filesettext
+estimate listing job=$JobName
+
+@#verify the fileset text is added again
+@$out $filesetwithtext
+sqlquery
+select * from fileset;
+END_OF_DATA
+
+run_bconsole
+
+run_bconsole
+
+# check that the fileset has not the fileset text after it was deleted
+expect_grep "| 1 | SelfTest | FileSet {" \
+ "$filesetwithtext" \
+ "The expected fileset text was not found."
+
+# check that the fileset has the fileset was added by the estimate call
+expect_grep "| 1 | SelfTest | |" \
+ "$filesetwithouttext" \
+ "The expected fileset without text was not found."
+
+
+end_test