summaryrefslogtreecommitdiffstats
path: root/test/vpp_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/vpp_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/vpp_qos.py')
-rw-r--r--test/vpp_qos.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/vpp_qos.py b/test/vpp_qos.py
index 0577863ef8c..a7fa9e748aa 100644
--- a/test/vpp_qos.py
+++ b/test/vpp_qos.py
@@ -42,6 +42,44 @@ class VppQosRecord(VppObject):
return ("qos-record-%s-%d" % (self.intf, self.source))
+class VppQosStore(VppObject):
+ """ QoS Store(ing) configuration """
+
+ def __init__(self, test, intf, source, value):
+ self._test = test
+ self.intf = intf
+ self.source = source
+ self.value = value
+
+ def add_vpp_config(self):
+ self._test.vapi.qos_store_enable_disable(
+ enable=1,
+ store={'sw_if_index': self.intf.sw_if_index,
+ 'input_source': self.source,
+ 'value': self.value})
+ self._test.registry.register(self, self._test.logger)
+ return self
+
+ def remove_vpp_config(self):
+ self._test.vapi.qos_store_enable_disable(
+ enable=0,
+ store={'sw_if_index': self.intf.sw_if_index,
+ 'input_source': self.source})
+
+ def query_vpp_config(self):
+ rs = self._test.vapi.qos_store_dump()
+
+ for r in rs:
+ if self.intf.sw_if_index == r.store.sw_if_index and \
+ self.source == r.store.input_source and \
+ self.value == r.store.value:
+ return True
+ return False
+
+ def object_id(self):
+ return ("qos-store-%s-%d" % (self.intf, self.source))
+
+
class VppQosEgressMap(VppObject):
""" QoS Egress Map(ping) configuration """
amespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * ------------------------------------------------------------------
 * vl_memory_api_h.h - memory API headers, in a specific order.
 *
 * Copyright (c) 2009-2010 Cisco and/or its affiliates. Licensed under the
 * Apache License, Version 2.0 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of the
 * License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 * ------------------------------------------------------------------
 */

/*
 * Add to the bottom of the #include list, or elves will steal your keyboard
 * in the middle of the night!
 *
 * Include current layer (2) last, or an artistic disagreement about message
 * numbering will occur
 */

#ifndef included_from_layer_3
#include <vlibmemory/vl_memory_api_h.h>
#endif /* included_from_layer_3 */

#ifdef vl_printfun
#include <vnet/format_fns.h>
#endif

#include <vnet/bonding/bond.api.h>
#include <vnet/devices/af_packet/af_packet.api.h>
#include <vnet/devices/virtio/vhost_user.api.h>
#include <vnet/devices/tap/tapv2.api.h>
#include <vnet/interface.api.h>
#include <vnet/l2/l2.api.h>
#include <vnet/span/span.api.h>
#include <vnet/ip/ip.api.h>
#include <vnet/bfd/bfd.api.h>
#include <vnet/ipsec/ipsec.api.h>
#include <vnet/session/session.api.h>
#include <vnet/mpls/mpls.api.h>
#include <vnet/srv6/sr.api.h>
#include <vnet/srmpls/sr_mpls.api.h>
#include <vnet/policer/policer.api.h>
#include <vnet/ethernet/p2p_ethernet.api.h>
#include <vnet/tcp/tcp.api.h>
#include <vnet/udp/udp.api.h>
#include <vnet/ip/punt.api.h>
#include <vnet/feature/feature.api.h>
#include <vnet/qos/qos.api.h>
#include <vnet/devices/pipe/pipe.api.h>
#include <vnet/syslog/syslog.api.h>
#include <vnet/devices/virtio/virtio.api.h>

/*
 * fd.io coding-style-patch-verification: ON
 *
 * Local Variables: eval: (c-set-style "gnu") End:
 */