From 0cacac5fb51046d4f3b8b465797811393c72b283 Mon Sep 17 00:00:00 2001 From: Nataliia Solomko Date: Thu, 9 Jul 2026 14:27:47 +0300 Subject: sflow: T9065: Always set psample group even when egress sampling is disabled --- smoketest/scripts/cli/test_system_sflow.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'smoketest/scripts/cli') diff --git a/smoketest/scripts/cli/test_system_sflow.py b/smoketest/scripts/cli/test_system_sflow.py index c6606e116..05f5f43e7 100755 --- a/smoketest/scripts/cli/test_system_sflow.py +++ b/smoketest/scripts/cli/test_system_sflow.py @@ -151,5 +151,25 @@ class TestSystemFlowAccounting(VyOSUnitTestSHIM.TestCase): tmp = cmd(f'ip vrf pids {vrf}') self.assertIn(PROCESS_NAME, tmp) + def test_sflow_egress(self): + interface = 'eth0' + server = '192.0.2.254' + + self.cli_set(base_path + ['interface', interface]) + self.cli_set(base_path + ['server', server]) + self.cli_commit() + + # ingress sampling must work even without enable-egress configured + hsflowd = read_file(hsflowd_conf) + self.assertIn('psample { group=1 }', hsflowd) + + # enable-egress only appends "egress=on", it must not gate the group + self.cli_set(base_path + ['enable-egress']) + self.cli_commit() + + hsflowd = read_file(hsflowd_conf) + self.assertIn('psample { group=1 egress=on }', hsflowd) + + if __name__ == '__main__': unittest.main(verbosity=2, failfast=VyOSUnitTestSHIM.TestCase.debug_on()) -- cgit v1.2.3