From b82b231b01ee9dbb48da02efbd7351ded67f8b0c Mon Sep 17 00:00:00 2001 From: Alain Spineux Date: Fri, 3 Jun 2022 13:39:08 +0200 Subject: [PATCH] regress: add lsmark-test - test that lsmark show marked files that are in sub-directories and shows directory name --- regress/tests/lsmark-test | 92 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100755 regress/tests/lsmark-test diff --git a/regress/tests/lsmark-test b/regress/tests/lsmark-test new file mode 100755 index 000000000..cea80e39e --- /dev/null +++ b/regress/tests/lsmark-test @@ -0,0 +1,92 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2022 Bacula Systems SA +# License: BSD 2-Clause; see file LICENSE-FOSS +# +# Run a simple backup of the Bacula build directory +# select some file to restore and see if lsmark show the right one + +TestName="lsmark-test" +JobName=backup +. scripts/functions + +scripts/cleanup +scripts/copy-test-confs +echo "${cwd}/build" >${cwd}/tmp/file-list + +start_test + +cat <$tmp/bconcmds +@output /dev/null +messages +@$out $tmp/log1.out +setdebug level=4 storage=File +setdebug level=1 client +label storage=File volume=TestVolume001 +run job=Simple yes +wait +messages +@# +@# now do a restore +@# +@$out $tmp/log2.out +setdebug level=4 storage=File +restore where=$tmp/bacula-restores select +cd "$cwd/build/src/plugins/fd/pluginlib" +mark iso8601.h +cd "$cwd/build/src/plugins/fd +mark hello-fd.c +cd "$cwd/build/src/plugins/fd/kubernetes-backend/baculak8s/plugins/k8sbackend" +mark pvcdata.py +cd "$cwd/build/src/plugins/fd/kubernetes-backend/baculak8s/plugins" +mark fs_plugin.py +cd "$cwd/build/src/plugins/fd/kubernetes-backend/baculak8s/io/services" +mark plugin_params_io.py +cd "$cwd/build/src/plugins/fd/kubernetes-backend/baculak8s/io" +mark log.py +cd "$cwd/build/src/plugins/fd/kubernetes-backend/baculak8s/io/jobs" +mark restore_io.py +cd "$cwd/build +lsmark +. +no +quit +END_OF_DATA + +run_bacula +check_for_zombie_jobs storage=File +stop_bacula + +# select the lsmark output (there is 19 lines +grep -A 19 "\$ lsmark" $tmp/log2.out > $tmp/lsmark.out +# this is what is expected from lsmark +cat > $tmp/lsmark.expected <