Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
regression test for allowed job commmand
Browse files Browse the repository at this point in the history
Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
  • Loading branch information
pstorz authored and Marco van Wieringen committed Jul 5, 2013
1 parent 49aab8f commit 569450d
Show file tree
Hide file tree
Showing 5 changed files with 430 additions and 0 deletions.
1 change: 1 addition & 0 deletions DartTestfile.txt.in
Expand Up @@ -4,6 +4,7 @@ ADD_TEST(disk:action-on-purge-test "@regressdir@/tests/action-on-purge-test")
ADD_TEST(disk:accurate-test "@regressdir@/tests/accurate-test")
ADD_TEST(disk:allowcompress-test "@regressdir@/tests/allowcompress-test")
ADD_TEST(disk:allowed-scriptdir-test "@regressdir@/tests/allowed-scriptdir-test")
ADD_TEST(disk:allowed-jobcommand-test "@regressdir@/tests/allowed-jobcommand-test")
ADD_TEST(disk:auto-label-test "@regressdir@/tests/auto-label-test")
ADD_TEST(disk:backup-bareos-test "@regressdir@/tests/backup-bareos-test")
ADD_TEST(disk:backup-bareos-passive-test "@regressdir@/tests/backup-bareos-passive-test")
Expand Down
1 change: 1 addition & 0 deletions all-disk-tests
Expand Up @@ -11,6 +11,7 @@ rm -f dumps/*
./run tests/action-on-purge-test
./run tests/allowcompress-test
./run tests/allowed-scriptdir-test
./run tests/allowed-jobcommand-test
./run tests/accurate-test
./run tests/auto-label-test
./run tests/backup-bareos-test
Expand Down
@@ -0,0 +1,120 @@
#
# 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 = @hostname@-dir
DIRPort = @dirport@ # where we listen for UA connections
QueryFile = "@scriptdir@/query.sql"
WorkingDirectory = "@working_dir@"
PidDirectory = "@piddir@"
SubSysDirectory = "@subsysdir@"
Maximum Concurrent Jobs = 4
Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3" # Console password
Messages = Standard
}

JobDefs {
Name = "DefaultJob"
Type = Backup
Level = Incremental
Client = @hostname@-fd
FileSet = FS_TESTJOB
Storage = File
Messages = Standard
Pool = Default
Priority = 10
Maximum Concurrent Jobs = 16
}

Job {
Name = "BackupClient1"
JobDefs = "DefaultJob"
Client Run Before Job = "@working_dir@/runbeforejob.sh"
}


FileSet {
Name = FS_TESTJOB
Include {
File=<@tmpdir@/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 = @hostname@-fd
Address = @hostname@
FDPort = @fdport@
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 = @hostname@ # N.B. Use a fully qualified name here
SDPort = @sdport@
Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
Device = FileStorage
Media Type = File
Maximum Concurrent Jobs = 4
}

# Generic catalog service
Catalog {
Name = MyCatalog
@libdbi@
dbname = @db_name@; user = @db_user@; password = "@db_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
}


#
## Standard Restore template, to be changed by Console program
## Only one such job is needed for all Jobs/Clients/Storage ...
##
Job {
Name = "RestoreFiles"
Type = Restore
Client = @hostname@-fd
FileSet= FS_TESTJOB
Storage = File
Pool = Default
Messages = Standard
Where = /tmp/bareos-restores
}
@@ -0,0 +1,38 @@
#
# Default Bareos File Daemon Configuration file
#
# There is not much to change here except perhaps the
# File daemon Name to
#

#
# List Directors who are permitted to contact this File daemon
#
Director {
Name = @hostname@-dir
Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc" # password for FileDaemon
Allowed Script Dir = "@working_dir@"
}

#
# "Global" File daemon configuration specifications
#
FileDaemon { # this is me
Name = @hostname@-fd
FDPort = @fdport@ # where we listen for the director
WorkingDirectory = @working_dir@
Pid Directory = @piddir@
Maximum Concurrent Jobs = 20

Allowed Job Command = runscript
Allowed Job Command = backup
Allowed Job Command = restore
Allowed Job Command = verify
Allowed Job Command = estimate
}

# Send all messages except skipped files back to Director
Messages {
Name = Standard
director = @hostname@-dir = all, !skipped, !restored
}

0 comments on commit 569450d

Please sign in to comment.