summaryrefslogtreecommitdiffstats
path: root/test/vpp_policer.py
diff options
context:
space:
mode:
authorStanislav Zaikin <zstaseg@gmail.com>2022-04-05 19:23:12 +0200
committerNeale Ranns <neale@graphiant.com>2022-05-05 00:19:12 +0000
commite5a3ae0179b807efc2202a47e11d698396dd0780 (patch)
tree15883a9f368705fab0128693c6ed4dd6fb475e3c /test/vpp_policer.py
parent0ec1c6dc68570b8b824ff55205b4b133bffbf9e4 (diff)
policer: output interface policer
Type: improvement Change-Id: Ibc1b5059ed51c34334340534e9eb68121f556bce Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
Diffstat (limited to 'test/vpp_policer.py')
-rw-r--r--test/vpp_policer.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/test/vpp_policer.py b/test/vpp_policer.py
index 2c47eed75fd..0f3b073d6e3 100644
--- a/test/vpp_policer.py
+++ b/test/vpp_policer.py
@@ -1,5 +1,11 @@
from vpp_object import VppObject
from vpp_ip import INVALID_INDEX
+from enum import Enum
+
+
+class Dir(Enum):
+ RX = 0
+ TX = 1
class PolicerAction():
@@ -61,9 +67,13 @@ class VppPolicer(VppObject):
self._test.vapi.policer_bind(name=self.name, worker_index=worker,
bind_enable=bind)
- def apply_vpp_config(self, if_index, apply):
- self._test.vapi.policer_input(name=self.name, sw_if_index=if_index,
- apply=apply)
+ def apply_vpp_config(self, if_index, dir: Dir, apply):
+ if dir == Dir.RX:
+ self._test.vapi.policer_input(
+ name=self.name, sw_if_index=if_index, apply=apply)
+ else:
+ self._test.vapi.policer_output(
+ name=self.name, sw_if_index=if_index, apply=apply)
def query_vpp_config(self):
dump = self._test.vapi.policer_dump(