| 7 | The experiment script is given here: |
| 8 | |
| 9 | {{{ |
| 10 | #!ruby |
| 11 | |
| 12 | defProperty('hrnSuffix', ".sb4.orbit-lab.org", "Suffix to use for the HRN of resources") |
| 13 | defProperty('hrnPrefix', "node1-", "Prefix to use for the HRN of resources") |
| 14 | defProperty('client1', "6", "ID for the first resource to use as downloader") |
| 15 | defProperty('client2', "5", "ID for the second resource to use as downloader") |
| 16 | defProperty('server', "7", "ID for the resource to use as server") |
| 17 | defProperty('duration', 120, "Duration of experiment") |
| 18 | defProperty('attUrl', "http://internal2dmz.orbit-lab.org:5052/instr/set?", "Path to use to set attenuation") |
| 19 | defProperty('buffer', 4, "Buffer size for downloading base layer") |
| 20 | defProperty('window', 3, "Window to use for streamloading") |
| 21 | |
| 22 | |
| 23 | defGroup("server", "#{property.hrnPrefix}#{property.server}#{property.hrnSuffix}") do |node| |
| 24 | node.net.x0.profile = '51' |
| 25 | node.net.x0.ip = '10.43.0.4%y%' |
| 26 | node.net.x0.netmask = "255.255.0.0" |
| 27 | end |
| 28 | |
| 29 | defGroup("client1", "#{property.hrnPrefix}#{property.client1}#{property.hrnSuffix}") do |node| |
| 30 | node.net.x0.profile = '51' |
| 31 | node.net.x0.ip = '10.43.0.4%y%' |
| 32 | node.net.x0.netmask = "255.255.0.0" |
| 33 | node.addApplication("wmxstat_universal") do |app| |
| 34 | app.measure('status') |
| 35 | end |
| 36 | node.addApplication("streamload") do |app| |
| 37 | app.setProperty('url', "http://10.43.0.4#{property.server}:8000/root/") |
| 38 | app.setProperty('video', "vidoe#{property.buffer}") |
| 39 | app.setProperty('window', property.window) |
| 40 | app.setProperty('streamload', "True") |
| 41 | app.measure('dl', :samples =>1) |
| 42 | app.measure('conf', :samples =>1) |
| 43 | app.measure('play', :samples =>1) |
| 44 | end |
| 45 | end |
| 46 | |
| 47 | defGroup("client2", "#{property.hrnPrefix}#{property.client2}#{property.hrnSuffix}") do |node| |
| 48 | node.net.x0.profile = '51' |
| 49 | node.net.x0.ip = '10.43.0.4%y%' |
| 50 | node.net.x0.netmask = "255.255.0.0" |
| 51 | node.addApplication("wmxstat_universal") do |app| |
| 52 | app.measure('status') |
| 53 | end |
| 54 | node.addApplication("streamload") do |app| |
| 55 | app.setProperty('url', "http://10.43.0.4#{property.server}:8000/root/") |
| 56 | app.setProperty('video', "video#{property.buffer}") |
| 57 | app.setProperty('window', property.window) |
| 58 | app.setProperty('streamload', "False") |
| 59 | app.measure('dl', :samples =>1) |
| 60 | app.measure('conf', :samples =>1) |
| 61 | app.measure('play', :samples =>1) |
| 62 | end |
| 63 | end |
| 64 | |
| 65 | |
| 66 | onEvent(:ALL_UP_AND_INSTALLED) do |event| |
| 67 | wait 5 |
| 68 | system("/home/#{ENV['USER']}/getbsconf -i wimaxrf --oml-server tcp:oml:3003 --oml-id console --oml-exp-id #{Experiment.ID}") |
| 69 | info "This is my experiment ID: #{Experiment.ID}" |
| 70 | group("server").exec("/usr/bin/python -m SimpleHTTPServer") |
| 71 | group("client1").startApplications |
| 72 | wait property.duration |
| 73 | group("client1").stopApplications |
| 74 | wait 5 |
| 75 | group("client2").startApplications |
| 76 | wait property.duration |
| 77 | group("client2").stopApplications |
| 78 | wait 5 |
| 79 | allGroups.stopApplications |
| 80 | Experiment.done |
| 81 | end |
| 82 | |
| 83 | |
| 84 | }}} |
| 85 | |