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,53 +0,0 @@
1
- # This experiment can be used to power on, off, reset or reboot nodes using the CMC
2
-
3
- # empty group to stop OMF from complaining
4
- # & prevent it from powering on nodes
5
- defGroup("tell","")
6
-
7
- defProperty('nodes', 'system:topo:all', 'Nodes to act on')
8
- defProperty('command', false, 'Command as in on, offh, offs, reboot, reset')
9
-
10
- topo = nil
11
- begin
12
- # if 'nodes' is a topology file, try to load it
13
- topo = Topology["#{prop.nodes}"]
14
- rescue
15
- # if not create a new topology here
16
- topo = Topology.create(nil, "#{prop.nodes}")
17
- end
18
-
19
- tuples = []
20
- call = nil
21
-
22
- case "#{prop.command}"
23
- when "on"
24
- call = "on"
25
- when "offh"
26
- call = "offHard"
27
- when "offs"
28
- call = "offSoft"
29
- when "reboot"
30
- call = "reboot"
31
- when "reset"
32
- call = "reset"
33
- else
34
- raise "Unknown command: '#{prop.command}'. Use 'help' to see usage information."
35
- end
36
-
37
- $stderr.print " Talking to the CMC service, please wait"
38
-
39
- topo.eachNode {|n|
40
- tuples << ["#{n.to_s}", eval("OMF::Services.cmc.#{call}"+
41
- "(n.to_s, OConfig.domain).elements[1].name")]
42
- $stderr.print "."
43
- }
44
-
45
- puts
46
- puts "-----------------------------------------------"
47
- puts " Domain: #{OConfig.domain} - Command: #{call}"
48
- tuples.each {|t|
49
- puts " Node: #{t[0]} \t Reply: #{t[1]}"
50
- }
51
- puts "-----------------------------------------------"
52
-
53
- Experiment.done
@@ -1,12 +0,0 @@
1
- defProperty('logpath', "unconfigured-logpath", "Path to experiment log")
2
- defProperty('outpath', "unconfigured-outpath", "Path to experiment output")
3
-
4
- onEvent(:EXPERIMENT_DONE) do |event|
5
- begin
6
- f = File.open("#{property.outpath}", 'w')
7
- check_outcome ? f.puts("OK") : f.puts("FAILED")
8
- f.close
9
- rescue Exception => ex
10
- puts "TEST - Failed to check the outcome of a test (Error: '#{ex}'"
11
- end
12
- end
@@ -1,154 +0,0 @@
1
- #
2
- # Copyright (c) 2006-2009 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
- #
23
- # = winlib.rb
24
- #
25
- # == Description
26
- #
27
- # THIS IS FOR WINLAB ONLY
28
- #
29
- # To use the old OMF 5.2 syntax for node description (e.g. [x,y])
30
- # - load this file in your experiment
31
- # - rename your 'defTopology' in your experiment by 'defTopology52'
32
- # - rename your 'defGroup' in your experiment by 'defGroup52'
33
- # See the examples of use in the test section at the end of this file
34
- #
35
-
36
-
37
- # THIS IS FOR WINLAB ONLY
38
- # Return a HRN for a resource based on:
39
- # - its [x,y] coordinates
40
- # - the testbed console on which this experiment is currently being executed
41
- # - a fixed PREFIX
42
- # e.g. if console's hostname is 'console.grid.orbit-lab.org' and prefix is 'node'
43
- # and the resource is at coordinate [1,2]
44
- # then the returned HRN is 'node1-2.grid.orbit-lab.org'
45
- #
46
- HRN_PREFIX='node'
47
- @@hrnSuffix = nil
48
- def hrn(x,y)
49
- @@hrnSuffix = `hostname`.chomp!.split('console')[1] if @@hrnSuffix.nil?
50
- raise "Translating 5.2 resource syntax to 5.3 one. "+
51
- "Cannot figure out which WINLAB console we are running on! " +
52
- "(hostname: #{`hostname`})" if @@hrnSuffix.nil?
53
- return "#{HRN_PREFIX}#{x}-#{y}#{@@hrnSuffix}"
54
- end
55
-
56
- # THIS IS FOR WINLAB ONLY
57
- # Turns a list of node in the 5.2 [x,y] syntax into a list of 5.3 HRN
58
- # (this code is from the 5.2. Topology class)
59
- #
60
- def turn_52_to_53(nodes)
61
- list = []
62
- if ! nodes[0].kind_of?(Array)
63
- # Array should contain two ranges
64
- return [] if nodes.length != 2
65
- x = nodes[0]
66
- if x.kind_of?(Integer)
67
- x = [x]
68
- elsif x.kind_of?(ExperimentProperty)
69
- x = [x.value]
70
- end
71
- y = nodes[1]
72
- if y.kind_of?(Integer)
73
- y = [y]
74
- elsif y.kind_of?(ExperimentProperty)
75
- y = [y.value]
76
- end
77
- # Expected two range declarations, but found #{nodes.join(', ')}."
78
- return [] if ! ((x.kind_of?(Range) || x.kind_of?(Array)) && (y.kind_of?(Array) || y.kind_of?(Range)))
79
- x.each { |i| y.each {|j| list << hrn(i, j) } }
80
- else
81
- nodes.each {|n| list << turn_52_to_53(n) }
82
- end
83
- return list
84
- end
85
-
86
- # THIS IS FOR WINLAB ONLY
87
- # Turns a group/topology selector from the 5.2 to the 5.3 format
88
- # If the format change is not possible, returns the original selector
89
- #
90
- def process_selector(selector)
91
- resources = nil
92
- # Make sure we use the selector's value if it's an Experiment Property
93
- selector = selector.value if selector.kind_of?(ExperimentProperty)
94
- # If this is a 5.2 selector then turn it into a 5.3 one
95
- if selector.kind_of?(Array)
96
- # Add a single resource
97
- if (selector.length == 2 && selector[0].kind_of?(Integer) && selector[1].kind_of?(Integer))
98
- resources = [hrn(selector[0],selector[1])]
99
- # Add a many resource
100
- else
101
- resources = turn_52_to_53(selector)
102
- end
103
- end
104
- # If the 5.2 to 5.3 process did not succeed, then use the original selector
105
- sel = (!resources.nil? && !resources.empty?) ? resources.join(',') : selector
106
- return sel
107
- end
108
-
109
- # THIS IS FOR WINLAB ONLY
110
- # Provide a new 'defGroup52' method which accept 5.3 node coordinate syntax,
111
- # turns them into 5.3 HRN syntax and call the 5.3 defGroup with it
112
- #
113
- def defGroup52(groupName, selector = nil, &block)
114
- sel = process_selector(selector)
115
- #puts ">>> s: '#{selector}'" ; puts ">>> r: '#{sel}'"
116
- OMF::EC::CmdContext.instance.defGroup(groupName, sel, &block)
117
- end
118
-
119
- # THIS IS FOR WINLAB ONLY
120
- # Provide a new 'defTopology52' method which accept 5.3 node coordinate syntax,
121
- # turns them into 5.3 HRN syntax and call the 5.3 defTopology with it
122
- #
123
- def defTopology52(topoName, selector = nil, &block)
124
- sel = process_selector(selector)
125
- #puts ">>> s: '#{selector.inspect}'" ; puts ">>> r: '#{sel}'"
126
- OMF::EC::CmdContext.instance.defTopology(topoName, sel, &block)
127
- end
128
-
129
- #
130
- # Testing Topology: uncomment below and run with "omf-5.3 exec winlib.rb"
131
- #
132
- #defTopology52('topo1', [2,3])
133
- #defTopology52('topo2', [[2,3],[4,5],[6,7]])
134
- #defTopology52('topo3', [1..2,4..5])
135
- #defTopology52('topo4', [[1..2,4..5],[6,7],[8,9]])
136
- #defProperty('res2', [1..2,1..2], "Some nodes")
137
- #defTopology52('topo5', property.res2)
138
- #(1..5).each { |i|
139
- # puts "Content of Topology: topo#{i}"
140
- # Topology["topo#{i}"].eachNode { |n| puts "- #{n}" }
141
- #}
142
- #Experiment.done
143
-
144
- #
145
- # Testing Groups: uncomment below and run with "omf-5.3 exec winlib.rb"
146
- #
147
- #defGroup52('group1', [2,3])
148
- #defGroup52('group2', [[2,3],[4,5],[6,7]])
149
- #defGroup52('group3', [1..2,4..5])
150
- #defGroup52('group4', [[1..2,4..5],[6,7],[8,9]])
151
- #defProperty('res1', [1..2,1..2], "Some nodes")
152
- #defGroup52('group5', property.res1)
153
- #defGroup52('group6', ['group1','group2'])
154
- #Experiment.done
@@ -1,9 +0,0 @@
1
- #
2
- # Topology containing entire active nodes on the current testbed
3
- #
4
- defTopology('system:topo:active') { |t|
5
- active = Topology["system:topo:active:#{OConfig.domain}"]
6
- active.each { |n|
7
- t.addNode(n)
8
- }
9
- }
@@ -1,10 +0,0 @@
1
- #
2
- # Topology containing entire testbed
3
- #
4
-
5
- defTopology('system:topo:all'){ |t|
6
- all = OMF::Services.inventory.getListOfResources(OConfig.domain)
7
- all.elements.each("RESOURCES/NODE"){|e|
8
- t.addNode(e.text)
9
- }
10
- }
@@ -1,23 +0,0 @@
1
- defProperty('radius', 8, "Circle radius")
2
- defProperty('xCenter', 10, "x coordinate of circle center")
3
- defProperty('yCenter', 10, "y coordinate of circle center")
4
-
5
- # nodes arranged in a circle
6
- defTopology('system:topo:circle') { |t|
7
- puts "<#{t}>"
8
- # use simple 4-way algorithm
9
- radius = prop.radius.value
10
- xCenter = prop.xCenter.value
11
- yCenter = prop.yCenter.value
12
-
13
- r2 = radius * radius
14
- t.addNode(xCenter, yCenter + radius)
15
- t.addNode(xCenter, yCenter - radius)
16
- (1..radius).each { |x|
17
- y = (Math.sqrt(r2 - x*x) + 0.5).to_i
18
- t.addNode(xCenter + x, yCenter + y)
19
- t.addNode(xCenter + x, yCenter - y)
20
- t.addNode(xCenter - x, yCenter + y)
21
- t.addNode(xCenter - x, yCenter - y)
22
- }
23
- }
@@ -1,73 +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
- #
26
- # Create an application representation from scratch
27
- #
28
- require 'omf-expctl/application/appDefinition'
29
-
30
- a = AppDefinition.create('test:app:aodvd')
31
- a.name = "aodvd"
32
- a.version(0, 0, 1)
33
- a.shortDescription = "Iperf traffic generator"
34
- a.description = <<TEXT
35
- Iperf is a traffic generator for TCP and UDP traffic. It contains generators
36
- producing various forms of packet streams and port for sending
37
- these packets via various transports, such as TCP and UDP.
38
- TEXT
39
-
40
- # addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
41
- a.addProperty('interface', 'Interface to run on', ?i, :string, false)
42
- a.addProperty('log', 'Enable logging', ?l, :string, false)
43
- a.addProperty('rttable', 'Log rting table every N secs', ?r, :string, false)
44
-
45
- a.addMeasurement("receiverport", nil, [
46
- ['flow_no','int'],
47
- ['throughput',Float],
48
- ['jitter',Float],
49
- ['packet_loss',Float]
50
- ])
51
- a.path = "/usr/sbin/aodvd"
52
-
53
- if $0 == __FILE__
54
- require 'stringio'
55
- require 'rexml/document'
56
- include REXML
57
-
58
- sio = StringIO.new()
59
- a.to_xml.write(sio, 2)
60
- sio.rewind
61
- puts sio.read
62
-
63
- sio.rewind
64
- doc = Document.new(sio)
65
- t = AppDefinition.from_xml(doc.root)
66
-
67
- puts
68
- puts "-------------------------"
69
- puts
70
- t.to_xml.write($stdout, 2)
71
-
72
- end
73
-
@@ -1,102 +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
- #
26
-
27
- # Create an application representation from scratch
28
-
29
- #
30
-
31
- require "appDefinition.rb"
32
-
33
-
34
-
35
-
36
-
37
- a = AppDefinition.create("nodeAgent")
38
-
39
- a.url = "http://apps.orbit-lab.org/nodeAgent"
40
-
41
- a.name = "NodeAgent"
42
-
43
- a.version(0, 0, 1)
44
-
45
- a.shortDescription = "Node Agent"
46
-
47
- a.description = "\
48
-
49
- A node agent is active on every experiment node and communicates through \
50
-
51
- semantic multicast with all other agents in the system. It can control all the resources \
52
-
53
- on a node and can react to commands from the management agent to control \
54
-
55
- the life cycle of experiments on the respective node."
56
-
57
-
58
-
59
- # addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
60
-
61
- a.addProperty("channel_id", "Channel to send on", "c", "int", true)
62
-
63
- a.addProperty("payload_length", "Length of payload of packet", "l", "int", true)
64
-
65
-
66
-
67
-
68
-
69
- a.addMeasurement("group1", nil, [
70
-
71
- ["rssi", AppMeasurement::FLOAT],
72
-
73
- ["noise", AppMeasurement::FLOAT]
74
-
75
- ])
76
-
77
- a.addMeasurement("group2", nil, [
78
-
79
- ["throughput", AppMeasurement::FLOAT]
80
-
81
- ])
82
-
83
- a.addMeasurement("group3", nil, [
84
-
85
- ["offered_load", AppMeasurement::FLOAT]
86
-
87
- ])
88
-
89
-
90
-
91
- a.to_xml.write($stdout, 2)
92
-
93
- puts
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
@@ -1,76 +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
- #
26
- # Create an application representation from scratch
27
- #
28
- require 'omf-expctl/application/appDefinition'
29
-
30
- a = AppDefinition.create('test:app:athstats')
31
- a.name = "athstats"
32
- a.version(0, 0, 1)
33
- a.shortDescription = "Application to gather madwifi driver statistics"
34
- a.description = <<TEXT
35
- This C application gathers driver statistics and reports them.
36
- TEXT
37
-
38
- # addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
39
- a.addProperty('interface', 'Use ath0/ath1, ath0 by default', nil, :string, false)
40
- a.addProperty('interval', 'Number of msec between calls to query driver', nil, :string, false)
41
-
42
- a.addMeasurement("queryport", nil, [
43
- ['succ_tx_attempts', 'int'],
44
- ['fail_xretries', 'int'],
45
- ['fail_fifoerr', 'int'],
46
- ['fail_filtered', 'int'],
47
- ['short_retries', 'int'],
48
- ['long_retries', 'int'],
49
- ['total_frames_rcvd', 'int'],
50
- ['crc_errors', 'int'],
51
- ['fifo_errors', 'int'],
52
- ['phy_errors', 'int']
53
- ])
54
- a.path = "/usr/bin/athstats-oml"
55
-
56
- if $0 == __FILE__
57
- require 'stringio'
58
- require 'rexml/document'
59
- include REXML
60
-
61
- sio = StringIO.new()
62
- a.to_xml.write(sio, 2)
63
- sio.rewind
64
- puts sio.read
65
-
66
- sio.rewind
67
- doc = Document.new(sio)
68
- t = AppDefinition.from_xml(doc.root)
69
-
70
- puts
71
- puts "-------------------------"
72
- puts
73
- t.to_xml.write($stdout, 2)
74
-
75
- end
76
-
@@ -1,36 +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
- require 'omf-expctl/application/appDefinition'
26
-
27
- defApplication('test:app:echo', 'echo') { |a|
28
-
29
- a.version(1, 0, 0)
30
- a.shortDescription = "The shell Echo command"
31
- a.description = <<TEXT
32
- echo is a wrapper around the echo shell command.
33
- TEXT
34
-
35
- a.path = "/bin/echo"
36
- }
@@ -1,100 +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
- #
26
-
27
- # Create an application representation from scratch
28
-
29
- #
30
-
31
- require "appDefinition.rb"
32
-
33
-
34
-
35
- a = AppDefinition.create("gennyReceiver")
36
-
37
- a.url = "http://apps.orbit-lab.org/gennyReceiver"
38
-
39
- a.name = "gennyReceiver"
40
-
41
- a.version(0, 0, 1)
42
-
43
- a.shortDescription = "Traffic sink"
44
-
45
- a.description = <<TEXT
46
-
47
- Genny Revceiver is the receiving peer of the UDP traffic
48
-
49
- generator that reports measurements such as RSSI, noise
50
-
51
- and throughput. It can be configured to use
52
-
53
- libmac (for RSSI measurement) or plain sockets
54
-
55
- as its underlying transport mechanism.
56
-
57
- TEXT
58
-
59
-
60
-
61
- # addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
62
-
63
- a.addProperty(:interface_name, "Interface to send on", ?i, :string, false)
64
-
65
- a.addProperty(:use_socket, "Socket or Libmac", ?s, :boolean, false)
66
-
67
-
68
-
69
-
70
-
71
- a.addMeasurement(:group1, nil, [
72
-
73
- [:rssi, AppMeasurement::FLOAT],
74
-
75
- [:noise, AppMeasurement::FLOAT]
76
-
77
- ])
78
-
79
- a.addMeasurement(:group2, nil, [
80
-
81
- [:throughput, AppMeasurement::FLOAT]
82
-
83
- ])
84
-
85
-
86
-
87
- a.repository("http://repository.orbit-lab.org/common/gennyReceiver")
88
-
89
-
90
-
91
- if $0 == __FILE__
92
-
93
- a.to_xml.write($stdout, 2)
94
-
95
- puts
96
-
97
- end
98
-
99
-
100
-