/
auction.exp
executable file
·86 lines (74 loc) · 3.22 KB
/
auction.exp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/expect -f
# run this script from the doc/tutorials/auction directory of the unpacked kit under test
if { $argc != 1 } {
puts "Please pass the build string as one single argument"
exit 1
}
set buildstring [lindex $argv 0]
puts "Build string is: $buildstring"
set timeout 600
proc abort {} {
exec mv deployment.xml.bak deployment.xml
exit 1
}
exec rm -f *.csv
exec ./run.sh clean
spawn ./run.sh
set server_id $spawn_id
expect -i $server_id eof abort timeout abort "HOST: $buildstring"
expect -i $server_id eof abort timeout abort "Server completed initialization."
# wait for server to really be ready
sleep 1
spawn ./run.sh client
set client_id $spawn_id
expect -i $client_id eof abort timeout abort "Welcome to Bobbi's Awesome Auctions"
expect -i $client_id eof abort timeout abort "Loading ITEM Table"
expect -i $client_id eof abort timeout abort "4"
expect -i $client_id eof abort timeout abort "ITEM Table Loaded"
expect -i $client_id eof abort timeout abort "Loading USER Table"
expect -i $client_id eof abort timeout abort "16"
expect -i $client_id eof abort timeout abort "USER Table Loaded"
expect -i $client_id eof abort timeout abort "Loading CATEGORY Table"
expect -i $client_id eof abort timeout abort "6"
expect -i $client_id eof abort timeout abort "CATEGORY Table Loaded"
expect -i $client_id eof abort timeout abort "Running auctions"
expect -i $client_id eof abort timeout abort "OPEN"
expect -i $client_id eof abort timeout abort "CLOSED"
expect -i $client_id eof abort timeout abort "Complete..."
expect -i $client_id eof abort timeout abort "Where do ghosts shop?"
expect -i $client_id eof abort timeout abort "In Boo-tiques!"
expect -i $client_id timeout abort eof
close -i $server_id
exec mv deployment.xml deployment.xml.bak
exec sed s/false/true/g deployment.xml.bak > deployment.xml
exec ./run.sh clean
spawn ./run.sh
set server_id $spawn_id
expect -i $server_id eof abort timeout abort "HOST: $buildstring"
expect -i $server_id eof abort timeout abort "Server completed initialization."
# wait for server to really be ready
sleep 1
spawn ./run.sh export
set export_id $spawn_id
spawn ./run.sh client
set client_id $spawn_id
expect -i $client_id eof abort timeout abort "Welcome to Bobbi's Awesome Auctions"
expect -i $client_id eof abort timeout abort "Loading ITEM Table"
expect -i $client_id eof abort timeout abort "4"
expect -i $client_id eof abort timeout abort "ITEM Table Loaded"
expect -i $client_id eof abort timeout abort "Loading USER Table"
expect -i $client_id eof abort timeout abort "16"
expect -i $client_id eof abort timeout abort "USER Table Loaded"
expect -i $client_id eof abort timeout abort "Loading CATEGORY Table"
expect -i $client_id eof abort timeout abort "6"
expect -i $client_id eof abort timeout abort "CATEGORY Table Loaded"
expect -i $client_id eof abort timeout abort "Running auctions"
expect -i $client_id eof abort timeout abort "OPEN"
expect -i $client_id eof abort timeout abort "CLOSED"
expect -i $client_id eof abort timeout abort "Complete..."
expect -i $client_id eof abort timeout abort "Where do ghosts shop?"
expect -i $client_id eof abort timeout abort "In Boo-tiques!"
expect -i $client_id timeout abort eof
close -i $export_id
close -i $server_id
exec mv deployment.xml.bak deployment.xml