OMF examples
[nepi.git] / examples / omf / iminds_omf6_ping.py
index 08c3efe..327409d 100644 (file)
@@ -26,7 +26,7 @@
 # Topology
 #
 #
-#  Testbed : IMinds
+#  Testbed : iMinds
 #
 #     Node
 #     node0ZZ 
@@ -37,7 +37,6 @@
 #     Node
 #     node0ZZ 
 #     PING
-#     
 #   
 #      - Experiment:
 #        - t0 : Deployment
@@ -67,9 +66,6 @@ parser.add_option("-z", "--nodez", dest="nodez",
             " nodex.<experiment_id>.<project_id>.wilab2.ilabt.iminds.be"
             " all letters in lowercase )", 
         type="str")
-parser.add_option("-c", "--channel", dest="channel", 
-        help="Nitos reserved channel",
-        type="str")
 parser.add_option("-s", "--slice-name", dest="slicename", 
         help="Nitos slice name", type="str")
 (options, args) = parser.parse_args()
@@ -77,7 +73,6 @@ parser.add_option("-s", "--slice-name", dest="slicename",
 nodex = options.nodex
 nodez = options.nodez
 slicename = options.slicename
-chan = options.channel
 
 # Create the EC
 ec = ExperimentController(exp_id="iminds_omf6_ping")
@@ -124,16 +119,19 @@ app1 = ec.register_resource("OMFApplication")
 ec.set(app1, "command", "ping -c3 192.168.0.2") 
 ec.register_connection(app1, node1)
 
-ec.register_condition([app1], ResourceAction.STOP, [app1], 
+## Make sure the ping stops after 30 seconds
+ec.register_condition(app1, ResourceAction.STOP, app1, 
         ResourceState.STARTED , "30s")
 
 # Deploy
 ec.deploy()
 
+# Wait until the VLC client is finished
 ec.wait_finished([app1])
 
-# RESULT
-print ec.trace(app1, "stdout")
+# Retrieve the output of the ping command
+ping_output = ec.trace(app1, "stdout")
+print "\n PING OUTPUT\n", ping_output, "\n"
 
 # Stop Experiment
 ec.shutdown()