omf_ec 6.0.0.pre.3 → 6.0.0.pre.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. data/Rakefile +1 -0
  2. data/bin/omf_ec +264 -0
  3. data/example/engine_oedl.rb +52 -0
  4. data/example/engine_test.rb +90 -0
  5. data/example/test_exp/test00.rb +12 -0
  6. data/example/test_exp/test01.rb +22 -0
  7. data/example/test_exp/test02.rb +30 -0
  8. data/{exp_repo/test/exp → example/test_exp}/test03.rb +2 -42
  9. data/{exp_repo/test/exp → example/test_exp}/test04.rb +2 -2
  10. data/{exp_repo/test/exp → example/test_exp}/test05.rb +4 -4
  11. data/{exp_repo/test/exp → example/test_exp}/test06.rb +6 -6
  12. data/example/test_exp/test07.rb +65 -0
  13. data/lib/omf_ec/app_definition.rb +57 -0
  14. data/lib/omf_ec/backward/app_definition.rb +35 -0
  15. data/lib/omf_ec/backward/core_ext/array.rb +19 -0
  16. data/lib/omf_ec/backward/default_events.rb +71 -0
  17. data/lib/omf_ec/backward/dsl.rb +83 -0
  18. data/lib/omf_ec/backward/exp/testbed.rb +47 -0
  19. data/lib/omf_ec/backward/group.rb +72 -0
  20. data/lib/omf_ec/context/app_context.rb +54 -0
  21. data/lib/omf_ec/context/def_app_context.rb +6 -0
  22. data/lib/omf_ec/context/group_context.rb +88 -0
  23. data/lib/omf_ec/context/net_context.rb +46 -0
  24. data/lib/omf_ec/context.rb +10 -0
  25. data/lib/omf_ec/dsl.rb +159 -0
  26. data/lib/omf_ec/experiment.rb +71 -0
  27. data/lib/omf_ec/group.rb +158 -0
  28. data/lib/omf_ec/version.rb +1 -1
  29. data/lib/omf_ec.rb +34 -1
  30. data/omf_ec.gemspec +2 -3
  31. data/test/omf_ec/context_spec.rb +19 -0
  32. data/test/omf_ec/group_spec.rb +14 -0
  33. data/test/test_helper.rb +19 -0
  34. metadata +44 -89
  35. data/bin/omf +0 -147
  36. data/bin/omf_pre +0 -76
  37. data/bin/omf_test +0 -161
  38. data/example/net_devices.rb +0 -75
  39. data/exp_repo/system/exp/eventlib.rb +0 -96
  40. data/exp_repo/system/exp/imageNode.rb +0 -283
  41. data/exp_repo/system/exp/reset.rb +0 -21
  42. data/exp_repo/system/exp/saveNode.rb +0 -99
  43. data/exp_repo/system/exp/stat.rb +0 -49
  44. data/exp_repo/system/exp/stdlib.rb +0 -122
  45. data/exp_repo/system/exp/tell.rb +0 -53
  46. data/exp_repo/system/exp/testlib.rb +0 -12
  47. data/exp_repo/system/exp/winlib.rb +0 -154
  48. data/exp_repo/system/topo/active.rb +0 -9
  49. data/exp_repo/system/topo/all.rb +0 -10
  50. data/exp_repo/system/topo/circle.rb +0 -23
  51. data/exp_repo/test/app/aodvd.rb +0 -73
  52. data/exp_repo/test/app/appDef1.rb +0 -102
  53. data/exp_repo/test/app/athstats.rb +0 -76
  54. data/exp_repo/test/app/echo.rb +0 -36
  55. data/exp_repo/test/app/gennyReceiverAppDef.rb +0 -100
  56. data/exp_repo/test/app/gennySenderAppDef.rb +0 -106
  57. data/exp_repo/test/app/itgdec.rb +0 -79
  58. data/exp_repo/test/app/itgr.rb +0 -77
  59. data/exp_repo/test/app/itgs.rb +0 -105
  60. data/exp_repo/test/app/nop.rb +0 -36
  61. data/exp_repo/test/app/otg2.rb +0 -68
  62. data/exp_repo/test/app/otg2_mp.rb +0 -56
  63. data/exp_repo/test/app/otr2.rb +0 -56
  64. data/exp_repo/test/app/otr2_mp.rb +0 -51
  65. data/exp_repo/test/app/trace_oml2.rb +0 -62
  66. data/exp_repo/test/app/wlanconfig_oml2.rb +0 -42
  67. data/exp_repo/test/exp/conf-room-demo.rb +0 -118
  68. data/exp_repo/test/exp/planetlab.rb +0 -82
  69. data/exp_repo/test/exp/test01.rb +0 -42
  70. data/exp_repo/test/exp/test02.rb +0 -60
  71. data/exp_repo/test/exp/tutorial/hello-world-wired.rb +0 -79
  72. data/exp_repo/test/exp/tutorial/hello-world-wireless.rb +0 -87
  73. data/exp_repo/test/exp/tutorial/using-filters.rb +0 -69
  74. data/exp_repo/test/exp/tutorial/using-groups.rb +0 -64
  75. data/exp_repo/test/exp/tutorial/using-properties.rb +0 -93
  76. data/exp_repo/test/exp/tutorial/using-prototypes.rb +0 -111
  77. data/exp_repo/test/proto/aodvrouter.rb +0 -55
  78. data/exp_repo/test/proto/driverqueryapp.rb +0 -59
  79. data/exp_repo/test/proto/forwarder.rb +0 -73
  80. data/exp_repo/test/proto/itgcbrsender.rb +0 -70
  81. data/exp_repo/test/proto/itgdecoder.rb +0 -64
  82. data/exp_repo/test/proto/itgreceiver.rb +0 -55
  83. data/exp_repo/test/proto/itgvoipsender.rb +0 -64
  84. data/exp_repo/test/proto/listener2.rb +0 -62
  85. data/exp_repo/test/proto/nop.rb +0 -47
  86. data/exp_repo/test/proto/probelink.rb +0 -48
  87. data/exp_repo/test/proto/raw_receiver.rb +0 -64
  88. data/exp_repo/test/proto/receiver2_mp.rb +0 -48
  89. data/exp_repo/test/proto/sender2_mp.rb +0 -54
  90. data/exp_repo/test/proto/udp_receiver.rb +0 -55
  91. data/exp_repo/test/proto/udp_sender.rb +0 -61
