harness: devif test fix parsing destination IP on emmentaler2
authorRoni Häcki <roni.haecki@inf.ethz.ch>
Mon, 7 Aug 2017 08:55:44 +0000 (10:55 +0200)
committerRoni Häcki <roni.haecki@inf.ethz.ch>
Mon, 7 Aug 2017 08:55:44 +0000 (10:55 +0200)
Signed-off-by: Roni Häcki <roni.haecki@inf.ethz.ch>

tools/harness/tests/devif_test.py

index 47ee6e4..12d53e0 100644 (file)
@@ -43,9 +43,9 @@ class DevifTests(TestCommon):
         src_ip = struct.unpack("!L", packedIP)[0]
 
         if self.CARD == "sfn5122f":
-            dst_string = subprocess.check_output('nslookup %s-sf.in.barrelfish.org | sed -n 5p | awk -F\" \" \'{print $NF}\'' % machine.name, shell=True)
+            dst_string = subprocess.check_output('nslookup %s-sf.in.barrelfish.org | grep Address | sed -n 2p | awk -F\" \" \'{print $NF}\'' % machine.name, shell=True)
         else:
-            dst_string = subprocess.check_output('nslookup %s-e10k.in.barrelfish.org | sed -n 5p | awk -F\" \" \'{print $NF}\'' % machine.name, shell=True)
+            dst_string = subprocess.check_output('nslookup %s-e10k.in.barrelfish.org | grep Address | sed -n 2p | awk -F\" \" \'{print $NF}\'' % machine.name, shell=True)
 
         packedIP = socket.inet_aton(dst_string)
         dst_ip = struct.unpack("!L", packedIP)[0]