summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorkhramshinr <khramshinr@gmail.com>2024-11-11 10:04:15 +0800
committerkhramshinr <khramshinr@gmail.com>2024-12-11 09:32:37 +0800
commit99feb3bbe88a3ed96ec5d6dd741689f30a385693 (patch)
treee4ac6beba05a46656bdace0e75070e04c213a771 /smoketest
parent3ed6f02a66fd9d02a4cc3c45b2605cb3d8ad0d2e (diff)
downloadvyos-1x-99feb3bbe88a3ed96ec5d6dd741689f30a385693.tar.gz
vyos-1x-99feb3bbe88a3ed96ec5d6dd741689f30a385693.zip
T6790: QoS: Improve CAKE Policy
- Fixed handling of flow isolation parameters. - Corrected support for `nat` and `nonat` in flow isolation. - Extended RTT values to cover the full range supported by `tc`.
Diffstat (limited to 'smoketest')
-rwxr-xr-xsmoketest/scripts/cli/test_qos.py76
1 files changed, 76 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_qos.py b/smoketest/scripts/cli/test_qos.py
index 79b791288..7714cd3e0 100755
--- a/smoketest/scripts/cli/test_qos.py
+++ b/smoketest/scripts/cli/test_qos.py
@@ -27,6 +27,7 @@ from vyos.utils.process import cmd
base_path = ['qos']
+
def get_tc_qdisc_json(interface, all=False) -> dict:
tmp = cmd(f'tc -detail -json qdisc show dev {interface}')
tmp = loads(tmp)
@@ -934,6 +935,81 @@ class TestQoS(VyOSUnitTestSHIM.TestCase):
self.assertEqual(nat, tmp['options']['nat'])
nat = not nat
+ def test_18_priority_queue_default(self):
+ interface = self._interfaces[0]
+ policy_name = f'qos-policy-{interface}'
+
+ self.cli_set(base_path + ['interface', interface, 'egress', policy_name])
+ self.cli_set(
+ base_path
+ + ['policy', 'priority-queue', policy_name, 'description', 'default policy']
+ )
+
+ self.cli_commit()
+
+ tmp = get_tc_qdisc_json(interface, all=True)
+
+ self.assertEqual(2, len(tmp))
+ self.assertEqual('prio', tmp[0]['kind'])
+ self.assertDictEqual(
+ {
+ 'bands': 2,
+ 'priomap': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+ 'multiqueue': False,
+ },
+ tmp[0]['options'],
+ )
+ self.assertEqual('pfifo', tmp[1]['kind'])
+ self.assertDictEqual({'limit': 1000}, tmp[1]['options'])
+
+ def test_19_priority_queue_default_random_detect(self):
+ interface = self._interfaces[0]
+ policy_name = f'qos-policy-{interface}'
+
+ self.cli_set(base_path + ['interface', interface, 'egress', policy_name])
+ self.cli_set(
+ base_path
+ + [
+ 'policy',
+ 'priority-queue',
+ policy_name,
+ 'default',
+ 'queue-type',
+ 'random-detect',
+ ]
+ )
+
+ self.cli_commit()
+
+ tmp = get_tc_qdisc_json(interface, all=True)
+
+ self.assertEqual(2, len(tmp))
+ self.assertEqual('prio', tmp[0]['kind'])
+ self.assertDictEqual(
+ {
+ 'bands': 2,
+ 'priomap': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+ 'multiqueue': False,
+ },
+ tmp[0]['options'],
+ )
+ self.assertEqual('red', tmp[1]['kind'])
+ self.assertDictEqual(
+ {
+ 'limit': 73728,
+ 'min': 9216,
+ 'max': 18432,
+ 'ecn': False,
+ 'harddrop': False,
+ 'adaptive': False,
+ 'nodrop': False,
+ 'ewma': 3,
+ 'probability': 0.1,
+ 'Scell_log': 13,
+ },
+ tmp[1]['options'],
+ )
+
def test_20_round_robin_policy_default(self):
interface = self._interfaces[0]
policy_name = f'qos-policy-{interface}'