diff --git a/test/vpp_qos.py b/test/vpp_qos.py
new file mode 100644
index 0000000..0577863
--- /dev/null
+++ b/test/vpp_qos.py
@@ -0,0 +1,110 @@
+"""
+  QoS
+
+  object abstractions for representing QoS config VPP
+"""
+
+from vpp_object import VppObject
+
+
+class VppQosRecord(VppObject):
+    """ QoS Record(ing) configuration """
+
+    def __init__(self, test, intf, source):
+        self._test = test
+        self.intf = intf
+        self.source = source
+
+    def add_vpp_config(self):
+        self._test.vapi.qos_record_enable_disable(
+            enable=1,
+            record={'sw_if_index': self.intf.sw_if_index,
+                    'input_source': self.source})
+        self._test.registry.register(self, self._test.logger)
+        return self
+
+    def remove_vpp_config(self):
+        self._test.vapi.qos_record_enable_disable(
+            enable=0,
+            record={'sw_if_index': self.intf.sw_if_index,
+                    'input_source': self.source})
+
+    def query_vpp_config(self):
+        rs = self._test.vapi.qos_record_dump()
+
+        for r in rs:
+            if self.intf.sw_if_index == r.record.sw_if_index and \
+               self.source == r.record.input_source:
+                return True
+        return False
+
+    def object_id(self):
+        return ("qos-record-%s-%d" % (self.intf, self.source))
+
+
+class VppQosEgressMap(VppObject):
+    """ QoS Egress Map(ping) configuration """
+
+    def __init__(self, test, id, rows):
+        self._test = test
+        self.id = id
+        self.rows = rows
+
+    def add_vpp_config(self):
+        self._test.vapi.qos_egress_map_update(
+            map={'id': self.id,
+                 'rows': self.rows})
+        self._test.registry.register(self, self._test.logger)
+        return self
+
+    def remove_vpp_config(self):
+        self._test.vapi.qos_egress_map_delete(id=self.id)
+
+    def query_vpp_config(self):
+        rs = self._test.vapi.qos_egress_map_dump()
+
+        for r in rs:
+            if self.id == r.map.id:
+                return True
+        return False
+
+    def object_id(self):
+        return ("qos-map-%d" % (self.id))
+
+
+class VppQosMark(VppObject):
+    """ QoS Mark(ing) configuration """
+
+    def __init__(self, test, intf, map, source):
+        self._test = test
+        self.intf = intf
+        self.source = source
+        self.map = map
+
+    def add_vpp_config(self):
+        self._test.vapi.qos_mark_enable_disable(
+            enable=1,
+            mark={'sw_if_index': self.intf.sw_if_index,
+                  'map_id': self.map.id,
+                  'output_source': self.source})
+        self._test.registry.register(self, self._test.logger)
+        return self
+
+    def remove_vpp_config(self):
+        self._test.vapi.qos_mark_enable_disable(
+            enable=0,
+            mark={'sw_if_index': self.intf.sw_if_index,
+                  'output_source': self.source})
+
+    def query_vpp_config(self):
+        ms = self._test.vapi.qos_mark_dump()
+
+        for m in ms:
+            if self.intf.sw_if_index == m.mark.sw_if_index and \
+               self.source == m.mark.output_source and \
+               self.map.id == m.mark.map_id:
+                return True
+        return False
+
+    def object_id(self):
+        return ("qos-mark-%s-%d" % (self.intf, self.source))
