defApplication('ifconfig', 'ifconfig') {|a|
   a.name = "ifconfig" 
     a.version(0, 0, 1)
     a.path = "/sbin/ifconfig" 
     a.defProperty('args', "Arguments for ifconfig command", nil,  {:order => 1, :dynamic => false, :type => :string, :use_name => false})
}

defApplication('dhclient', 'dhclient') {|a|
   a.name = "dhclient" 
     a.version(0, 0, 1)
     a.path = "/sbin/dhclient -q" 
     a.defProperty('interface', "DHCP client interface name", nil,  {:order => 1, :dynamic => false, :type => :string, :use_name => false})
}

defApplication('wimaxcu', 'wimaxcu') {|a|
   a.name = "wimaxcu" 
     a.version(0, 0, 1)
     a.path = "/usr/bin/wimaxcu" 
     a.defProperty('args', "Arguments for wimaxcu command", nil,  {:order => 1, :dynamic => false, :type => :string, :use_name => false})
}

defApplication('pingtest_app', 'pingtest') do |a|
  a.path = "/usr/bin/pingtest.rb"
  a.version(0, 0, 1)
  a.shortDescription = "Wrapper around Ping -c"
  a.description = <<TEXT
This is a wrapper around the ping command.
This application is using OML4R part of OML v2.3 or v2.4
TEXT
  a.defProperty('ip', 'Ip address to ping', 'i', 
                {:type => :string, :dynamic => false})

  # List the Measurement Points and associated metrics that are available 
  # for this application
  #
  a.defMeasurement('pingtest') do |m|
    m.defMetric('ip',:string)
    m.defMetric('time',:string)
    m.defMetric('x',:string)
    m.defMetric('y',:string)
  end
end

defGroup('tester', [1,1]) do |node|
  node.addApplication('wimaxcu') { |app|
    app.setProperty('args','connect network 51')
  }
  node.addApplication('dhclient') { |app|
    app.setProperty('interface',"wmx0")
  }
  node.addApplication("pingtest_app") { |a|
    a.setProperty('ip',"10.41.0.1")
    a.measure('pingtest')
  }
end

whenAllInstalled() {|node|
   info "Give machines some time to warm up" 
   wait 10
   allGroups.startApplications
   info "Colect measurements for 100 seconds" 
   wait 100
   info "Finish it." 
   Experiment.done
}
