]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/query-test
Update
[bacula/bacula] / regress / tests / query-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory then create some           
4 #   new files, do a Differental then a bunch of query commands
5 #   and finally restore the two files.
6 #
7 TestName="query-test"
8 JobName=query
9 . scripts/functions
10
11 scripts/cleanup
12 scripts/copy-test-confs
13 echo "${cwd}/tmp/build" >/tmp/file-list
14 mkdir ${cwd}/tmp/build
15 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
16 cd ${cwd}/tmp
17 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
18 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
19 cd ${cwd}
20
21 change_jobname CompressedTest $JobName
22 start_test
23
24 cat <<END_OF_DATA >tmp/bconcmds
25 @output /dev/null
26 messages
27 @$out tmp/log1.out
28 label storage=File volume=TestVolume001
29 label storage=File volume=TestVolume002
30 run job=$JobName yes
31 wait
32 messages
33 quit
34 END_OF_DATA
35
36 run_bacula
37 check_for_zombie_jobs storage=File
38
39 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
40 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
41
42 cat <<END_OF_DATA >tmp/bconcmds
43 @output /dev/null
44 messages
45 @$out tmp/log1.out
46 @# Force differental on the second Volume
47 update volume=TestVolume001 VolStatus=Used
48 run level=differental job=$JobName yes
49 wait
50 messages
51 @output
52 END_OF_DATA
53
54 run_bacula
55 check_for_zombie_jobs storage=File
56
57 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
58 cat <<END_OF_DATA >tmp/bconcmds
59 @output /dev/null
60 messages
61 @$out tmp/log1.out
62 run level=incremental job=$JobName yes
63 wait
64 messages
65 @#
66 @# Now do the queries
67 @#
68 query
69 1
70 ficheriro1.txt
71 query
72 2
73 ${cwd}/tmp/build/
74 ficheriro1.txt
75 localhost-fd
76 query
77 6
78 TestVolume001
79 query
80 7
81 1
82 query
83 8
84 localhost-fd
85 query
86 9
87 Default
88 query
89 10
90 query
91 11
92 query
93 12
94 1
95 @# 
96 @# now do a restore
97 @#
98 @$out tmp/log2.out
99 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
100 yes
101 wait
102 messages
103 @output
104 quit
105 END_OF_DATA
106
107 run_bacula
108 check_for_zombie_jobs storage=File
109 stop_bacula
110
111 #
112 # Delete .c files because we will only restored the txt files
113 #
114 rm -f tmp/build/*.c
115
116 check_two_logs
117 check_restore_tmp_build_diff
118 end_test