summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2026-08-06 16:26:53 +0100
committerGitHub <noreply@github.com>2026-08-06 16:26:53 +0100
commit4d3364766852ed0dcc636629545cbdb56fc2b5e1 (patch)
tree8d4863b0e9d7512b08cf77e82d8b3947e52a29f4 /smoketest/scripts/cli
parent2b382c4a3b1a7b91473d771533c1689d3aceb304 (diff)
parent0cacac5fb51046d4f3b8b465797811393c72b283 (diff)
downloadvyos-1x-4d3364766852ed0dcc636629545cbdb56fc2b5e1.tar.gz
vyos-1x-4d3364766852ed0dcc636629545cbdb56fc2b5e1.zip
Merge pull request #5320 from natali-rs1985/T9065
sflow: T9065: Always set psample group even when egress sampling is disabled
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-xsmoketest/scripts/cli/test_system_sflow.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_system_sflow.py b/smoketest/scripts/cli/test_system_sflow.py
index 5a7b342e6..2fb317af0 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 = cmdl(['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())