File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,11 @@ if [ -z "${BackupTmpDir+x}" ]; then
3939fi
4040bkupdir=$BackupTmpDir
4141
42+ if [[ ! " $BackupTmpDir " =~ te? mp$ ]]; then
43+ echo " Backup temp dirname must end with 'temp' or 'tmp'!"
44+ exit 1
45+ fi
46+
4247if [ -d $bkupdir ]; then
4348 # Remove temporary archives
4449 rm -rf $bkupdir /*
Original file line number Diff line number Diff line change @@ -53,3 +53,9 @@ teardown() {
5353 [ "$status" -eq 1 ]
5454 [ "${lines[0]}" = "Backup temp dir not defined!" ]
5555}
56+
57+ @test "invoking backup with config where backup temp dirname is invalid" {
58+ run backup $confdir/invalid-tmpdir.conf
59+ [ "$status" -eq 1 ]
60+ [ "${lines[0]}" = "Backup temp dirname must end with 'temp' or 'tmp'!" ]
61+ }
Original file line number Diff line number Diff line change 1+ BackupCmdDir=$PWD/test/fixtures/bkcmd.test.d
2+ BackupTmpDir=/usr/local
3+ Buckets=storage
4+ DestDir=destination
5+ MaxAge=5
6+ MaxLogAge=20
You can’t perform that action at this time.
0 commit comments