diff options
author | Christian Breunig <christian@breunig.cc> | 2024-12-17 20:12:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-17 20:12:12 +0100 |
commit | 31e71556f18308c85a1c0b0ef9f6f77b0ab83f7a (patch) | |
tree | 8b4b1c380fbdbd928ebe15c00e3de97ccca44b64 /smoketest/scripts | |
parent | 9ddd71832fd892ae591733b3c6e6e04f6f9bc2fb (diff) | |
parent | 99feb3bbe88a3ed96ec5d6dd741689f30a385693 (diff) | |
download | vyos-1x-31e71556f18308c85a1c0b0ef9f6f77b0ab83f7a.tar.gz vyos-1x-31e71556f18308c85a1c0b0ef9f6f77b0ab83f7a.zip |
Merge pull request #4175 from HollyGurza/T6800
T6799: QoS: Improve Priority-Queue Policy
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-x | smoketest/scripts/cli/test_qos.py | 76 |
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}' |