6 # * Get a working Windows OS on your network
7 # * Install strawberry perl version with msi to c:/strawberry
8 # http://www.bacula.org/downloads/depkgs-mingw32/strawberry-perl-5.10.1.0.msi
9 # * Install the latest version of Bacula FD
10 # * 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
17 # * Install MSSQL with default options, put database username in config
19 # WIN32_MSSQL_PASS=password
21 # Note, once everything is setup, and you have run the above once
22 # you can simply run the first part of this script prior to the URL=
23 # to get the proper conf files loaded in bin, then manually
24 # start bacula, and run the "SS_SQLJob" backup job, then
27 TestName="win32-mssql-systemstate-test"
31 scripts/copy-test-confs
32 cp scripts/win32-bacula-dir-systemstate.conf bin/bacula-dir.conf
36 URL=http://$WIN32_ADDR:8091
38 wget -qO - "$URL/check_mssql?user=$WIN32_MSSQL_USER;pass=$WIN32_MSSQL_PASS" | grep OK > /dev/null
40 echo "check_msql user=$WIN32_MSSQL_USER pass=$WIN32_MSSQL_PASS failed"
42 wget -qO - "$URL/setup_mssql_db?db=db$$" | grep OK > /dev/null
44 echo "setup_db failed"
47 wget -qO - "$URL/add_registry_key?key=Test$$;val=Val$$" | grep OK > /dev/null
49 print_debug "ERROR: Can't add registry key Test$$"
51 wget -qO - "$URL/add_registry_key?key=RemovedAtRestore$$;val=Val$$" | grep OK > /dev/null
53 print_debug "ERROR: Can't add registry key RemovedAtRestore$$"
59 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
62 @$out ${cwd}/tmp/log1.out
63 status client=$WIN32_CLIENT
64 label storage=File volume=TestVolume001
65 run job=SS_SQLJob storage=File yes
73 wget -qO - "$URL/del_registry_key?key=RemovedAtRestore$$" | grep OK > /dev/null
75 print_debug "ERROR: can't remove key RemovedAtRestore$$ from registry"
79 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
81 @$out ${cwd}/tmp/log1.out
82 run job=SS_SQLJob storage=File yes
90 wget -qO - "$URL/del_registry_key?key=Test$$" | grep OK > /dev/null
92 print_debug "ERROR: can't remove key Test$$ from registry"
96 wget -qO - "$URL/cleanup_mssql_db?db=db$$" | grep OK > /dev/null
98 print_debug "ERROR: can't remove mssql db$$"
102 # the restore contains the name of the SQLServer instance
103 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
104 @$out ${cwd}/tmp/log3.out
105 restore where=/ storage=File
110 @$out ${cwd}/tmp/host.out
112 @$out ${cwd}/tmp/log3.out
119 host=`head -2 ${cwd}/tmp/host.out | tail -1`
121 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
125 @$out ${cwd}/tmp/log2.out
126 restore where=/ storage=File
145 check_for_zombie_jobs storage=File
150 # with SQL 2005, the db is mounted automatically
151 wget -qO - "$URL/test_mssql_content?db=db$$" | grep OK > /dev/null
152 if [ $? -ne 0 ]; then
154 wget -qO - "$URL/online_mssql_db?mdf=db$$;db=restoredb$$" | grep OK > /dev/null
155 if [ $? -ne 0 ]; then
156 print_debug "ERROR: can't put db$$ online"
160 wget -qO - "$URL/test_mssql_content?db=restoredb$$" | grep OK > /dev/null
161 if [ $? -ne 0 ]; then
162 print_debug "ERROR: can't get content of restoredb$$"
166 wget -qO $tmp/cleanup.log "$URL/cleanup_mssql_db?db=restoredb$$"
169 wget -qO $tmp/cleanup.log "$URL/cleanup_mssql_db?db=db$$"
174 wget -qO - "$URL/get_registry_key?key=RemovedAtRestore$$;val=Val$$" | grep ERR > /dev/null
175 if [ $? -ne 0 ]; then
176 print_debug "ERROR: Should not find registry key RemovedAtRestore$$"
180 wget -qO - "$URL/get_registry_key?key=Test$$;val=Val$$" | grep OK > /dev/null
181 if [ $? -ne 0 ]; then
182 print_debug "ERROR: Can't find registry key Test$$"