]> git.sur5r.net Git - bacula/bacula/commitdiff
Changes for FreeBSD and spell weird correctly
authorKern Sibbald <kern@sibbald.com>
Mon, 29 Sep 2003 15:01:55 +0000 (15:01 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 29 Sep 2003 15:01:55 +0000 (15:01 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@714 91ce42f0-d328-0410-95d8-f526ca767f89

regress/.cvsignore
regress/all-non-root-tests
regress/all-tape-and-file-tests
regress/scripts/bacula-sd.conf.in [new file with mode: 0644]
regress/tests/dev-test-root
regress/tests/etc-test-root
regress/tests/lib-test-root
regress/tests/weird-files-test [new file with mode: 0755]
regress/tests/weird-files2-test [new file with mode: 0755]
regress/weird-files.tar.gz [new file with mode: 0644]

index 6f0d68f2eef5733c1db51da2bac35d18869b319f..120006c64945f0e948da218bbba22990bdeafce5 100644 (file)
@@ -1,7 +1,7 @@
 build
 bin
 test.out
-wierd-files
+weird-files
 diff
 tmp
 working
index aaf2356abc69f3eb0ba79d4f7583b3b973c40624..2b2c48d34ebd4804382fd0aefd4355ec5cc19306 100755 (executable)
@@ -8,12 +8,12 @@ tests/verify-vol-test
 tests/sparse-test
 tests/compressed-test
 tests/sparse-compressed-test
-tests/wierd-files-test
+tests/weird-files-test
 tests/two-jobs-test
 tests/two-vol-test
 tests/six-vol-test
 tests/bscan-test
-tests/wierd-files2-test
+tests/weird-files2-test
 tests/concurrent-jobs-test
 tests/four-concurrent-jobs-test
 tests/bsr-opt-test
index 99a97e520f11ce990bb35068844b62090db5c3ae..857934410abbe3b519ef9c8a04632115432005de 100755 (executable)
@@ -8,12 +8,12 @@ tests/verify-vol-test
 tests/sparse-test
 tests/compressed-test
 tests/sparse-compressed-test
-tests/wierd-files-test
+tests/weird-files-test
 tests/two-jobs-test
 tests/two-vol-test
 tests/six-vol-test
 tests/bscan-test
-tests/wierd-files2-test
+tests/weird-files2-test
 tests/concurrent-jobs-test
 tests/four-concurrent-jobs-test
 tests/bsr-opt-test
diff --git a/regress/scripts/bacula-sd.conf.in b/regress/scripts/bacula-sd.conf.in
new file mode 100644 (file)
index 0000000..47422aa
--- /dev/null
@@ -0,0 +1,74 @@
+#
+# Default Bacula Storage Daemon Configuration file
+#
+#  For Bacula release 1.32 (20 Sep 2003) -- redhat 9
+#
+# You may need to change the name of your tape drive
+#   on the "Archive Device" directive in the Device
+#   resource.  If you change the Name and/or the 
+#   "Media Type" in the Device resource, please ensure
+#   that dird.conf has corresponding changes.
+#
+
+Storage {                             # definition of myself
+  Name = rufus-sd
+  SDPort = 8103                  # Director's port      
+  WorkingDirectory = "/home/kern/bacula/regress/working"
+  Pid Directory = "/home/kern/bacula/regress/working"
+}
+
+#
+# List Directors who are permitted to contact Storage daemon
+#
+Director {
+  Name = rufus-dir
+  Password = "BzlEl8haeFmnv/Lv8V6zDzUBgFFQNsUtny6VkmccQpOy"
+}
+
+#
+# Devices supported by this Storage daemon
+# To connect, the Director's bacula-dir.conf must have the
+#  same Name and MediaType. 
+#
+
+Device {
+  Name = FileStorage
+  Media Type = File
+  Archive Device = @tmpdir@
+  LabelMedia = yes;                   # lets Bacula label unlabeled media
+  Random Access = Yes;
+  AutomaticMount = yes;               # when device opened, read it
+  RemovableMedia = no;
+  AlwaysOpen = no;
+}
+
+#Device {
+#  Name = DDS-4                        # 
+#  Media Type = DDS-4
+#  Archive Device = /dev/nst0
+#  AutomaticMount = yes;               # when device opened, read it
+#  AlwaysOpen = yes;
+#  RemovableMedia = yes;
+#}
+
+#
+# A very old Exabyte with no end of media detection
+#
+#Device {
+#  Name = "Exabyte 8mm"
+#  Media Type = "8mm"
+#  Archive Device = /dev/nst0
+#  Hardware end of medium = No;
+#  AutomaticMount = yes;               # when device opened, read it
+#  AlwaysOpen = Yes;
+#  RemovableMedia = yes;
+#}
+
+# 
+# Send all messages to the Director, 
+# mount messages also are sent to the email address
+#
+Messages {
+  Name = Standard
+  director = rufus-dir = all
+}
index 5ede9e7c0b2049423937edf370f69d982d2397cc..a5a01c7400d6f27db5e47b78375d971930078a45 100755 (executable)
@@ -8,6 +8,7 @@ echo " "
 echo " === /dev save/restore test ==="
 echo " "
 echo " "
+UID=`/usr/bin/id -g`
 if [ $UID != 0 ] ; then
    echo " "
    echo "You must be root to run this test."
index 72f40f9786906259f85216507dff62055309a772..e5770209a350c06148f3c518a9ef7d8ddadfa947 100755 (executable)
@@ -8,6 +8,7 @@ echo " "
 echo " === /etc save/restore test ==="
 echo " "
 echo " "
+UID=`/usr/bin/id -g`
 if [ $UID != 0 ] ; then
    echo " "
    echo "You must be root to run this test."
index 43aeb12edafe5153601bea5c0ffc4598a41ce8ab..7e9c800445e4ae536949d23d601b8b66812864f0 100755 (executable)
@@ -8,6 +8,7 @@ echo " "
 echo " === /lib save/restore test ==="
 echo " "
 echo " "
+UID=`/usr/bin/id -g`
 if [ $UID != 0 ] ; then
    echo " "
    echo "You must be root to run this test."
diff --git a/regress/tests/weird-files-test b/regress/tests/weird-files-test
new file mode 100755 (executable)
index 0000000..7237d40
--- /dev/null
@@ -0,0 +1,68 @@
+#!/bin/sh
+#
+# Run a simple backup of the Bacula build directory
+#   then restore it.
+#
+if test ! -d weird-files ; then
+   echo " "
+   echo "Weird files not configured. Test not run."
+   exit 0
+fi
+cwd=`pwd`
+scripts/copy-test-confs
+scripts/cleanup
+echo "${cwd}/weird-files" >/tmp/file-list
+bin/bacula stop 2>&1 >/dev/null
+bin/drop_sqlite_tables
+bin/make_sqlite_tables
+
+echo " "
+echo " "
+echo " === Starting weird filenames test ==="
+echo " === Starting weird filenames test ===" >>working/log
+echo " "
+
+bin/bacula start 2>&1 >/dev/null
+bin/console -c bin/console.conf <<END_OF_DATA
+@output /dev/null
+messages
+@output tmp/log1.out
+label storage=File
+TestVolume001
+run job=NightlySave
+yes
+wait
+messages
+@# 
+@# now do a restore
+@#
+@output tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores current all
+yes
+wait
+messages
+@output
+quit
+END_OF_DATA
+bin/bacula stop 2>&1 >/dev/null
+${cwd}/bin/testls weird-files >${cwd}/tmp/original
+cd tmp/bacula-restores${cwd}
+${cwd}/bin/testls weird-files >${cwd}/tmp/restored
+cd ${cwd}
+grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
+bstat=$?
+grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
+rstat=$?
+diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
+if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
+   echo " "
+   echo " "
+   echo "  !!!!! Weird files test failed!!! !!!!! "
+   echo "  !!!!! Weird files test failed!!! !!!!! " >>test.out
+   echo " "
+else
+   echo "  ===== Weird files test OK ===== "
+   echo "  ===== Weird files test OK ===== " >>test.out
+   cd ${cwd}
+   scripts/cleanup
+fi
diff --git a/regress/tests/weird-files2-test b/regress/tests/weird-files2-test
new file mode 100755 (executable)
index 0000000..a618c4e
--- /dev/null
@@ -0,0 +1,84 @@
+#!/bin/sh
+#
+# Run a simple backup of the Bacula build directory
+#   then restore it.
+#
+if test ! -d weird-files ; then
+   echo " "
+   echo "weird files not configured. Test not run."
+   exit 0
+fi
+cwd=`pwd`
+scripts/copy-test-confs
+scripts/cleanup
+rm -rf weird-files2
+cp -a weird-files weird-files2
+echo "${cwd}/weird-files2" >/tmp/file-list
+bin/bacula stop 2>&1 >/dev/null
+bin/drop_sqlite_tables
+bin/make_sqlite_tables
+
+echo " "
+echo " "
+echo " === Starting weird filenames2 test ==="
+echo " === Starting weird filenames2 test ===" >>working/log
+echo " "
+
+bin/testls weird-files2 >${cwd}/tmp/original
+bin/bacula start 2>&1 >/dev/null
+bin/console -c bin/console.conf <<END_OF_DATA
+@output /dev/null
+messages
+@output tmp/log1.out
+label storage=File volume=TestVolume001
+run job=NightlySave yes
+wait
+messages
+@output
+quit
+END_OF_DATA
+#
+# Now mess up the a hard link, and a soft link
+#
+cd weird-files2
+rm -f hard-file2
+ln hard-file3 hard-file2
+rm -f soft-file2
+ln -s soft-file3 soft-file2
+cd ${cwd}
+bin/console -c bin/console.conf <<END_OF_DATA
+@output /dev/null
+messages
+@# 
+@# now do a restore
+@#
+@output tmp/log2.out
+restore where=
+5
+done
+yes
+wait
+messages
+@output
+quit
+END_OF_DATA
+bin/bacula stop 2>&1 >/dev/null
+bin/testls weird-files2 >${cwd}/tmp/restored
+grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
+bstat=$?
+grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
+rstat=$?
+diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
+if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
+   echo " "
+   echo " "
+   echo "  !!!!! Weird files2 test failed!!! !!!!! "
+   echo "  !!!!! Weird files2 test failed!!! !!!!! " >>test.out
+   echo " "
+else
+   echo "  ===== Weird files2 test OK ===== "
+   echo "  ===== Weird files2 test OK ===== " >>test.out
+   cd ${cwd}
+   scripts/cleanup
+   rm -rf weird-files2
+fi
diff --git a/regress/weird-files.tar.gz b/regress/weird-files.tar.gz
new file mode 100644 (file)
index 0000000..0ecbe3f
Binary files /dev/null and b/regress/weird-files.tar.gz differ