]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/query-test
Delete unwanted subdirectory
[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 stop_bacula
39
40 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
41 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
42
43 cat <<END_OF_DATA >tmp/bconcmds
44 @output /dev/null
45 messages
46 @$out tmp/log1.out
47 @# Force differental on the second Volume
48 update volume=TestVolume001 VolStatus=Used
49 run level=differental job=$JobName yes
50 wait
51 messages
52 @output
53 END_OF_DATA
54
55 run_bacula
56 check_for_zombie_jobs storage=File
57 stop_bacula
58
59 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
60 cat <<END_OF_DATA >tmp/bconcmds
61 @output /dev/null
62 messages
63 @$out tmp/log1.out
64 run level=incremental job=$JobName yes
65 wait
66 messages
67 @#
68 @# Now do the queries
69 @#
70 query
71 1
72 ficheriro1.txt
73 query
74 2
75 ${cwd}/tmp/build/
76 ficheriro1.txt
77 localhost-fd
78 query
79 6
80 TestVolume001
81 query
82 7
83 1
84 query
85 8
86 localhost-fd
87 query
88 9
89 Default
90 query
91 10
92 query
93 11
94 query
95 12
96 1
97 @# 
98 @# now do a restore
99 @#
100 @$out tmp/log2.out
101 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
102 yes
103 wait
104 messages
105 @output
106 quit
107 END_OF_DATA
108
109 run_bacula
110 check_for_zombie_jobs storage=File
111 stop_bacula
112
113 #
114 # Delete .c files because we will only restored the txt files
115 #
116 rm -f tmp/build/*.c
117
118 check_two_logs
119 check_restore_tmp_build_diff
120 end_test