-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix stale volumes/devices in bareos-sd after failure to acquire a read device on MAC jobs
- Loading branch information
Showing
41 changed files
with
247 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
systemtests/tests/copy/etc/bareos/bareos-dir.d/storage/NoSuchStorage.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Storage { | ||
Name = NoSuchStorage | ||
Address = localhost | ||
Password = "does not matter" | ||
Device = NoSuchDevice | ||
Media Type = NoSuchType | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
set -e | ||
set -o pipefail | ||
set -u | ||
|
||
TestName=01-backup | ||
|
||
#shellcheck source=../environment.in | ||
. ./environment | ||
|
||
#shellcheck source=../scripts/functions | ||
. "${rscripts}"/functions | ||
|
||
log="$tmp/$TestName.log" | ||
|
||
check_log() { | ||
if ! grep -q "$@" "$log"; then | ||
echo "'$*' not found in $log" >&2 | ||
estat=1 | ||
fi | ||
} | ||
|
||
setup_data | ||
|
||
start_test | ||
|
||
cat <<END_OF_DATA >"$tmp/bconcmds" | ||
@$out /dev/null | ||
messages | ||
@$out $log | ||
label volume=TestVolume001 storage=File pool=Full | ||
run job=backup-bareos-fd yes | ||
wait | ||
update volume=TestVolume001 volstatus=Used | ||
messages | ||
quit | ||
END_OF_DATA | ||
|
||
run_bconsole "$tmp/bconcmds" | ||
|
||
check_for_zombie_jobs storage=File | ||
|
||
check_log -F 'Catalog record for Volume "TestVolume001", Slot 0 successfully created.' | ||
check_log 'Termination:.*Backup OK' | ||
|
||
end_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
set -e | ||
set -o pipefail | ||
set -u | ||
|
||
TestName=02-copy | ||
|
||
#shellcheck source=../environment.in | ||
. ./environment | ||
|
||
#shellcheck source=../scripts/functions | ||
. "${rscripts}"/functions | ||
|
||
log="$tmp/$TestName.log" | ||
|
||
check_log() { | ||
if ! grep -q "$@" "$log"; then | ||
echo "'$*' not found in $log" >&2 | ||
estat=1 | ||
fi | ||
} | ||
|
||
start_test | ||
|
||
cat <<END_OF_DATA >"$tmp/bconcmds" | ||
@$out /dev/null | ||
messages | ||
@$out $log | ||
label volume=TestCopyVolume001 storage=File2 pool=FullCopy | ||
run copy yes | ||
wait | ||
messages | ||
quit | ||
END_OF_DATA | ||
|
||
run_bconsole "$tmp/bconcmds" | ||
|
||
check_for_zombie_jobs storage=File | ||
|
||
check_log -F 'Catalog record for Volume "TestCopyVolume001", Slot 0 successfully created.' | ||
check_log 'Termination:.*Copying OK' | ||
|
||
end_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
set -e | ||
set -o pipefail | ||
set -u | ||
|
||
TestName=03-impossible-copy | ||
|
||
#shellcheck source=../environment.in | ||
. ./environment | ||
|
||
#shellcheck source=../scripts/functions | ||
. "${rscripts}"/functions | ||
|
||
log="$tmp/$TestName.log" | ||
|
||
check_logged() { | ||
if ! grep -q "$@" "$log"; then | ||
echo "'$*' not found in $log" >&2 | ||
estat=1 | ||
fi | ||
} | ||
check_not_logged() { | ||
if grep -q "$@" "$log"; then | ||
echo "'$*' found in $log" >&2 | ||
estat=1 | ||
fi | ||
} | ||
|
||
start_test | ||
|
||
cat <<END_OF_DATA >"$tmp/bconcmds" | ||
@$out /dev/null | ||
messages | ||
@$out $log | ||
sqlquery | ||
UPDATE Media SET mediatype = 'NoSuchType' WHERE volumename = 'TestVolume001'; | ||
run copy yes | ||
wait | ||
messages | ||
status storage=File2 | ||
quit | ||
END_OF_DATA | ||
|
||
run_bconsole "$tmp/bconcmds" | ||
|
||
check_for_zombie_jobs storage=File | ||
|
||
check_logged -F 'Changing read device. Want Media Type="NoSuchType"' | ||
check_logged -F '*** Copying Error ***' | ||
# check if there is a stale volume in the storage's volume list | ||
check_not_logged -F 'on device "FileStorage2" (storage)' | ||
|
||
end_test |
Oops, something went wrong.