]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/win32-fd-test
Add first cut Volume names to disk-changer
[bacula/bacula] / regress / tests / win32-fd-test
1 #!/bin/sh
2 #
3 # How to use this test
4 # --------------------
5 #
6 # * Get a working Windows OS on your network
7 # * Install strawberry perl version with msi 
8 #   http://www.bacula.org/downloads/depkgs-mingw32/strawberry-perl-5.10.1.0.msi
9 # * Install the latest version of Bacula FD
10 # * Copy or make accessible (Network share, VirtualBox share) 
11 #     regress/scripts/regress-win32.pl
12 # * Execute the script on the Windows box
13 #     perl regress-win32.pl
14 # * Run this script with the proper config settings about WIN32
15 #
16 TestName="win32-fd-test"
17 JobName=win32
18 . scripts/functions
19
20 scripts/cleanup
21 scripts/copy-test-confs
22 cp scripts/win32-bacula-dir.conf bin/bacula-dir.conf
23
24 URL=http://$WIN32_ADDR:8091
25 wget -qO $tmp/stop.log "$URL/stop"
26 wget -qO $tmp/update.log "$URL/set_director_name?name=$HOST-dir;pass=$WIN32_PASSWORD"
27 wget -qO $tmp/start.log "$URL/start"
28
29 wget -qO $tmp/init1.log "$URL/init_attrib_test?source=$WIN32_FILE"
30 wget -qO $tmp/init2.log "$URL/init_weird_runscript_test?source=$WIN32_FILE"
31 wget -qO $tmp/clean.log "$URL/cleandir?source=$WIN32_FILE/restore"
32
33 change_jobname NightlySave $JobName
34 start_test
35       
36 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
37 @output
38 messages
39 @$out ${cwd}/tmp/log1.out
40 status client=$WIN32_CLIENT
41 label storage=File volume=TestVolume001
42 run job=$JobName storage=File yes
43 wait
44 messages
45 @# 
46 @# now do a restore
47 @#
48 @$out ${cwd}/tmp/log2.out
49 restore where=$WIN32_FILE/restore select all done storage=File
50 yes
51 wait
52 messages
53 @$out ${cwd}/tmp/log3.out
54 @#
55 @# make some runscript tests
56 @#
57 run job=RunScript storage=File yes
58 wait
59 messages
60 @$out ${cwd}/tmp/log4.out
61 @#
62 @# make some accurate tests
63 @#
64 run job=AccurateJob storage=File yes
65 wait
66 messages
67 @output
68 quit
69 END_OF_DATA
70
71 run_bacula
72 check_for_zombie_jobs storage=File
73 stop_bacula
74
75 check_two_logs
76
77 DST=`echo $WIN32_FILE | sed 's!:!!'`
78
79 # Compare original and restored directories
80 wget -qO $tmp/1.log "$URL/compare?source=$WIN32_FILE/attrib_test;dest=$WIN32_FILE/restore/$DST/attrib_test"
81 print_debug `cat $tmp/1.log`
82 rstat=0
83 grep OK $tmp/1.log > /dev/null
84 if [ $? != 0 ]; then
85     rstat=1
86 fi
87
88 # Compare with some weird files
89 wget -qO $tmp/2.log "$URL/compare?source=$WIN32_FILE/weird_runscript;dest=$WIN32_FILE/restore/$DST/weird_runscript"
90 print_debug `cat $tmp/2.log`
91
92 grep OK $tmp/2.log > /dev/null
93 if [ $? != 0 ]; then
94     rstat=2
95 fi
96
97 dstat=0
98 end_test