From 08e7f86dfc508ced2f6bc1a3d49964c15bd9a372 Mon Sep 17 00:00:00 2001 From: Olivier Dufour Date: Wed, 20 Mar 2013 14:23:28 +0100 Subject: validation/test/av_home: add a ping check before sending MME, refs #3844 By sending ping packets to the other station, we make sure: * we can communication with the other station * a tonemap will be computed before we request it with a MME --- validation/test/av_home/av_home.py | 6 ++++-- validation/test/av_home/av_mme.py | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'validation') diff --git a/validation/test/av_home/av_home.py b/validation/test/av_home/av_home.py index 3ccc0757f4..a9cc7167e4 100755 --- a/validation/test/av_home/av_home.py +++ b/validation/test/av_home/av_home.py @@ -10,18 +10,20 @@ import av_mme def master_script(): print ("Executing master script") test_init () + print ("Executing ping on slave PC ("+ av_home_attr.addr +")...") + av_mme.ping_peer () print ("Sending MME for environment discovery to " + av_home_attr.plug_mac + " through " + av_home_attr.iface + " ...") av_mme.get_network_env() raw_input ("Press enter when slave script has been launched") - print ("Executing ping on slave PC ("+ av_home_attr.addr +")...") print ("Executing upload iperf test on " + av_home_attr.addr + " ...") raw_input ("Press enter when slave script has finished upload iperf") def slave_script(): print ("Executing slave script") test_init () - print ("Sending MME for environment discovery...") + print ("Executing ping on master PC ("+ av_home_attr.addr +")...") + av_mme.ping_peer () print ("Sending MME for environment discovery to " + av_home_attr.plug_mac + " through " + av_home_attr.iface + " ...") av_mme.get_network_env() diff --git a/validation/test/av_home/av_mme.py b/validation/test/av_home/av_mme.py index 8ad8798a72..3a1bdf7765 100755 --- a/validation/test/av_home/av_mme.py +++ b/validation/test/av_home/av_mme.py @@ -48,6 +48,12 @@ def get_network_env(): if ans: process_tonemap (ans[VS_GET_TONEMAP_CNF]) +def ping_peer(): + ans, unans = srloop (IP(dst=av_home_attr.addr) / ICMP (), count=10) + if not ans: + print "Unable to ping peer, aborting ..." + sys.exit (1) + def process_tonemap (tm): from vs import VS_GET_TONEMAP_CNF ml = tm.modulation_list -- cgit v1.2.3