]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/win32-fd-test
regress: Add test that mixes mssql and systemstate
[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 # * If you put bacula binaries in release32 and release64, the script will
21 #   update binaries
22 # * Run win32-fd-test regression
23 #
24 TestName="win32-fd-test"
25 JobName=win32
26 . scripts/functions
27
28 scripts/cleanup
29 scripts/copy-test-confs
30 cp scripts/win32-bacula-dir.conf bin/bacula-dir.conf
31
32 change_jobname NightlySave $JobName
33 start_test
34
35 URL=http://$WIN32_ADDR:8091
36 echo "Doing wgets ..."
37 wget -qO $tmp/stop.log "$URL/stop"
38 wget -qO $tmp/update.log "$URL/set_director_name?name=$HOST-dir;pass=$WIN32_PASSWORD"
39 wget -qO $tmp/start.log "$URL/start"
40
41 wget -qO $tmp/init1.log "$URL/init_attrib_test?source=$WIN32_FILE"
42 wget -qO $tmp/init2.log "$URL/init_weird_runscript_test?source=$WIN32_FILE"
43 wget -qO $tmp/clean.log "$URL/cleandir?source=$WIN32_FILE/restore"
44
45 # try to upgrade win32 binaries
46 update_win32
47       
48 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
49 @output
50 messages
51 @$out ${cwd}/tmp/log1.out
52 status client=$WIN32_CLIENT
53 label storage=File volume=TestVolume001
54 run job=$JobName storage=File yes
55 wait
56 messages
57 @# 
58 @# now do a restore
59 @#
60 @$out ${cwd}/tmp/log2.out
61 restore where=$WIN32_FILE/restore select all done storage=File
62 yes
63 wait
64 messages
65 @$out ${cwd}/tmp/log3.out
66 @#
67 @# make some runscript tests
68 @#
69 run job=RunScript storage=File yes
70 wait
71 messages
72 @$out ${cwd}/tmp/log4.out
73 @#
74 @# make some accurate tests
75 @#
76 run job=AccurateJob storage=File yes
77 wait
78 messages
79 @output
80 quit
81 END_OF_DATA
82
83 run_bacula
84 check_for_zombie_jobs storage=File
85 stop_bacula
86
87 check_two_logs
88
89 DST=`echo $WIN32_FILE | sed 's!:!!'`
90
91 # Compare original and restored directories
92 wget -qO $tmp/1.log "$URL/compare?source=$WIN32_FILE/attrib_test;dest=$WIN32_FILE/restore/$DST/attrib_test"
93 print_debug `cat $tmp/1.log`
94 rstat=0
95 grep OK $tmp/1.log > /dev/null
96 if [ $? != 0 ]; then
97     rstat=1
98 fi
99
100 # Compare with some weird files
101 wget -qO $tmp/2.log "$URL/compare?source=$WIN32_FILE/weird_runscript;dest=$WIN32_FILE/restore/$DST/weird_runscript"
102 print_debug `cat $tmp/2.log`
103
104 grep OK $tmp/2.log > /dev/null
105 if [ $? != 0 ]; then
106     rstat=2
107 fi
108
109 dstat=0
110 end_test