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