本文整理汇总了Python中nepi.execution.ec.ExperimentController.wait_started方法的典型用法代码示例。如果您正苦于以下问题:Python ExperimentController.wait_started方法的具体用法?Python ExperimentController.wait_started怎么用?Python ExperimentController.wait_started使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nepi.execution.ec.ExperimentController
的用法示例。
在下文中一共展示了ExperimentController.wait_started方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: t_traces
# 需要导入模块: from nepi.execution.ec import ExperimentController [as 别名]
# 或者: from nepi.execution.ec.ExperimentController import wait_started [as 别名]
def t_traces(self, host, user):
ec = ExperimentController(exp_id = "test-fib-traces")
node1 = ec.register_resource("linux::Node")
ec.set(node1, "hostname", host)
ec.set(node1, "username", user)
ec.set(node1, "cleanExperiment", True)
ec.set(node1, "cleanProcesses", True)
ccnd1 = ec.register_resource("linux::CCND")
ec.register_connection(ccnd1, node1)
entry1 = ec.register_resource("linux::FIBEntry")
ec.set(entry1, "host", self.target)
ec.enable_trace(entry1, "ping")
ec.enable_trace(entry1, "mtr")
ec.register_connection(entry1, ccnd1)
node2 = ec.register_resource("linux::Node")
ec.set(node2, "hostname", self.target)
ec.set(node2, "username", self.fedora_user)
ec.set(node2, "cleanExperiment", True)
ec.set(node2, "cleanProcesses", True)
ccnd2 = ec.register_resource("linux::CCND")
ec.register_connection(ccnd2, node2)
entry2 = ec.register_resource("linux::FIBEntry")
ec.set(entry2, "host", host)
ec.register_connection(entry2, ccnd2)
ec.deploy()
ec.wait_started([ccnd1, ccnd2])
stdout = ec.trace(entry1, "ping")
expected = "icmp_seq=1"
self.assertTrue(stdout.find(expected) > -1)
stdout = ec.trace(entry1, "mtr")
expected = "1."
self.assertTrue(stdout.find(expected) > -1)
ec.shutdown()
示例2: server
# 需要导入模块: from nepi.execution.ec import ExperimentController [as 别名]
# 或者: from nepi.execution.ec.ExperimentController import wait_started [as 别名]
ec.register_condition(upload_conf, ResourceAction.START, vlc_server, ResourceState.STARTED , "2s")
ec.register_condition(vlc_wificenter, ResourceAction.START, upload_conf, ResourceState.STARTED , "2s")
# measurements in video server (PL node)
measure_videoserver = ec.register_resource("linux::Application")
ec.set(measure_videoserver, "depends", "tcpdump")
ec.set(measure_videoserver, "sudo", True)
command = "tcpdump -i eth0 not arp -n -w /tmp/capplserver_%s.pcap" % ("$(date +'%Y%m%d%H%M%S')")
ec.set(measure_videoserver, "command", command)
ec.register_connection(measure_videoserver, video_server)
# Deploy servers
ec.deploy([vlc_server, upload_conf, vlc_wificenter, measure_videoserver])
ec.wait_started([vlc_server, upload_conf, vlc_wificenter, measure_videoserver])
time.sleep(3)
def deploy_experiment(ec, clients, wifi_center):
# measurements in transmitter eth0
command_measure_wificentereth0 = "/usr/sbin/tcpdump -i eth0 not arp -n -w /tmp/capwificen_eth0_%s_%s.pcap" % (len(clients), "$(date +'%Y%m%d%H%M%S')")
measure_wificentereth0 = create_omf_app(ec, command_measure_wificentereth0, wifi_center)
ec.register_condition(measure_wificentereth0, ResourceAction.STOP, measure_wificentereth0, ResourceState.STARTED , "65s")
# measurements in transmitter wlan0
command_measure_wificenterwlan0 = "/usr/sbin/tcpdump -i wlan0 not arp -n -w /tmp/capwificen_wlan0_%s_%s.pcap" % (len(clients), "$(date +'%Y%m%d%H%M%S')")
measure_wificenterwlan0 = create_omf_app(ec, command_measure_wificenterwlan0, wifi_center)
ec.register_condition(measure_wificenterwlan0, ResourceAction.STOP, measure_wificenterwlan0, ResourceState.STARTED , "65s")
示例3:
# 需要导入模块: from nepi.execution.ec import ExperimentController [as 别名]
# 或者: from nepi.execution.ec.ExperimentController import wait_started [as 别名]
ec.set(app1, 'version', "5")
ec.set(app1, 'command', "/users/jtribino/RobotCTRLComm.rb /users/jtribino/coordinate.csv")
# /users/username/RobotCTRLComm.rb /users/username/coordinate.csv
ec.set(app1, 'env', " ")
ec.set(app1, 'sources', "/home/wlab18/Desktop/coordinate.csv") # local path
ec.set(app1, 'sshUser', "jtribino") # username
# Connection
ec.register_connection(app1, node1)
# The Application should run during 350sec
ec.register_condition(app1, ResourceAction.STOP, app1, ResourceState.STARTED , "350s")
# Deploy
ec.deploy()
ec.wait_started([app1])
ec.set(app1, 'stdin', "START_DRIVE")
time.sleep(83)
ec.set(app1, 'stdin', "1;openlefteye")
time.sleep(2)
ec.set(app1, 'stdin', "2;openlefteye")
ec.wait_finished([app1])
# Stop Experiment
ec.shutdown()