Tutorials/g0WmLTE/Tutorial1: wimax-tutorial1.rb

File wimax-tutorial1.rb, 2.0 KB (added by seskar, 13 years ago)

Wimax tutroal 1 ED file

Line 
1defApplication('ifconfig', 'ifconfig') {|a|
2 a.name = "ifconfig"
3 a.version(0, 0, 1)
4 a.path = "/sbin/ifconfig"
5 a.defProperty('args', "Arguments for ifconfig command", nil, {:order => 1, :dynamic => false, :type => :string, :use_name => false})
6}
7
8defApplication('dhclient', 'dhclient') {|a|
9 a.name = "dhclient"
10 a.version(0, 0, 1)
11 a.path = "/sbin/dhclient -q"
12 a.defProperty('interface', "DHCP client interface name", nil, {:order => 1, :dynamic => false, :type => :string, :use_name => false})
13}
14
15defApplication('wimaxcu', 'wimaxcu') {|a|
16 a.name = "wimaxcu"
17 a.version(0, 0, 1)
18 a.path = "/usr/bin/wimaxcu"
19 a.defProperty('args', "Arguments for wimaxcu command", nil, {:order => 1, :dynamic => false, :type => :string, :use_name => false})
20}
21
22defApplication('pingtest_app', 'pingtest') do |a|
23 a.path = "/usr/bin/pingtest.rb"
24 a.version(0, 0, 1)
25 a.shortDescription = "Wrapper around Ping -c"
26 a.description = <<TEXT
27This is a wrapper around the ping command.
28This application is using OML4R part of OML v2.3 or v2.4
29TEXT
30 a.defProperty('ip', 'Ip address to ping', 'i',
31 {:type => :string, :dynamic => false})
32
33 # List the Measurement Points and associated metrics that are available
34 # for this application
35 #
36 a.defMeasurement('pingtest') do |m|
37 m.defMetric('ip',:string)
38 m.defMetric('time',:string)
39 m.defMetric('x',:string)
40 m.defMetric('y',:string)
41 end
42end
43
44defGroup('tester', [1,1]) do |node|
45 node.addApplication('wimaxcu') { |app|
46 app.setProperty('args','connect network 51')
47 }
48 node.addApplication('dhclient') { |app|
49 app.setProperty('interface',"wmx0")
50 }
51 node.addApplication("pingtest_app") { |a|
52 a.setProperty('ip',"10.41.0.1")
53 a.measure('pingtest')
54 }
55end
56
57whenAllInstalled() {|node|
58 info "Give machines some time to warm up"
59 wait 10
60 allGroups.startApplications
61 info "Colect measurements for 100 seconds"
62 wait 100
63 info "Finish it."
64 Experiment.done
65}