-
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.
systemtests: adapted
bareos
test to include list jobs test
- Loading branch information
1 parent
85372de
commit 8667504
Showing
3 changed files
with
86 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
# BAREOS® - Backup Archiving REcovery Open Sourced | ||
# | ||
# Copyright (C) 2021-2021 Bareos GmbH & Co. KG | ||
# | ||
# This program is Free Software; you can redistribute it and/or | ||
# modify it under the terms of version three of the GNU Affero General Public | ||
# License as published by the Free Software Foundation and included | ||
# in the file LICENSE. | ||
# | ||
# This program is distributed in the hope that it will be useful, but | ||
# WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
# 02110-1301, USA. | ||
|
||
set -e | ||
set -o pipefail | ||
set -u | ||
|
||
#shellcheck source=../environment.in | ||
. ./environment | ||
|
||
#shellcheck source=../scripts/functions | ||
. "${rscripts}"/functions | ||
"${rscripts}"/cleanup | ||
"${rscripts}"/setup | ||
|
||
# Fill ${BackupDirectory} with data. | ||
setup_data | ||
|
||
bin/bareos start | ||
|
||
# make sure, director is up and running. | ||
print_debug "$(bin/bconsole <<< "status dir")" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
set -e | ||
set -o pipefail | ||
set -u | ||
# | ||
# Run a simple backup | ||
# then restore it. | ||
# | ||
TestName="$(basename "$(pwd)")" | ||
export TestName | ||
|
||
JobName=backup-bareos-fd | ||
|
||
#shellcheck source=../environment.in | ||
. ./environment | ||
|
||
#shellcheck source=../scripts/functions | ||
. "${rscripts}"/functions | ||
|
||
start_test | ||
|
||
cat <<END_OF_DATA >"$tmp/bconcmds" | ||
@$out /dev/null | ||
messages | ||
@$out $tmp/log-list-jobs.out | ||
run job=$JobName yes | ||
wait | ||
list jobs | ||
quit | ||
END_OF_DATA | ||
|
||
run_bconsole | ||
|
||
#check that `list jobs` returns the correct columms and data | ||
if ! grep "| jobid | name | client | starttime | duration | type | level | jobfiles | jobbytes | jobstatus |" "$tmp"/log-list-jobs.out; then | ||
echo "Missing or wrong list jobs columns. Check $tmp/log-list-jobs.out" >&2 | ||
estat=1 | ||
fi | ||
|
||
if ! grep "| 1 | backup-bareos-fd | bareos-fd | ....-..-.. ..:..:.. | ..:..:.. | B | F | 73 |" "$tmp"/log-list-jobs.out; then | ||
echo "Missing or wrong list jobs data. Check $tmp/log-list-jobs.out" >&2 | ||
estat=1 | ||
fi | ||
|
||
end_test |