@@ -1,62 +0,0 @@
1
- defApplication('test:app:trace_oml2', 'trace_oml2'){|a|
2
-
3
- a.path = "/usr/bin/trace_oml2"
4
- a.defProperty('interface', 'interface to listen to', '-i')
5
- a.defProperty('radiotap', 'Radiotap metadata enable', '-r', {:dynamic => false, :type => :boolean})
6
- a.defProperty('filter', 'some filers for this tap following libpcap syntax', '-f')
7
-
8
- a.defMeasurement("radiotap") do |m|
9
- m.defMetric('tsft', :long)
10
- m.defMetric('rate', :long)
11
- m.defMetric('freq', :long)
12
- m.defMetric('sig_strength_dBm', :long)
13
- m.defMetric('noise_strength_dBm', :long)
14
- m.defMetric('sig_strength', :long)
15
- m.defMetric('noise_strength', :long)
16
- m.defMetric('attenuation', :long)
17
- m.defMetric('attenuation_dB', :long)
18
- m.defMetric('power', :long)
19
- m.defMetric('antenna', :long)
20
- m.defMetric('data_retries', :long)
21
- m.defMetric('sourceMAC', :string)
22
- m.defMetric('dstMAC', :string)
23
- end
24
-
25
- a.defMeasurement("ip") do |m|
26
- m.defMetric('ip_tos', :long)
27
- m.defMetric('ip_len', :long)
28
- m.defMetric('ip_id', :long)
29
- m.defMetric('ip_off', :long)
30
- m.defMetric('ip_ttl', :long)
31
- m.defMetric('ip_proto', :long)
32
- m.defMetric('ip_sum', :long)
33
- m.defMetric('ip_src', :string)
34
- m.defMetric('ip_dst', :string)
35
- m.defMetric('ip_sizeofpacket', :long)
36
- end
37
-
38
- a.defMeasurement("tcp") do |m|
39
- m.defMetric('tcp_source', :long)
40
- m.defMetric('tcp_dest', :long)
41
- m.defMetric('tcp_seq', :long)
42
- m.defMetric('tcp_ack_seq', :long)
43
- m.defMetric('tcp_window', :long)
44
- m.defMetric('tcp_checksum', :long)
45
- m.defMetric('tcp_urgptr', :long)
46
- m.defMetric('tcp_packet_size', :long)
47
- end
48
-
49
- a.defMeasurement("udp") do |m|
50
- m.defMetric('udp_source', :long)
51
- m.defMetric('udp_dest', :long)
52
- m.defMetric('udp_len', :long)
53
- m.defMetric('udp_checksum', :long)
54
- end
55
-
56
- a.defMeasurement("sensor") do |m|
57
- m.defMetric('val', :long)
58
- m.defMetric('inverse', :float)
59
- m.defMetric('name', :string)
60
- end
61
-
62
- }
@@ -1,42 +0,0 @@
1
- #
2
- # Copyright (c) 2006-2008 National ICT Australia (NICTA), Australia
3
- #
4
- # Copyright (c) 2004-2008 WINLAB, Rutgers University, USA
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- #
25
- require 'handler/application/appDefinition'
26
-
27
- defApplication('test:app:wlanconfig_oml2', 'wlanconfig_oml2') { |a|
28
-
29
- a.version(1, 1, 1)
30
- a.shortDescription = "Get information about the wireless network"
31
- a.description = <<TEXT
32
- This application get information about the neighbours of the node using the wlanconfig command
33
- TEXT
34
-
35
- a.defProperty('oml-server', 'Contact details for the oml collection server','--oml-server')
36
- a.defProperty('oml-id', 'ID for this oml client','--oml-id')
37
- a.defProperty('oml-exp-id', 'ID for this experiment','--oml-exp-id')
38
-
39
- # Where to find the application 'wlanconfig_oml2' which calls wlanconfig
40
- # and parses its outputs
41
- a.path = "/usr/bin/wlanconfig_oml2"
42
- }
@@ -1,118 +0,0 @@
1
- #
2
- # Copyright (c) 2006-2010 National ICT Australia (NICTA), Australia
3
- #
4
- # Copyright (c) 2004-2010 WINLAB, Rutgers University, USA
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- #
25
-
26
- defProperty('hrnPrefix', "omf.nicta.node", "Prefix to use for the HRN of resources")
27
- defProperty('resources', "[1,2,3,4,5,8,9,10,11,12,13]", "List of IDs for the resources to use as senders")
28
- defProperty('receiver', "6", "ID for the resource to use as a receiver")
29
- defProperty('groupSize', 4, "Number of resources to put in each group of senders")
30
- defProperty('rate', 300, 'Bits per second sent from senders')
31
- defProperty('packetSize', 256, 'Byte size of packets sent from senders')
32
- defProperty('wifiType', "g", "The type of WIFI to use in this experiment")
33
- defProperty('channel', '6', "The WIFI channel to use in this experiment")
34
- defProperty('netid', "confroom", "The ESSID to use in this experiment")
35
- defProperty('stepDuration', 60, "The duration of each step of this conf-room")
36
-
37
- # Define the Receiver
38
- defGroup('Receiver', "#{property.hrnPrefix}#{property.receiver}") do |node|
39
- node.addApplication("test:app:otr2") do |app|
40
- app.setProperty('udp:local_host', '%net.w0.ip%')
41
- app.setProperty('udp:local_port', 3000)
42
- app.measure('udp_in', :samples => 1)
43
- end
44
- node.net.w0.mode = "master"
45
- node.net.w0.type = property.wifiType
46
- node.net.w0.channel = property.channel
47
- node.net.w0.essid = property.netid
48
- node.net.w0.ip = "192.168.0.254"
49
- end
50
-
51
- # Define each Sender groups
52
- groupList = []
53
- res = eval(property.resources.value)
54
- groupNumber = res.size >= property.groupSize ? (res.size.to_f / property.groupSize.value.to_f).ceil : 1
55
- (1..groupNumber).each do |i|
56
- list = []
57
- (1..property.groupSize).each do |j| popped = res.pop ; list << popped if !popped.nil? end
58
- senderNames = list.collect do |id| "#{property.hrnPrefix}#{id}" end
59
- senders = senderNames.join(',')
60
-
61
- info "Group Sender #{i}: '#{senders}'"
62
- groupList << "Sender#{i}"
63
- defGroup("Sender#{i}", senders) do |node|
64
- node.addApplication("test:app:otg2") do |app|
65
- app.setProperty('udp:local_host', '%net.w0.ip%')
66
- app.setProperty('udp:dst_host', '192.168.0.254')
67
- app.setProperty('udp:dst_port', 3000)
68
- app.setProperty('cbr:size', property.packetSize)
69
- app.setProperty('cbr:rate', property.rate)
70
- app.measure('udp_out', :samples => 1)
71
- end
72
- node.net.w0.mode = "managed"
73
- node.net.w0.type = property.wifiType
74
- node.net.w0.channel = property.channel
75
- node.net.w0.essid = property.netid
76
- node.net.w0.ip = "192.168.0.%index%"
77
- end
78
- end
79
-
80
- onEvent(:ALL_UP_AND_INSTALLED) do |event|
81
- wait 10
82
- group('Receiver').startApplications
83
- wait 10
84
- (1..groupNumber).each do |i|
85
- group("Sender#{i}").startApplications
86
- wait property.stepDuration
87
- end
88
- wait 60
89
- (1..groupNumber).each do |i|
90
- group("Sender#{i}").stopApplications
91
- wait property.stepDuration
92
- end
93
- group('Receiver').stopApplications
94
- Experiment.done
95
- end
96
-
97
-
98
- addTab(:defaults)
99
- addTab(:graph2) do |tab|
100
- opts = { :postfix => %{Sender index for incoming UDP traffic = F(time)}, :updateEvery => 1 }
101
- tab.addGraph("Incoming UDP", opts) do |g|
102
- data = Hash.new
103
- index = 1
104
- mpIn = ms('udp_in')
105
- mpIn.project(:oml_ts_server, :src_host, :seq_no).each do |sample|
106
- time, src, seq = sample.tuple
107
- if data[src].nil?
108
- data[src] = [index,[]]
109
- index += 1
110
- end
111
- data[src][1] << [time, data[src][0]]
112
- end
113
- data.each do |src,value|
114
- g.addLine(value[1], :label => "Node #{value[0]}")
115
- end
116
- end
117
- end
118
-
@@ -1,82 +0,0 @@
1
- #
2
- # Copyright (c) 2006-2009 National ICT Australia (NICTA), Australia
3
- #
4
- # Copyright (c) 2004-2009 WINLAB, Rutgers University, USA
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- #
25
- Experiment.name = "planetlab"
26
- Experiment.project = "orbit-planetlab:tutorial"
27
-
28
- #Backup PlanetLab nodes
29
- #ssh -v -l orbit_pkamat -i ~/.ssh/identity alice.cs.princeton.edu
30
- #ssh -v -l orbit_pkamat -i ~/.ssh/identity pli2-pa-1.hpl.hp.com
31
- #ssh -v -l orbit_pkamat -i ~/.ssh/identity planetlab2.rutgers.edu
32
- #ssh -v -l orbit_pkamat -i ~/.ssh/identity pli2-pa-1.hpl.hp.com
33
- #ssh -v -l orbit_pkamat -i ~/.ssh/identity pli2-pa-2.hpl.hp.com
34
- #ssh -v -l orbit_pkamat -i ~/.ssh/identity pli2-pa-3.hpl.hp.com
35
-
36
- #Launch http server on the Planetlab node
37
- #runCmd("ssh -v -l orbit_pkamat -i ~/.ssh/identity alice.cs.princeton.edu \"sudo /etc/init.d/httpd start\"")
38
- runCmd(" #{LAUNCH_ON_PLANETLAB} \"sudo /etc/init.d/httpd start\"")
39
-
40
- #
41
- # Define nodes used in experiment
42
- #
43
- # node 1,2 is the media proxy fetching the stream from PlanetLab
44
- # and relaying to node8-7
45
-
46
- defGroup('vlcrelay', [1,2]) {|node|
47
- node.image = nil # assume the right image to be on disk
48
-
49
- node.prototype("test:proto:vlcrelay", {
50
- })
51
- node.net.w0.mode = "master" #802.11 Master Mode
52
- }
53
-
54
- defGroup('vlcdest', [8,7]) {|node|
55
- node.image = nil # assume the right image to be on disk
56
-
57
- node.prototype("test:proto:vlcdest", {
58
- })
59
- node.net.w0.mode = "managed" #802.11 Master Mode
60
- }
61
-
62
- allGroups.net.w0 { |w|
63
- w.type = 'b' #Set all nodes to use 802.11b
64
- w.essid = "helloworld" #essid = helloworld
65
- w.ip = "%192.168.%x.%y" #IP address = 192.168.x.y
66
- }
67
- #
68
- # Now, start the application
69
- #
70
- whenAllInstalled() {|node|
71
-
72
- #Start the relaying application on the wireless side
73
- allNodes.startApplications
74
-
75
- #Run the experiment for 60 seconds
76
- wait 60
77
-
78
- #Stop the Planetlab media service
79
- runCmd("ssh -v -l orbit_pkamat -i ~/.ssh/identity alice.cs.princeton.edu \"sudo /etc/init.d/httpd stop\"")
80
-
81
- Experiment.done
82
- }
@@ -1,42 +0,0 @@
1
- #
2
- # Test 1
3
- #
4
- # Testing one node in one group running one exec command for an already installed app
5
- #
6
-
7
- defProperty('res1', "unconfigured-node-1", "ID of a node")
8
- defProperty('res2', "unconfigured-node-2", "ID of a node")
9
-
10
- defGroup('Actor', property.res1)
11
-
12
- onEvent(:ALL_UP) do |event|
13
- wait 3
14
- info "TEST - allGroups"
15
- allGroups.exec("/bin/date")
16
- wait 3
17
- info "TEST - group"
18
- group("Actor").exec("/bin/hostname -f")
19
- wait 3
20
- Experiment.done
21
- end
22
-
23
- #
24
- # Checking the Execution
25
- # Here you do whatever is required to check that the above experiment went well
26
- # Then return true if you decided that it did, or false otherwise
27
- #
28
- # Experiment log file is at: property.logpath
29
- # Also you may want to look at system:exp:testlib
30
- #
31
-
32
- def check_outcome
33
-
34
- # Test 01 is successfull if for each of the 2 exec commands above, the log
35
- # file has a message from the AgentCommands module containing "DONE.OK"
36
- logfile = "#{property.logpath}/#{Experiment.ID}.log"
37
- lines = IO.readlines("#{logfile}")
38
- match1 = lines.grep(/DONE\.OK/)
39
- match2 = match1.grep(/AgentCommands/)
40
- result = (match2.length == 2) ? true : false
41
- return result
42
- end
@@ -1,60 +0,0 @@
1
- #
2
- # Test 2
3
- #
4
- # Testing 2 nodes in multiple groups running exec commandis for already installed apps
5
- #
6
-
7
- defProperty('res1', "node1", "ID of a node")
8
- defProperty('res2', "node2", "ID of a node")
9
-
10
- defGroup('Alice', property.res1)
11
- defGroup('Bob', property.res2)
12
- defGroup('Couple', "#{property.res1},#{property.res2}")
13
- defGroup('GroupOfGroup', ["Alice", "Bob"])
14
-
15
- onEvent(:ALL_UP) do |event|
16
- wait 5
17
- info "-------------"
18
- info "TEST - Group of 2 (res1,res2)"
19
- group("Couple").exec("/bin/hostname")
20
- wait 5
21
- info "---------------------"
22
- info "TEST - Group of Group ( (res1) and (res2) )"
23
- group("GroupOfGroup").exec("/bin/hostname")
24
- wait 5
25
- info "---------------"
26
- info "TEST - allGroup"
27
- allGroups.exec("/bin/hostname")
28
- wait 5
29
- Experiment.done
30
- end
31
-
32
- #
33
- # Checking the Execution
34
- # Here you do whatever is required to check that the above experiment went well
35
- # Then return true if you decided that it did, or false otherwise
36
- #
37
- # Experiment log file is at: property.logpath
38
- # Also you may want to look at system:exp:testlib
39
- #
40
-
41
- def check_outcome
42
-
43
- # Test 02 is successfull if:
44
- # 1) each resource has been enrolled in all its groups as defined above
45
- # AND
46
- # 2) for each of the exec commands above, the log file has a message from
47
- # the AgentCommands module containing "DONE.OK"
48
- logfile = "#{property.logpath}/#{Experiment.ID}.log"
49
- lines = IO.readlines("#{logfile}")
50
- # 1)
51
- match1 = lines.grep(/is\ Enrolled/)
52
- result1 = (match1.length == 8) ? true : false
53
- # 2)
54
- match1 = lines.grep(/DONE\.OK/)
55
- match2 = match1.grep(/AgentCommands/)
56
- result2 = (match2.length == 6) ? true : false
57
-
58
- return true if result1 && result2
59
- return false
60
- end
@@ -1,79 +0,0 @@
1
- #
2
- # Copyright (c) 2006-2010 National ICT Australia (NICTA), Australia
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining a copy
5
- # of this software and associated documentation files (the "Software"), to deal
6
- # in the Software without restriction, including without limitation the rights
7
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- # copies of the Software, and to permit persons to whom the Software is
9
- # furnished to do so, subject to the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be included in
12
- # all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- # THE SOFTWARE.
21
- #
22
- # Tutorial experiment
23
- #
24
- defProperty('res1', 'omf.nicta.node1', "ID of sender node")
25
- defProperty('res2', 'omf.nicta.node2', "ID of receiver node")
26
- defProperty('duration', 60, "Duration of the experiment")
27
- defProperty('graph', false, "Display graph or not")
28
-
29
- defGroup('Sender', property.res1) do |node|
30
- node.addApplication("test:app:otg2") do |app|
31
- app.setProperty('udp:local_host', '192.168.0.2')
32
- app.setProperty('udp:dst_host', '192.168.0.3')
33
- app.setProperty('udp:dst_port', 3000)
34
- app.measure('udp_out', :samples => 1)
35
- end
36
- node.net.e0.ip = "192.168.0.2"
37
- end
38
-
39
- defGroup('Receiver', property.res2) do |node|
40
- node.addApplication("test:app:otr2") do |app|
41
- app.setProperty('udp:local_host', '192.168.0.3')
42
- app.setProperty('udp:local_port', 3000)
43
- app.measure('udp_in', :samples => 1)
44
- end
45
- node.net.e0.ip = "192.168.0.3"
46
- end
47
-
48
- onEvent(:ALL_UP_AND_INSTALLED) do |event|
49
- info "This is my first OMF experiment"
50
- wait 10
51
- allGroups.startApplications
52
- info "All my Applications are started now..."
53
- wait property.duration
54
- allGroups.stopApplications
55
- info "All my Applications are stopped now."
56
- Experiment.done
57
- end
58
-
59
- if property.graph.value
60
- addTab(:defaults)
61
- addTab(:graph2) do |tab|
62
- opts = { :postfix => %{This graph shows the Sequence Number from the UDP traffic.}, :updateEvery => 1 }
63
- tab.addGraph("Sequence_Number", opts) do |g|
64
- dataOut = Array.new
65
- dataIn = Array.new
66
- mpOut = ms('udp_out')
67
- mpIn = ms('udp_in')
68
- mpOut.project(:oml_ts_server, :seq_no).each do |sample|
69
- dataOut << sample.tuple
70
- end
71
- mpIn.project(:oml_ts_server, :seq_no).each do |sample|
72
- dataIn << sample.tuple
73
- end
74
- g.addLine(dataOut, :label => "Sender (outgoing UDP)")
75
- g.addLine(dataIn, :label => "Receiver (incoming UDP)")
76
- end
77
- end
78
- end
79
-
@@ -1,87 +0,0 @@
1
- #
2
- # Copyright (c) 2006-2010 National ICT Australia (NICTA), Australia
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining a copy
5
- # of this software and associated documentation files (the "Software"), to deal
6
- # in the Software without restriction, including without limitation the rights
7
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- # copies of the Software, and to permit persons to whom the Software is
9
- # furnished to do so, subject to the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be included in
12
- # all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- # THE SOFTWARE.
21
- #
22
- # Tutorial experiment
23
- #
24
- defProperty('res1', 'omf.nicta.node1', "ID of sender node")
25
- defProperty('res2', 'omf.nicta.node2', "ID of receiver node")
26
- defProperty('duration', 60, "Duration of the experiment")
27
- defProperty('graph', false, "Display graph or not")
28
-
29
- defGroup('Sender', property.res1) do |node|
30
- node.addApplication("test:app:otg2") do |app|
31
- app.setProperty('udp:local_host', '192.168.0.2')
32
- app.setProperty('udp:dst_host', '192.168.0.3')
33
- app.setProperty('udp:dst_port', 3000)
34
- app.measure('udp_out', :samples => 1)
35
- end
36
- node.net.w0.mode = "adhoc"
37
- node.net.w0.type = 'g'
38
- node.net.w0.channel = "6"
39
- node.net.w0.essid = "helloworld"
40
- node.net.w0.ip = "192.168.0.2"
41
- end
42
-
43
- defGroup('Receiver', property.res2) do |node|
44
- node.addApplication("test:app:otr2") do |app|
45
- app.setProperty('udp:local_host', '192.168.0.3')
46
- app.setProperty('udp:local_port', 3000)
47
- app.measure('udp_in', :samples => 1)
48
- end
49
- node.net.w0.mode = "adhoc"
50
- node.net.w0.type = 'g'
51
- node.net.w0.channel = "6"
52
- node.net.w0.essid = "helloworld"
53
- node.net.w0.ip = "192.168.0.3"
54
- end
55
-
56
- onEvent(:ALL_UP_AND_INSTALLED) do |event|
57
- info "This is my first OMF experiment"
58
- wait 10
59
- allGroups.startApplications
60
- info "All my Applications are started now..."
61
- wait property.duration
62
- allGroups.stopApplications
63
- info "All my Applications are stopped now."
64
- Experiment.done
65
- end
66
-
67
- if property.graph.value
68
- addTab(:defaults)
69
- addTab(:graph2) do |tab|
70
- opts = { :postfix => %{This graph shows the Sequence Number from the UDP traffic.}, :updateEvery => 1 }
71
- tab.addGraph("Sequence_Number", opts) do |g|
72
- dataOut = Array.new
73
- dataIn = Array.new
74
- mpOut = ms('udp_out')
75
- mpIn = ms('udp_in')
76
- mpOut.project(:oml_ts_server, :seq_no).each do |sample|
77
- dataOut << sample.tuple
78
- end
79
- mpIn.project(:oml_ts_server, :seq_no).each do |sample|
80
- dataIn << sample.tuple
81
- end
82
- g.addLine(dataOut, :label => "Sender (outgoing UDP)")
83
- g.addLine(dataIn, :label => "Receiver (incoming UDP)")
84
- end
85
- end
86
- end
87
-
@@ -1,69 +0,0 @@
1
- # Copyright (c) 2006-2010 National ICT Australia (NICTA), Australia
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
20
- #
21
- # Tutorial experiment
22
- #
23
- defProperty('res1', 'omf.nicta.node1', "ID of sender node")
24
- defProperty('res2', 'omf.nicta.node2', "ID of receiver node")
25
- defProperty('packetsize', 256, "Packet size (byte) from the sender node")
26
- defProperty('runtime', 60, "Time in second for the experiment is to run")
27
-
28
- defGroup('Sender',property.res1) do |node|
29
- node.addApplication("test:app:otg2") do |app|
30
- app.setProperty('udp:local_host', '192.168.0.2')
31
- app.setProperty('udp:dst_host', '192.168.0.3')
32
- app.setProperty('udp:dst_port', 3000)
33
- app.setProperty('cbr:size', property.packetsize)
34
- app.measure('udp_out', :samples => 3) do |mp|
35
- mp.filter('seq_no', 'avg')
36
- end
37
- end
38
- node.net.w0.mode = "adhoc"
39
- node.net.w0.type = 'g'
40
- node.net.w0.channel = "6"
41
- node.net.w0.essid = "helloworld"
42
- node.net.w0.ip = "192.168.0.2"
43
- end
44
-
45
- defGroup('Receiver',property.res2) do |node|
46
- node.addApplication("test:app:otr2") do |app|
47
- app.setProperty('udp:local_host', '192.168.0.3')
48
- app.setProperty('udp:local_port', 3000)
49
- app.measure('udp_in', :samples => 2) do |mp|
50
- mp.filter('pkt_length', 'sum')
51
- mp.filter('seq_no', 'avg')
52
- end
53
- end
54
- node.net.w0.mode = "adhoc"
55
- node.net.w0.type = 'g'
56
- node.net.w0.channel = "6"
57
- node.net.w0.essid = "helloworld"
58
- node.net.w0.ip = "192.168.0.3"
59
- end
60
-
61
- onEvent(:ALL_UP_AND_INSTALLED) do |event|
62
- wait 10
63
- allGroups.startApplications
64
- wait property.runtime / 2
65
- property.packetsize = 512
66
- wait property.runtime / 2
67
- allGroups.stopApplications
68
- Experiment.done
69
- end