diff options
author | Christian Breunig <christian@breunig.cc> | 2024-11-15 20:16:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-15 20:16:59 +0100 |
commit | 89a7e176c1d30a6862976d8b72dc4e7bc0ad5c85 (patch) | |
tree | 389ae388088ee1111dd24b095f36e8e2dfb54bca /smoketest/scripts | |
parent | ab470796af602e14af9a6014d0c1b854a6049976 (diff) | |
parent | e6558a535594c1cd25133979f07663cf6958ce75 (diff) | |
download | vyos-1x-89a7e176c1d30a6862976d8b72dc4e7bc0ad5c85.tar.gz vyos-1x-89a7e176c1d30a6862976d8b72dc4e7bc0ad5c85.zip |
Merge pull request #4191 from HollyGurza/T6801
T6801: QoS: Policy rate-control is broken by default
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-x | smoketest/scripts/cli/test_qos.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_qos.py b/smoketest/scripts/cli/test_qos.py index 77d384024..aaeebcdae 100755 --- a/smoketest/scripts/cli/test_qos.py +++ b/smoketest/scripts/cli/test_qos.py @@ -922,6 +922,27 @@ class TestQoS(VyOSUnitTestSHIM.TestCase): tmp[2]['options'], ) + def test_22_rate_control_default(self): + interface = self._interfaces[0] + policy_name = f'qos-policy-{interface}' + bandwidth = 5000 + + self.cli_set(base_path + ['interface', interface, 'egress', policy_name]) + self.cli_set(base_path + ['policy', 'rate-control', policy_name]) + with self.assertRaises(ConfigSessionError): + # Bandwidth not defined + self.cli_commit() + + self.cli_set(base_path + ['policy', 'rate-control', policy_name, 'bandwidth', str(bandwidth)]) + # commit changes + self.cli_commit() + + tmp = get_tc_qdisc_json(interface) + + self.assertEqual('tbf', tmp['kind']) + # TC store rates as a 32-bit unsigned integer in bps (Bytes per second) + self.assertEqual(int(bandwidth * 125), tmp['options']['rate']) + if __name__ == '__main__': unittest.main(verbosity=2) |