Opened 10 years ago

Closed 10 years ago

#105 closed enhancement (fixed)

List of Properties in OEDL

Reported by: dbhat@bbn.com Owned by: Thierry.Rakotoarivelo@nicta.com.au
Priority: major Milestone: GEC21
Component: OMF Version: Backlog
Keywords: Cc:
Dependencies:

Description

Currently we have experiments where we run the same application per group with a variation of just one Property, for e.g,

defGroup('Source1', property.source1) do |node|
  node.addApplication("ping") do |app|
    app.setProperty('target', property.sinkaddr12)
    app.setProperty('count', 30)
    app.measure('ping', :samples => 1)
  end
  node.addApplication("ping") do |app|
    app.setProperty('target', property.sinkaddr13)
    app.setProperty('count', 30)
    app.measure('ping', :samples => 1)
  end
   node.addApplication("ping") do |app|
    app.setProperty('target', property.sinkaddr21)
    app.setProperty('count', 30)
    app.measure('ping', :samples => 1)
  end
   node.addApplication("ping") do |app|
    app.setProperty('target', property.sinkaddr23)
    app.setProperty('count', 30)
    app.measure('ping', :samples => 1)
  end
  node.addApplication("ping") do |app|
    app.setProperty('target', property.sinkaddr24)
    app.setProperty('count', 30)
    app.measure('ping', :samples => 1)
  end
end

In the above example, it is only the target address which changes for each application. Could we have a construct similar to:

a) setProperty as a list and have the parser iterate through the list to run the application

defGroup('Source1', property.source1) do |node|
  node.addApplication("ping") do |app|
    app.setProperty('target', property.sinkaddr12, property.sinkaddr13, property.sinkaddr21, property.sinkaddr23, property.sinkaddr24 )
    app.setProperty('count', 30)
    app.measure('ping', :samples => 1)
  end
end

b) Allow defProperty to take list of properties as an as an input and have the addApplication iterate through the list. For e.g.,

defProperty('sinkaddrs', '192.168.1.7', '192.168.1.8','192.168.1.13', '192.168.1.14', '192.168.1.15', "Ping destination address")

defGroup('Source1', property.source1) do |node|
  node.addApplication("ping") do |app|
     app.setProperty('count', 30)
     app.addProperty('target', property.sinkaddrs) do |prop|
        app.setProperty(prop)    
     end
     app.measure('ping', :samples => 1)
  end
end

Change History (5)

comment:1 Changed 10 years ago by johren@bbn.com

Milestone: GEC21

comment:2 Changed 10 years ago by thierry.rakotoarivelo@nicta.com.au

This can already be done now using Ruby iterators and loop constructs:

my_array = [property.sinkaddr1,property.sinkaddr2,property.sinkaddr3]

defGroup('Source1', property.source1) do |node|

my_array.each do |element|

node.addApplication("ping") do |app|

app.setProperty('target', element ) app.setProperty('count', 30) app.measure('ping', :samples => 1)

end

end

end

comment:3 Changed 10 years ago by thierry.rakotoarivelo@nicta.com.au

Sorry for some reason the new lines after each app.(...) in the previous post are not showing up. There should be newline after each app.setProperty and app.measure.

comment:4 Changed 10 years ago by dbhat@bbn.com

Thanks Thierry. I tried an example of this and was able to get it working. We will now write much shorter examples for experimenters.

comment:5 Changed 10 years ago by dbhat@bbn.com

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.