]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/query-test
more mkdir -p changes
[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" >${cwd}/tmp/file-list
14 mkdir -p ${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 >${cwd}/tmp/bconcmds
25 @$out /dev/null
26 messages
27 @$out ${cwd}/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 >${cwd}/tmp/bconcmds
44 @$out /dev/null
45 messages
46 @$out ${cwd}/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 END_OF_DATA
53
54 run_bacula
55 check_for_zombie_jobs storage=File
56 stop_bacula
57
58 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
59 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
60 @$out /dev/null
61 messages
62 @$out ${cwd}/tmp/log1.out
63 run level=incremental job=$JobName yes
64 wait
65 messages
66 @#
67 @# Now do the queries
68 @#
69 query
70 1
71 ficheriro1.txt
72 query
73 2
74 ${cwd}/tmp/build/
75 ficheriro1.txt
76 localhost-fd
77 query
78 6
79 TestVolume001
80 query
81 7
82 1
83 query
84 8
85 localhost-fd
86 query
87 9
88 Default
89 query
90 10
91 query
92 11
93 query
94 12
95 1
96 @# 
97 @# now do a restore
98 @#
99 @$out ${cwd}/tmp/log2.out
100 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
101 yes
102 wait
103 messages
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 ${cwd}/tmp/build/*.c
115
116 check_two_logs
117 check_restore_tmp_build_diff
118 end_test