-
Notifications
You must be signed in to change notification settings - Fork 256
/
auto-label-test
executable file
·81 lines (68 loc) · 1.5 KB
/
auto-label-test
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/sh
#
# Test if Bareos can automatically create a Volume label.
#
TestName="auto-label-test"
JobName=AutoLabel
. scripts/functions
copy_test_confs
# Directory to backup.
# This directory will be created by setup_data().
BackupDirectory="${tmp}/data"
# Use a tgz to setup data to be backed up.
# Data will be placed at "${tmp}/data/".
setup_data data/small.tgz
# the default fileset FS_TESTJOB backups all file and directories defined in "${tmp}/file-list".
echo "${BackupDirectory}" >${tmp}/file-list
cp ${cwd}/bin/bareos-dir.conf ${cwd}/tmp/1
sed "s%# Label Format% Label Format%" ${cwd}/tmp/1 >${cwd}/bin/bareos-dir.conf
change_jobname CompressedTest $JobName
start_test
cat <<END_OF_SCRIPT >${cwd}/tmp/bconcmds
@$out /dev/null
messages
@$out ${cwd}/tmp/log1.out
status all
status all
list pools
messages
@#setdebug level=110 storage=File
run job=$JobName storage=File yes
list pools
list volumes
wait
sql
SELECT StartTime, JobFiles, JobId, Level, count(*) AS nb_jobmedia
FROM JobMedia join Job using (JobId) join Client using (ClientId)
where Client.Name = 'localhost-fd' group by JobId, Level, StartTime,
JobFiles order by JobId desc ;
messages
@#
@# now do a restore
@#
@$out ${cwd}/tmp/log2.out
@#setdebug level=400 storage=File
restore where=${cwd}/tmp/bareos-restores select storage=File
unmark *
mark *
count
ls *
dir *
find Makefile
pwd
lsmark
estimate
?
help
done
yes
wait
messages
quit
END_OF_SCRIPT
run_bareos
check_for_zombie_jobs storage=File
stop_bareos
check_two_logs
check_restore_diff
end_test