X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_pppoe.py;h=54378673eb47bb84f338f93843bbb85b66b77bef;hb=317b8e08367c769b90463613231b9fcfad486098;hp=1d0aeffda3729695f80af1babf457d400f23e13d;hpb=43161a873375ddf156cf6fbe8764bfc206b38fa0;p=vpp.git diff --git a/test/test_pppoe.py b/test/test_pppoe.py index 1d0aeffda37..54378673eb4 100644 --- a/test/test_pppoe.py +++ b/test/test_pppoe.py @@ -1,22 +1,17 @@ #!/usr/bin/env python +import socket import unittest -from logging import * - -from framework import VppTestCase, VppTestRunner -from vpp_ip_route import VppIpRoute, VppRoutePath -from vpp_pppoe_interface import VppPppoeInterface, VppPppoe6Interface -from vpp_papi_provider import L2_VTR_OP from scapy.packet import Raw from scapy.layers.l2 import Ether from scapy.layers.ppp import PPPoE, PPPoED, PPP -from scapy.layers.inet import IP, UDP -from scapy.layers.inet6 import IPv6 -from scapy.volatile import RandMAC, RandIP +from scapy.layers.inet import IP -from util import ppp, ppc, mactobinary -import socket +from framework import VppTestCase, VppTestRunner +from vpp_ip_route import VppIpRoute, VppRoutePath +from vpp_pppoe_interface import VppPppoeInterface +from util import ppp, ppc class TestPPPoE(VppTestCase): @@ -30,6 +25,10 @@ class TestPPPoE(VppTestCase): cls.dst_ip = "100.1.1.100" cls.dst_ipn = socket.inet_pton(socket.AF_INET, cls.dst_ip) + @classmethod + def tearDownClass(cls): + super(TestPPPoE, cls).tearDownClass() + def setUp(self): super(TestPPPoE, self).setUp() @@ -44,16 +43,17 @@ class TestPPPoE(VppTestCase): def tearDown(self): super(TestPPPoE, self).tearDown() + for i in self.pg_interfaces: + i.unconfig_ip4() + i.admin_down() + + def show_commands_at_teardown(self): self.logger.info(self.vapi.cli("show int")) self.logger.info(self.vapi.cli("show pppoe fib")) self.logger.info(self.vapi.cli("show pppoe session")) self.logger.info(self.vapi.cli("show ip fib")) self.logger.info(self.vapi.cli("show trace")) - for i in self.pg_interfaces: - i.unconfig_ip4() - i.admin_down() - def create_stream_pppoe_discovery(self, src_if, dst_if, client_mac, count=1): packets = [] @@ -343,7 +343,7 @@ class TestPPPoE(VppTestCase): # and we should still be able to use the original # try: - gre_if.add_vpp_config() + pppoe_if.add_vpp_config() except Exception: pass else: @@ -400,7 +400,7 @@ class TestPPPoE(VppTestCase): # and we should still be able to use the original # try: - gre_if.remove_vpp_config() + pppoe_if.remove_vpp_config() except Exception: pass else: