summaryrefslogtreecommitdiffstats
path: root/test/test_qos.py
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-07-31 02:48:02 -0700
committerNeale Ranns <nranns@cisco.com>2019-07-31 16:17:36 +0000
commit83832e7ced8be8b7de394415feaba70c32e3c38d (patch)
treeb9269e9f5cff694fa39cc26b5c25cb81828e1435 /test/test_qos.py
parentb504777e7f1c9728e65b874284b4dfd39359c8a8 (diff)
qos: Store function
Type: feature store: write a QoS value into the buffer meta-data record: Extract a QoS value from a packet header and store it. mark: Make a change to the content of a packet header by writing a stored QoS value Change-Id: I07d1e87dd1ca90d40ac1ae1774fee1b272cab83f Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'test/test_qos.py')
-rw-r--r--test/test_qos.py30
1 files changed, 28 insertions, 2 deletions
diff --git a/test/test_qos.py b/test/test_qos.py
index 9efa79854bf..149a9ebbe6e 100644
--- a/test/test_qos.py
+++ b/test/test_qos.py
@@ -15,7 +15,7 @@ from scapy.layers.inet import IP, UDP
from scapy.layers.inet6 import IPv6
from scapy.contrib.mpls import MPLS
from vpp_papi import VppEnum
-from vpp_qos import VppQosRecord, VppQosEgressMap, VppQosMark
+from vpp_qos import VppQosRecord, VppQosEgressMap, VppQosMark, VppQosStore
NUM_PKTS = 67
@@ -63,7 +63,7 @@ class TestQOS(VppTestCase):
super(TestQOS, self).tearDown()
def test_qos_ip(self):
- """ QoS Mark/Record IP """
+ """ QoS Mark/Record/Store IP """
#
# for table 1 map the n=0xff possible values of input QoS mark,
@@ -256,6 +256,32 @@ class TestQOS(VppTestCase):
self.assertEqual(p[IP].tos, 254)
#
+ # enable QoS stroe instead of record
+ #
+ qst1 = VppQosStore(self, self.pg0,
+ self.QOS_SOURCE.QOS_API_SOURCE_IP,
+ 5).add_vpp_config()
+ self.logger.info(self.vapi.cli("sh qos store"))
+
+ p_v4[IP].dst = self.pg1.remote_ip4
+ rx = self.send_and_expect(self.pg0, p_v4 * NUM_PKTS, self.pg1)
+ for p in rx:
+ self.assertEqual(p[IP].tos, 250)
+
+ #
+ # disable the input storing on pg0
+ #
+ self.assertTrue(qst1.query_vpp_config())
+ qst1.remove_vpp_config()
+
+ #
+ # back to an unchanged TOS value
+ #
+ rx = self.send_and_expect(self.pg0, p_v4 * NUM_PKTS, self.pg1)
+ for p in rx:
+ self.assertEqual(p[IP].tos, 254)
+
+ #
# disable the egress map on pg1 and pg4
#
qm1.remove_vpp_config()