scripts/regress-config
scripts/update-ctest
scripts/mtx-changer
+<<<<<<< HEAD
+=======
+scripts/k8s_backend
+scripts/bacula-dir.conf.gpfs
+>>>>>>> e694fcf7a1... regress: Add regress script for GPFS code
/tmp2/
# you can use: unix:///var/run/docker.sock
# to simulate remote operation with local socket
#PLUGDOCKERHOST="tcp://10.0.0.1:2376"
+
+#
+# This is a config variable for GPFS regression tests
+# It should point to the mounted GPFS
+#
+#GPFSDIR=/gpfs
sed -f ${out} ${rscripts}/virtualfull-extreme-bacula-dir.conf.in >${rscripts}/virtualfull-extreme-bacula-dir.conf
sed -f ${out} ${rscripts}/test-console.conf.in >${rscripts}/test-console.conf
sed -f ${out} ${rscripts}/crypto-bacula-fd.conf.in >${rscripts}/crypto-bacula-fd.conf
+sed -f ${out} ${rscripts}/gpfs-bacula-dir.conf.in >${rscripts}/gpfs-bacula-dir.conf
sed -f ${out} ${rscripts}/bacula-dir-tape.conf.in >${rscripts}/bacula-dir-tape.conf
sed -f ${out} ${rscripts}/bacula-dir-2client.conf.in >${rscripts}/bacula-dir-2client.conf
sed -f ${out} ${rscripts}/bacula-dir-2media-virtual.conf.in >${rscripts}/bacula-dir-2media-virtual.conf
cp ${conf}/bacula-sd.conf ${tmp}/bac$$
sed "s% /tmp%${tmp}%g" ${tmp}/bac$$ >${conf}/bacula-sd.conf
fi
-chmod 755 ${rscripts}/cleanup-*tape ${rscripts}/cleanup-*drive ${rscripts}/prepare-two-tapes
+chmod 755 ${rscripts}/cleanup-*tape ${rscripts}/cleanup-*drive ${rscripts}/prepare-two-tapes
rm -f ${tmp}/tmp/bac$$
cp ${scripts}/mtx-changer ${tmp}/bac$$
sed "s%^MTX.*$%MTX=${AUTOCHANGER_PATH}%g" ${tmp}/bac$$ >${scripts}/mtx-changer
--- /dev/null
+#
+# Default Bacula Director Configuration file
+#
+# The only thing that MUST be changed is to add one or more
+# file or directory names in the Include directive of the
+# FileSet resource.
+#
+# For Bacula release 1.39.27 (24 October 2006) -- debian testing/unstable
+#
+# You might also want to change the default email address
+# from root to your address. See the "mail" and "operator"
+# directives in the Messages resource.
+#
+
+Director { # define myself
+ Name = @hostname@-dir
+ DIRPort = @dirport@ # where we listen for UA connections
+ QueryFile = "@scriptdir@/query.sql"
+ WorkingDirectory = "@working_dir@"
+ PidDirectory = "@piddir@"
+ SubSysDirectory = "@subsysdir@"
+ Maximum Concurrent Jobs = 4
+ Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3" # Console password
+ Messages = Standard
+}
+
+JobDefs {
+ Name = "DefaultJob"
+ Type = Backup
+ Level = Incremental
+ Client = @hostname@-fd
+ FileSet = GPFS
+ Storage = File
+ Messages = Standard
+ Pool = Default
+ Priority = 10
+ Maximum Concurrent Jobs = 16
+}
+
+FileSet {
+ Name = GPFS
+ Include {
+ Options {
+ aclsupport = yes
+ }
+ File = <@tmpdir@/file-list
+ }
+}
+
+Job {
+ Name = backup
+ Accurate = yes
+ JobDefs = DefaultJob
+}
+
+# Standard Restore template, to be changed by Console program
+Job {
+ Name = "RestoreFiles"
+ Type = Restore
+ Client=@hostname@-fd
+ FileSet= GPFS
+ Storage = File
+ Messages = Standard
+ Pool = Default
+ Where = @tmpdir@/bacula-restores
+}
+
+# Client (File Services) to backup
+Client {
+ Name = @hostname@-fd
+ Address = @hostname@
+ FDPort = @fdport@
+ Catalog = MyCatalog
+ Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc" # password for FileDaemon
+ File Retention = 30d # 30 days
+ Job Retention = 180d # six months
+ AutoPrune = yes # Prune expired Jobs/Files
+ Maximum Concurrent Jobs = 4
+}
+
+# Definiton of file storage device
+Storage {
+ Name = File
+ Address = @hostname@ # N.B. Use a fully qualified name here
+ SDPort = @sdport@
+ Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
+ Device = FileStorage
+ Media Type = File
+ Maximum Concurrent Jobs = 4
+}
+
+# Generic catalog service
+Catalog {
+ Name = MyCatalog
+ @libdbi@
+ dbname = @db_name@; user = @db_user@; password = "@db_password@"
+}
+
+Messages {
+ Name = Standard
+ console = all, !skipped, saved
+ catalog = all, !skipped
+}
+
+# Default pool definition
+Pool {
+ Name = Default
+ Pool Type = Backup
+ Recycle = yes # Bacula can automatically recycle Volumes
+ AutoPrune = yes # Prune expired volumes
+ Volume Retention = 365d # one year
+}
--- /dev/null
+#!/bin/sh
+#
+# Copyright (C) 2000-2017 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+. scripts/functions
+/bin/cp -f ${rscripts}/gpfs-bacula-dir.conf ${conf}/bacula-dir.conf
+/bin/cp -f ${rscripts}/test-bacula-sd.conf ${conf}/bacula-sd.conf
+/bin/cp -f ${rscripts}/test-bacula-fd.conf ${conf}/bacula-fd.conf
+/bin/cp -f ${rscripts}/test-console.conf ${conf}/bconsole.conf
+/bin/cp -f ${rscripts}/test-console.conf ${conf}/bat.conf
+
+${rscripts}/set_tape_options
tname=$1
tdirloc=$2
make -C ${src}/${tdirloc} ${tname}
-${src}/${tdirloc}/${tname}
+if test $? -eq 0; then
+ ${src}/${tdirloc}/${tname}
+fi
exit $?
}
blevel="full"
if [ "x$2" != "x" ]
then
- blevel=$2
+ blevel=$2
fi
printf " backup test${ltest} ... "
cat << END_OF_DATA >${tmp}/bconcmds
lplug=$LPLUG
if [ "x$3" != "x" ]
then
- lplug=$3
+ lplug=$3
fi
printf " listing test${ltest} ... "
cat << END_OF_DATA >${tmp}/bconcmds
--- /dev/null
+#!/bin/sh
+#
+# Copyright (C) 2000-2015 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+
+#
+# Run a backup of the GPFS directory with some acls then restore it.
+# The test requires $GPFSDIR env variable set which will points to gpfs mounted filesystem
+#
+TestName="gpfs-acl-test"
+JobName=backup
+. scripts/functions
+
+#
+# See if the right software is installed.
+#
+if test x$GPFSDIR = x; then
+ echo "$TestName skipped: \$GPFSDIR not set but required"
+ exit 0
+fi
+
+if test x`uname -s` != xLinux; then
+ echo "$TestName skipped: test is supported on Linux only"
+ exit 0
+fi
+
+mmgetacl $GPFSDIR 2>&1 >/dev/null
+if test $? -ne 0; then
+ echo "$TestName skipped: mmgetacl not installed"
+ exit 0
+fi
+
+scripts/cleanup
+scripts/gpfs-copy-confs
+
+d=$GPFSDIR/acl
+rm -rf $d
+mkdir -p $d
+mkdir -p $d/acl-dir
+cp ${cwd}/bin/bconsole $d/bconsole
+cp ${cwd}/bin/bconsole $d/other
+
+cat > $d/acl.param.acl << EOD
+#owner:root
+#group:root
+user::rwxc
+group::rwx-
+other::--x-
+mask::rwxc
+user:bacula:r-xc
+group:sys:rwx-
+group:adm:rw--
+EOD
+
+cat > $d/acl.param.nfs4 << EOD
+#NFSv4 ACL
+#owner:root
+#group:root
+special:owner@:rwxc:allow
+ (X)READ/LIST (X)WRITE/CREATE (X)APPEND/MKDIR (X)SYNCHRONIZE (X)READ_ACL (X)READ_ATTR (X)READ_NAMED
+ (-)DELETE (-)DELETE_CHILD (X)CHOWN (X)EXEC/SEARCH (X)WRITE_ACL (X)WRITE_ATTR (X)WRITE_NAMED
+
+user:bacula:-w--:deny
+ (-)READ/LIST (X)WRITE/CREATE (X)APPEND/MKDIR (-)SYNCHRONIZE (-)READ_ACL (-)READ_ATTR (-)READ_NAMED
+ (-)DELETE (X)DELETE_CHILD (-)CHOWN (-)EXEC/SEARCH (-)WRITE_ACL (X)WRITE_ATTR (-)WRITE_NAMED
+
+user:bacula:r-xc:allow
+ (X)READ/LIST (-)WRITE/CREATE (-)APPEND/MKDIR (X)SYNCHRONIZE (X)READ_ACL (X)READ_ATTR (X)READ_NAMED
+ (-)DELETE (-)DELETE_CHILD (-)CHOWN (X)EXEC/SEARCH (X)WRITE_ACL (-)WRITE_ATTR (-)WRITE_NAMED
+
+special:group@:rwx-:allow
+ (X)READ/LIST (X)WRITE/CREATE (X)APPEND/MKDIR (X)SYNCHRONIZE (X)READ_ACL (X)READ_ATTR (X)READ_NAMED
+ (-)DELETE (-)DELETE_CHILD (-)CHOWN (X)EXEC/SEARCH (-)WRITE_ACL (-)WRITE_ATTR (-)WRITE_NAMED
+
+group:sys:rwx-:allow
+ (X)READ/LIST (X)WRITE/CREATE (X)APPEND/MKDIR (X)SYNCHRONIZE (X)READ_ACL (X)READ_ATTR (X)READ_NAMED
+ (-)DELETE (-)DELETE_CHILD (-)CHOWN (X)EXEC/SEARCH (-)WRITE_ACL (-)WRITE_ATTR (-)WRITE_NAMED
+
+group:adm:rw--:allow
+ (X)READ/LIST (X)WRITE/CREATE (X)APPEND/MKDIR (X)SYNCHRONIZE (X)READ_ACL (X)READ_ATTR (X)READ_NAMED
+ (-)DELETE (-)DELETE_CHILD (-)CHOWN (-)EXEC/SEARCH (-)WRITE_ACL (-)WRITE_ATTR (-)WRITE_NAMED
+
+group:adm:--xc:deny
+ (-)READ/LIST (-)WRITE/CREATE (-)APPEND/MKDIR (-)SYNCHRONIZE (-)READ_ACL (-)READ_ATTR (-)READ_NAMED
+ (-)DELETE (X)DELETE_CHILD (-)CHOWN (X)EXEC/SEARCH (X)WRITE_ACL (X)WRITE_ATTR (-)WRITE_NAMED
+
+special:everyone@:--x-:allow
+ (-)READ/LIST (-)WRITE/CREATE (-)APPEND/MKDIR (X)SYNCHRONIZE (X)READ_ACL (X)READ_ATTR (X)READ_NAMED
+ (-)DELETE (-)DELETE_CHILD (-)CHOWN (X)EXEC/SEARCH (-)WRITE_ACL (-)WRITE_ATTR (-)WRITE_NAMED
+
+EOD
+
+mmputacl -d -i $d/acl.param.acl $d/acl-dir 2>/dev/null 1>/dev/null
+mmputacl -i $d/acl.param.acl $d/bconsole 2>/dev/null 1>/dev/null
+mmputacl -i $d/acl.param.nfs4 $d/other 2>/dev/null 1>/dev/null
+
+cp ${cwd}/bin/bconsole $d/acl-dir/bconsole
+
+cat > ${tmp}/file-list << EOD
+$d/acl-dir
+$d/bconsole
+$d/other
+EOD
+
+change_jobname backup $JobName
+start_test
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@output /dev/null
+messages
+@$out ${cwd}/tmp/log1.out
+label volume=TestVolume001 storage=File1 pool=File slot=1 drive=0
+setdebug level=500 trace=1 client
+setdebug level=500 trace=1 director
+@#setdebug level=300 trace=1 storage=File1
+run job=$JobName yes
+wait
+messages
+@#
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out
+restore where=${d}/bacula-restores select all done
+yes
+wait
+messages
+quit
+END_OF_DATA
+
+# create a file list for backup
+
+run_bacula
+check_for_zombie_jobs storage=File1
+stop_bacula
+
+# now get restored acls
+mmgetacl -d $d/acl-dir -o ${tmp}/acl-dir.default.acl 2>/dev/null 1>/dev/null
+mmgetacl $d/bconsole -o ${tmp}/bconsole.access.acl 2>/dev/null 1>/dev/null
+mmgetacl $d/other -o ${tmp}/other.access.nfs4 2>/dev/null 1>/dev/null
+
+diff -u ${tmp}/acl-dir.default.acl $d/acl.param.acl
+if [ $? -ne 0 ]; then
+ rstat=1
+fi
+
+diff -u ${tmp}/bconsole.access.acl $d/acl.param.acl
+if [ $? -ne 0 ]; then
+ rstat=1
+fi
+
+diff -u ${tmp}/other.access.nfs4 $d/acl.param.nfs4
+if [ $? -ne 0 ]; then
+ rstat=1
+fi
+
+check_two_logs
+# check_restore_diff
+
+if [ x$REGRESS_DEBUG != x ]; then
+ rm -rf $d
+fi
+
+end_test