X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_mpls.py;h=8d5d5abb48df0c75d28aeb8b66b74bf4fb1b87d1;hb=8feeaff56fa9a4fbdfc06131f28a1060ffd9645d;hp=e7fb288f8568fd7e664637985dbc7dad37504759;hpb=775f73c6baaf9bc2283e7ab9752c81984823be99;p=vpp.git diff --git a/test/test_mpls.py b/test/test_mpls.py index e7fb288f856..8d5d5abb48d 100644 --- a/test/test_mpls.py +++ b/test/test_mpls.py @@ -11,6 +11,7 @@ from vpp_ip_route import VppIpRoute, VppRoutePath, VppMplsRoute, \ VppMplsLabel, MplsLspMode, find_mpls_route from vpp_mpls_tunnel_interface import VppMPLSTunnelInterface +import scapy.compat from scapy.packet import Raw from scapy.layers.l2 import Ether from scapy.layers.inet import IP, UDP, ICMP @@ -451,7 +452,7 @@ class TestMPLS(VppTestCase): self.verify_capture_ip4(self.pg0, rx, tx) # - # disposed packets have an invalid IPv4 checkusm + # disposed packets have an invalid IPv4 checksum # tx = self.create_stream_labelled_ip4(self.pg0, [VppMplsLabel(33)], dst_ip=self.pg0.remote_ip4, @@ -1280,7 +1281,7 @@ class TestMPLS(VppTestCase): self.send_and_assert_no_replies(self.pg0, tx, "RPF-ID drop none") # - # set the RPF-ID of the enrtry to match the input packet's + # set the RPF-ID of the entry to match the input packet's # route_232_1_1_1.update_rpf_id(55) @@ -1290,7 +1291,7 @@ class TestMPLS(VppTestCase): self.verify_capture_ip4(self.pg1, rx, tx) # - # disposed packets have an invalid IPv4 checkusm + # disposed packets have an invalid IPv4 checksum # tx = self.create_stream_labelled_ip4(self.pg0, [VppMplsLabel(34)], dst_ip="232.1.1.1", n=65, @@ -1350,7 +1351,7 @@ class TestMPLS(VppTestCase): self.send_and_assert_no_replies(self.pg0, tx, "RPF Miss") # - # set the RPF-ID of the enrtry to match the input packet's + # set the RPF-ID of the entry to match the input packet's # route_ff.update_rpf_id(55) @@ -1370,7 +1371,7 @@ class TestMPLS(VppTestCase): self.verify_capture_ip6_icmp(self.pg0, rx, tx) # - # set the RPF-ID of the enrtry to not match the input packet's + # set the RPF-ID of the entry to not match the input packet's # route_ff.update_rpf_id(56) tx = self.create_stream_labelled_ip6(self.pg0, @@ -1391,7 +1392,7 @@ class TestMPLSDisabled(VppTestCase): self.tbl = VppMplsTable(self, 0) self.tbl.add_vpp_config() - # PG0 is MPLS enalbed + # PG0 is MPLS enabled self.pg0.admin_up() self.pg0.config_ip4() self.pg0.resolve_arp() @@ -1572,7 +1573,7 @@ class TestMPLSPIC(VppTestCase): rx0 = self.pg0._get_capture(1) rx1 = self.pg1._get_capture(1) - # not testig the LB hashing algorithm so we're not concerned + # not testing the LB hashing algorithm so we're not concerned # with the split ratio, just as long as neither is 0 self.assertNotEqual(0, len(rx0)) self.assertNotEqual(0, len(rx1)) @@ -1580,7 +1581,7 @@ class TestMPLSPIC(VppTestCase): # # use a test CLI command to stop the FIB walk process, this # will prevent the FIB converging the VPN routes and thus allow - # us to probe the interim (psot-fail, pre-converge) state + # us to probe the interim (post-fail, pre-converge) state # self.vapi.ppcli("test fib-walk-process disable") @@ -1680,7 +1681,7 @@ class TestMPLSPIC(VppTestCase): # # use a test CLI command to stop the FIB walk process, this # will prevent the FIB converging the VPN routes and thus allow - # us to probe the interim (psot-fail, pre-converge) state + # us to probe the interim (post-fail, pre-converge) state # self.vapi.ppcli("test fib-walk-process disable") @@ -1780,7 +1781,7 @@ class TestMPLSPIC(VppTestCase): # # use a test CLI command to stop the FIB walk process, this # will prevent the FIB converging the VPN routes and thus allow - # us to probe the interim (psot-fail, pre-converge) state + # us to probe the interim (post-fail, pre-converge) state # self.vapi.ppcli("test fib-walk-process disable") @@ -1873,7 +1874,7 @@ class TestMPLSL2(VppTestCase): verify_mpls_stack(self, rx, mpls_labels) tx_eth = tx[Ether] - rx_eth = Ether(str(rx[MPLS].payload)) + rx_eth = Ether(scapy.compat.raw(rx[MPLS].payload)) self.assertEqual(rx_eth.src, tx_eth.src) self.assertEqual(rx_eth.dst, tx_eth.dst) @@ -1936,7 +1937,7 @@ class TestMPLSL2(VppTestCase): self.assertEqual(rx0[0][Ether].src, payload[Ether].src) # - # Inject a packet from the custoer/L2 side + # Inject a packet from the customer/L2 side # tx1 = pcore[MPLS].payload * 65 rx1 = self.send_and_expect(self.pg1, tx1, self.pg0) @@ -1971,10 +1972,10 @@ class TestMPLSL2(VppTestCase): # # add to tunnel to the customers bridge-domain # - self.vapi.sw_interface_set_l2_bridge(mpls_tun.sw_if_index, - bd_id=1) - self.vapi.sw_interface_set_l2_bridge(self.pg1.sw_if_index, - bd_id=1) + self.vapi.sw_interface_set_l2_bridge( + rx_sw_if_index=mpls_tun.sw_if_index, bd_id=1) + self.vapi.sw_interface_set_l2_bridge( + rx_sw_if_index=self.pg1.sw_if_index, bd_id=1) # # Packet from the customer interface and from the core @@ -2026,12 +2027,10 @@ class TestMPLSL2(VppTestCase): # # remove interfaces from customers bridge-domain # - self.vapi.sw_interface_set_l2_bridge(mpls_tun.sw_if_index, - bd_id=1, - enable=0) - self.vapi.sw_interface_set_l2_bridge(self.pg1.sw_if_index, - bd_id=1, - enable=0) + self.vapi.sw_interface_set_l2_bridge( + rx_sw_if_index=mpls_tun.sw_if_index, bd_id=1, enable=0) + self.vapi.sw_interface_set_l2_bridge( + rx_sw_if_index=self.pg1.sw_if_index, bd_id=1, enable=0) if __name__ == '__main__': unittest.main(testRunner=VppTestRunner)