From 0fe1adda116b0cae3ed4cefcb5d8601fd901e1bb Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 20 Mar 2019 00:02:52 +0100 Subject: [PATCH] Extend test with switch icmp6 test --- p4app/test.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/p4app/test.py b/p4app/test.py index 02ee6ec..016047c 100644 --- a/p4app/test.py +++ b/p4app/test.py @@ -16,6 +16,15 @@ class TestStuff(object): def __init__(self): pass + def test_icmp6_switch(self): + host = "h1" + dst_ipv6 = ipaddress.ip_address("2001:db8::42") + + log.info("Trying to reach {} from {}".format(dst_ipv6, host)) + cmd = "mx h1 ping6 -c1 {}".format(dst_ipv6) + + return cmd + def test_v6_static_mapping(self): host = "h1" nat64_prefix = ipaddress.ip_network("64:ff9b::/96") @@ -25,7 +34,8 @@ class TestStuff(object): log.info("Trying to reach {} ({}) from {}".format(dst_ipv4, translated_ipv4, host)) cmd = "mx h1 ping6 -c1 {}".format(translated_ipv4).split(" ") - subprocess.call(cmd) + return cmd + def commandline(self): parser = argparse.ArgumentParser(description='controller++') @@ -50,7 +60,7 @@ class TestStuff(object): log.setLevel(logging.WARNING) f = getattr(self, "test_{}".format(self.args.method)) - f() + subprocess.call(f()) if __name__ == "__main__": import sys