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