Skip to content

Commit

Permalink
Add check for secure erase command reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Oct 29, 2015
1 parent d777c92 commit d683453
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion configs/secure-erase-test/bareos-dir.conf.in
Expand Up @@ -55,7 +55,7 @@ Director { # define myself
Password = "@dir_password@" # Console password
Messages = Daemon
Auditing = yes
Secure Erase Command = "@scriptdir@/wipe.sh"
Secure Erase Command = "@scriptdir@/wipe-dir.sh"
# Enable the Heartbeat if you experience connection losses
# (eg. because of your router or firewall configuration).
# Additionally the Heartbeat can be enabled in bareos-sd and bareos-fd.
Expand Down
2 changes: 1 addition & 1 deletion configs/secure-erase-test/bareos-fd.conf.in
Expand Up @@ -12,7 +12,7 @@
FileDaemon { # definition of myself
Name = @hostname@-fd
Maximum Concurrent Jobs = 20
Secure Erase Command = "@scriptdir@/wipe.sh"
Secure Erase Command = "@scriptdir@/wipe-fd.sh"

# remove comment from "Plugin Directory" to load plugins from specified directory.
# if "Plugin Names" is defined, only the specified plugins will be loaded,
Expand Down
2 changes: 1 addition & 1 deletion configs/secure-erase-test/bareos-sd.conf.in
Expand Up @@ -13,7 +13,7 @@
Storage { # definition of myself
Name = @hostname@-sd
Maximum Concurrent Jobs = 20
Secure Erase Command = "@scriptdir@/wipe.sh"
Secure Erase Command = "@scriptdir@/wipe-sd.sh"

# remove comment from "Plugin Directory" to load plugins from specified directory.
# if "Plugin Names" is defined, only the specified plugins will be loaded,
Expand Down
30 changes: 29 additions & 1 deletion tests/secure-erase-test
Expand Up @@ -9,7 +9,11 @@ JobName=backup

scripts/cleanup
cp configs/secure-erase-test/*.conf bin
cp -p scripts/wipe.sh bin
cp -p scripts/wipe.sh bin/wipe.sh

ln bin/wipe.sh bin/wipe-dir.sh
ln bin/wipe.sh bin/wipe-sd.sh
ln bin/wipe.sh bin/wipe-fd.sh

#
# Zap out any schedule in default conf file so that
Expand Down Expand Up @@ -244,5 +248,29 @@ else
estat=10
fi

#
# check if secure erase cmds are reported correctly in the job report
#
grep 'Dir Secure Erase Cmd.*wipe-dir.sh' tmp/log4.out ${tmp}/log3.out 2>&1 >/dev/null
if test $? -eq 0; then
print_debug "OK, Dir Secure Erase Command is correctly reported"
else
estat=11
fi

grep 'SD Secure Erase Cmd.*wipe-sd.sh' tmp/log4.out ${tmp}/log3.out 2>&1 >/dev/null
if test $? -eq 0; then
print_debug "OK, Sd Secure Erase Command is correctly reported"
else
estat=12
fi

grep 'FD Secure Erase Cmd.*wipe-fd.sh' tmp/log4.out ${tmp}/log3.out 2>&1 >/dev/null
if test $? -eq 0; then
print_debug "OK, Fd Secure Erase Command is correctly reported"
else
estat=13
fi


end_test

0 comments on commit d683453

Please sign in to comment.