This repository has been archived by the owner on Mar 19, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for "status scheduler" command
Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
- Loading branch information
Showing
2 changed files
with
205 additions
and
0 deletions.
There are no files selected for viewing
128 changes: 128 additions & 0 deletions
128
configs/status-schedule-test/bareos-dir.conf.status-schedule-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,128 @@ | ||
# | ||
# Default Bareos Director Configuration file | ||
# | ||
# The only thing that MUST be changed is to add one or more | ||
# file or directory names in the Include directive of the | ||
# FileSet resource. | ||
# | ||
# You might also want to change the default email address | ||
# from root to your address. See the "mail" and "operator" | ||
# directives in the Messages resource. | ||
# | ||
|
||
Director { # define myself | ||
Name = localhost-dir | ||
DIRPort = 8101 # where we listen for UA connections | ||
QueryFile = "/root/bareos-regress/bin/query.sql" | ||
WorkingDirectory = "/root/bareos-regress/working" | ||
PidDirectory = "/root/bareos-regress/working" | ||
SubSysDirectory = "/root/bareos-regress/working" | ||
Maximum Concurrent Jobs = 4 | ||
Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3" # Console password | ||
Messages = Standard | ||
Subscriptions = 1 | ||
} | ||
|
||
JobDefs { | ||
Name = "DefaultJob" | ||
Type = Backup | ||
Level = Incremental | ||
Client = client | ||
FileSet = FS_TESTJOB | ||
Storage = File | ||
Messages = Standard | ||
Pool = Default | ||
Priority = 10 | ||
Maximum Concurrent Jobs = 16 | ||
Schedule = TestSchedule | ||
} | ||
|
||
Job { | ||
Name = "BackupClient1" | ||
JobDefs = "DefaultJob" | ||
} | ||
|
||
|
||
FileSet { | ||
Name = FS_TESTJOB | ||
Include { | ||
File=</root/bareos-regress/tmp/file-list | ||
} | ||
} | ||
|
||
#dir: BeforeJob: run command "/bin/echo RunBeforeJob" | ||
#fd: ClientRunBeforeJob: ClientRunBeforeJob | ||
#fd: ClientAfterJob: run command "/bin/echo ClientRunAfterJob" | ||
#dir: AfterJob: run command "/bin/echo RunAfterJob" | ||
|
||
|
||
# Client (File Services) to backup | ||
Client { | ||
Name = client | ||
Address = localhost | ||
FDPort = 8102 | ||
Catalog = MyCatalog | ||
Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc" # password for FileDaemon | ||
File Retention = 30d # 30 days | ||
Job Retention = 180d # six months | ||
AutoPrune = yes # Prune expired Jobs/Files | ||
Maximum Concurrent Jobs = 4 | ||
|
||
} | ||
|
||
# second Client (File Services) to backup | ||
Client { | ||
Name = localhost2-fd | ||
Address = localhost | ||
FDPort = 8102 | ||
Catalog = MyCatalog | ||
Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc" # password for FileDaemon | ||
File Retention = 30d # 30 days | ||
Job Retention = 180d # six months | ||
AutoPrune = yes # Prune expired Jobs/Files | ||
Maximum Concurrent Jobs = 4 | ||
|
||
} | ||
|
||
|
||
|
||
|
||
# Definiton of file storage device | ||
Storage { | ||
Name = File | ||
Address = localhost # N.B. Use a fully qualified name here | ||
SDPort = 8103 | ||
Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" | ||
Device = FileStorage | ||
Media Type = File | ||
Maximum Concurrent Jobs = 4 | ||
} | ||
|
||
# Generic catalog service | ||
Catalog { | ||
Name = MyCatalog | ||
|
||
dbname = regress; user = root; password = "" | ||
} | ||
|
||
|
||
Messages { | ||
Name = Standard | ||
console = all, !skipped, !saved | ||
catalog = all, !skipped | ||
} | ||
|
||
# Default pool definition | ||
Pool { | ||
Name = Default | ||
Pool Type = Backup | ||
Recycle = yes # Bareos can automatically recycle Volumes | ||
AutoPrune = yes # Prune expired volumes | ||
Volume Retention = 365d # one year | ||
} | ||
|
||
|
||
Schedule { | ||
Name = TestSchedule | ||
Run = hourly | ||
} |
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,77 @@ | ||
#!/bin/sh | ||
# | ||
# | ||
TestName="status-schedule-test" | ||
JobName=BackupClient1 | ||
. scripts/functions | ||
|
||
scripts/cleanup | ||
scripts/copy-test-confs | ||
|
||
|
||
|
||
/bin/cp -f ${rconfigs}/${TestName}/bareos-dir.conf.${TestName} bin/bareos-dir.conf | ||
|
||
echo "${cwd}/build/src/tests" >${cwd}/tmp/file-list | ||
|
||
change_jobname $JobName | ||
start_test | ||
|
||
cat <<END_OF_DATA >${cwd}/tmp/bconcmds | ||
@$out ${cwd}/tmp/log1.out | ||
messages | ||
status scheduler | ||
messages | ||
@$out ${cwd}/tmp/log2.out | ||
status scheduler days=1 | ||
messages | ||
@$out ${cwd}/tmp/log3.out | ||
status scheduler days=-1 | ||
messages | ||
@$out ${cwd}/tmp/log4.out | ||
status scheduler schedule=TestSchedule | ||
messages | ||
quit | ||
END_OF_DATA | ||
|
||
run_bareos | ||
|
||
stop_bareos | ||
|
||
|
||
NRLINES=`grep TestSchedule tmp/log1.out | wc -l` | ||
if [ $NRLINES = "337" ]; then | ||
print_debug "status scheduler OK" | ||
else | ||
estat=1 | ||
fi | ||
|
||
NRLINES=`grep TestSchedule tmp/log2.out | wc -l` | ||
if [ $NRLINES = "25" ]; then | ||
print_debug "status scheduler days=1 OK" | ||
else | ||
estat=2 | ||
fi | ||
|
||
NRLINES=`grep TestSchedule tmp/log3.out | wc -l` | ||
if [ $NRLINES = "25" ]; then | ||
print_debug "status scheduler days=-1 OK" | ||
else | ||
estat=3 | ||
fi | ||
|
||
NRLINES=`grep TestSchedule tmp/log4.out | wc -l` | ||
if [ $NRLINES = "338" ]; then | ||
print_debug "status scheduler schedule=TestSchedule OK" | ||
else | ||
estat=4 | ||
fi | ||
|
||
|
||
stop_bareos | ||
|
||
#end_test |