Skip to content

Commit

Permalink
systemtests: updated bareos test to incude status subscriptions test
Browse files Browse the repository at this point in the history
  • Loading branch information
alaaeddineelamri authored and arogge committed Dec 14, 2021
1 parent 19e8f0b commit 766feb7
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Director { # define myself
Password = "@dir_password@" # Console password
Messages = Daemon
Auditing = yes
Subscriptions = 10

# Enable the Heartbeat if you experience connection losses
# (eg. because of your router or firewall configuration).
Expand Down
75 changes: 75 additions & 0 deletions systemtests/tests/bareos/testrunner-status-subscriptions
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/bash
set -e
set -o pipefail
set -u
#
# Run a simple backup
# then restore it.
#
TestName="$(basename "$(pwd)")"
export TestName

#shellcheck source=../environment.in
. ./environment

JobName=bconsole-status-client
#shellcheck source=../scripts/functions
. "${rscripts}"/functions


start_test

rm -f "$tmp/log3.out"

cat <<END_OF_DATA >$tmp/bconcmds
@$out /dev/null
messages
run job=backup-bareos-fd yes
wait
@$out $tmp/log3.out
status subscriptions
quit
END_OF_DATA

run_bconsole

if ! grep "Ok: available subscriptions: 9 (1/10) (used/total)" "$tmp"/log3.out; then
echo "General message not found in $tmp/log3.out" >&2
estat=1
fi

#unit overview
if ! grep "| client | fileset | db_units | vm_units | filer_units | normal_units |" "$tmp"/log3.out; then
echo "Wrong overview fields in $tmp/log3.out" >&2
estat=1
fi

if ! grep "| bareos-fd | <all file-based> | | | | 1 |" "$tmp"/log3.out; then
echo "Wrong overview data in $tmp/log3.out" >&2
estat=1
fi

# total backup subscriptions
if ! grep "| clients | db_units | vm_units | filer_units | normal_units | total_units " "$tmp"/log3.out; then
echo "Wrong total backup subscriptions fields in $tmp/log3.out" >&2
estat=1
fi

if ! grep "| 1 | | | | 1 | 1 |" "$tmp"/log3.out; then
echo "Wrong total backup subscriptions data in $tmp/log3.out" >&2
estat=1
fi

# Amout of data that cannot be categorized
if ! grep "| unknown_mb | unknown_percentage |" "$tmp"/log3.out; then
echo "Wrong non categorized data fields in $tmp/log3.out" >&2
estat=1
fi

if ! grep "| | |" "$tmp"/log3.out; then
echo "Wrong non categorized data amounts in $tmp/log3.out" >&2
estat=1
fi

end_test

0 comments on commit 766feb7

Please sign in to comment.