File: t07-dar.sh

package info (click to toggle)
backup-manager 0.7.14-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,656 kB
  • sloc: sh: 4,041; perl: 1,176; makefile: 215
file content (55 lines) | stat: -rw-r--r-- 1,230 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
set -e

# Each test script should include testlib.sh
source testlib.sh

# When the test is ready, set this to false for nice outputs.
# if you want to see what happens, use those flags
# verbose="true"
# warnings="true"

# The conffile part of the test, see confs/* for details.
source confs/base.conf
source confs/tarball.conf

export TEST_FILES_SUBDIR=test

export BM_ARCHIVE_ROOT="repository"
export BM_ARCHIVE_METHOD="tarball-incremental"
export BM_TARBALL_DIRECTORIES="$PWD/$TEST_FILES_SUBDIR"
export BM_TARBALL_FILETYPE="dar"
export BM_TARBALLINC_MASTERDATETYPE="weekly"
export BM_TARBALLINC_MASTERDATEVALUE="1"

source $locallib/sanitize.sh

if [[ ! -x $dar ]]; then
    info "cannot run test, need $dar"
    exit 1
fi

# The test actions

rm -rf $TEST_FILES_SUBDIR
mkdir -p $TEST_FILES_SUBDIR
mkdir $TEST_FILES_SUBDIR/dir1
touch $TEST_FILES_SUBDIR/file1

if [[ -e $BM_ARCHIVE_ROOT ]]; then
    rm -f $BM_ARCHIVE_ROOT/*
fi    

bm_init_env
bm_init_today
create_directories
make_archives

name=$(get_dir_name $BM_TARBALL_DIRECTORIES long)
if [[ -e "$BM_ARCHIVE_ROOT/$BM_ARCHIVE_PREFIX$name.$TODAY.master.1.dar" ]]; then
    rm -rf $BM_ARCHIVE_ROOT
    exit 0
else
    rm -rf $BM_ARCHIVE_ROOT
    exit 1
fi