GIMIv2tasks/TestCases: step2-routing.rb

File step2-routing.rb, 2.4 KB (added by koneil@bbn.com, 6 years ago)
Line 
1#defProperty('source1', 'omf.nicta.node11', 'ID of a resource')
2#defProperty('source2', 'omf.nicta.node13', 'ID of a resource')
3#defProperty('target', 'emmy9.casa.umass.edu/expect_wget_script.sh', 'download target1')
4#defProperty('target1', 'emmy9.casa.umass.edu/expect_script.sh', 'download target2')
5
6defGroup('Node1', "NodeA")
7defGroup('Node2', "NodeB")
8defGroup('Node3', "NodeC")
9defGroup('Node4', "NodeD")
10defGroup('Node5', "NodeE")
11
12
13onEvent(:ALL_UP) do |event|
14  wait 1
15#  group('All').startApplications
16  info 'Changing routing setup'
17
18  group('Node1').exec("route add -net 192.168.1.0/24 gw 192.168.4.10")
19  group('Node1').exec("route add -net 192.168.2.0/24 gw 192.168.4.10")
20  group('Node1').exec("route add -net 192.168.3.0/24 gw 192.168.5.12")
21  group('Node1').exec("route add -net 192.168.6.0/24 gw 192.168.5.12")
22  group('Node1').exec("echo 1 >  /proc/sys/net/ipv4/ip_forward")
23
24  group('Node2').exec("route add -net 192.168.3.0/24 gw 192.168.1.13")
25  group('Node2').exec("route add -net 192.168.5.0/24 gw 192.168.4.11")
26  group('Node2').exec("route add -net 192.168.6.0/24 gw 192.168.2.12")
27  group('Node2').exec("echo 1 >  /proc/sys/net/ipv4/ip_forward")
28
29  group('Node3').exec("route add -net 192.168.1.0/24 gw 192.168.3.13")
30  group('Node3').exec("route add -net 192.168.4.0/24 gw 192.168.5.11")
31  group('Node3').exec("echo 1 >  /proc/sys/net/ipv4/ip_forward")
32
33  group('Node4').exec("route add -net 192.168.2.0/24 gw 192.168.3.12")
34  group('Node4').exec("route add -net 192.168.4.0/24 gw 192.168.1.10")
35  group('Node4').exec("route add -net 192.168.5.0/24 gw 192.168.3.12")
36  group('Node4').exec("route add -net 192.168.6.0/24 gw 192.168.3.12")
37  group('Node4').exec("echo 1 >  /proc/sys/net/ipv4/ip_forward")
38
39  group('Node5').exec("route add -net 192.168.2.0/24 gw 192.168.6.12")
40  group('Node5').exec("route add -net 192.168.1.0/24 gw 192.168.6.12")
41  group('Node5').exec("route add -net 192.168.3.0/24 gw 192.168.6.12")
42  group('Node5').exec("route add -net 192.168.4.0/24 gw 192.168.6.12")
43  group('Node5').exec("route add -net 192.168.5.0/24 gw 192.168.6.12")
44
45  info 'Routing setup finished'
46#  puts "downloading experiment script"
47#  allGroups.exec("wget emmy9.casa.umass.edu/script.sh")
48#  puts "Execute command '/bin/sh expect_wget_script.sh' on all nodes"
49#  allGroups.exec("sh /root/script.sh")
50#  allGroups.startApplications
51  wait 5
52  info 'Stopping applications'
53  allGroups.stopApplications
54  wait 1
55  Experiment.done
56end
57