aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_srv6_mobile.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_srv6_mobile.py')
-rw-r--r--test/test_srv6_mobile.py23
1 files changed, 19 insertions, 4 deletions
diff --git a/test/test_srv6_mobile.py b/test/test_srv6_mobile.py
index 9d39f194015..7a96e84e34f 100644
--- a/test/test_srv6_mobile.py
+++ b/test/test_srv6_mobile.py
@@ -4,6 +4,7 @@ from framework import VppTestCase
from ipaddress import IPv4Address
from ipaddress import IPv6Address
from vpp_ip_route import VppIpRoute, VppRoutePath, FibPathProto, VppIpTable
+from config import config
from vpp_srv6_mobile import (
SRv6MobileNhtype,
@@ -14,7 +15,12 @@ from vpp_srv6_mobile import (
from scapy.contrib.gtp import *
from scapy.all import *
+import unittest
+
+@unittest.skipIf(
+ "srv6-mobile" in config.excluded_plugins, "Exclude srv6-mobile plugin tests"
+)
class TestSRv6EndMGTP4E(VppTestCase):
"""SRv6 End.M.GTP4.E (SRv6 -> GTP-U)"""
@@ -60,7 +66,7 @@ class TestSRv6EndMGTP4E(VppTestCase):
pkts = list()
for d, s in inner:
pkt = (
- Ether()
+ Ether(dst=self.pg0.local_mac)
/ IPv6(dst=str(ip6_dst), src=str(ip6_src))
/ IPv6ExtHdrSegmentRouting()
/ IPv6(dst=d, src=s)
@@ -108,6 +114,9 @@ class TestSRv6EndMGTP4E(VppTestCase):
self.assertEqual(pkt[GTP_U_Header].teid, 0xBBBBBBBB)
+@unittest.skipIf(
+ "srv6-mobile" in config.excluded_plugins, "Exclude srv6-mobile plugin tests"
+)
class TestSRv6TMGTP4D(VppTestCase):
"""SRv6 T.M.GTP4.D (GTP-U -> SRv6)"""
@@ -149,7 +158,7 @@ class TestSRv6TMGTP4D(VppTestCase):
pkts = list()
for d, s in inner:
pkt = (
- Ether()
+ Ether(dst=self.pg0.local_mac)
/ IP(dst=str(ip4_dst), src=str(ip4_src))
/ UDP(sport=2152, dport=2152)
/ GTP_U_Header(gtp_type="g_pdu", teid=200)
@@ -215,6 +224,9 @@ class TestSRv6TMGTP4D(VppTestCase):
)
+@unittest.skipIf(
+ "srv6-mobile" in config.excluded_plugins, "Exclude srv6-mobile plugin tests"
+)
class TestSRv6EndMGTP6E(VppTestCase):
"""SRv6 End.M.GTP6.E"""
@@ -254,7 +266,7 @@ class TestSRv6EndMGTP6E(VppTestCase):
pkts = list()
for d, s in inner:
pkt = (
- Ether()
+ Ether(dst=self.pg0.local_mac)
/ IPv6(dst=str(ip6_dst), src=str(ip6_src))
/ IPv6ExtHdrSegmentRouting(
segleft=1, lastentry=0, tag=0, addresses=["a1::1"]
@@ -306,6 +318,9 @@ class TestSRv6EndMGTP6E(VppTestCase):
self.assertEqual(pkt[GTP_U_Header].teid, 0xBBBBBBBB)
+@unittest.skipIf(
+ "srv6-mobile" in config.excluded_plugins, "Exclude srv6-mobile plugin tests"
+)
class TestSRv6EndMGTP6D(VppTestCase):
"""SRv6 End.M.GTP6.D"""
@@ -344,7 +359,7 @@ class TestSRv6EndMGTP6D(VppTestCase):
pkts = list()
for d, s in inner:
pkt = (
- Ether()
+ Ether(dst=self.pg0.local_mac)
/ IPv6(dst=str(ip6_dst), src=str(ip6_src))
/ UDP(sport=2152, dport=2152)
/ GTP_U_Header(gtp_type="g_pdu", teid=200)