From 02471a8b893b699c7e5ba49a20beb239c52b7226 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Thu, 6 Aug 2026 21:59:21 +0200 Subject: ethtool: T3871: honor the unsupported-driver denylist for flow-control too Flow-control commits failed intermittently on virtio_net and similar paravirtualized drivers: they support reading pause parameters but not setting them, and that mismatch varies across kernel/QEMU versions. The existing denylist for this already covered speed/duplex changes and its name implied flow-control too, but nothing actually consulted it there - the check relied solely on a live probe. The paired smoketest branched on that same raw probe instead of the fixed capability check, so it missed the same drivers. Assisted-by: Claude:claude-sonnet-5 --- smoketest/scripts/cli/test_interfaces_ethernet.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'smoketest/scripts/cli') diff --git a/smoketest/scripts/cli/test_interfaces_ethernet.py b/smoketest/scripts/cli/test_interfaces_ethernet.py index 6f290c7fe..39b7c5195 100755 --- a/smoketest/scripts/cli/test_interfaces_ethernet.py +++ b/smoketest/scripts/cli/test_interfaces_ethernet.py @@ -287,17 +287,21 @@ class EthernetInterfaceTest(BasicInterfaceTest.TestCase): def test_ethtool_flow_control(self): for interface in self._interfaces: + ethtool = Ethtool(interface) # Disable flow-control self.cli_set(self._base_path + [interface, 'disable-flow-control']) - # Check current flow-control state on ethernet interface - out, err = popen(f'sudo ethtool --json --show-pause {interface}') - # Flow-control not supported - test if it bails out with a proper - # this is a dynamic path where err = 1 on VMware, but err = 0 on - # a physical box. - if bool(err): + + # Ask the same capability check the CLI commit itself uses, + # rather than a raw ethtool --show-pause probe: some drivers + # (virtio_net, vmxnet3, xen_netfront, ...) support querying + # pause parameters but not changing them, so a bare --show-pause + # exit code is not a reliable predictor of whether the commit + # will succeed. + if not ethtool.check_flow_control(): with self.assertRaises(ConfigSessionError): self.cli_commit() else: + out, err = popen(f'sudo ethtool --json --show-pause {interface}') out = loads(out) # Flow control is on self.assertTrue(out[0]['autonegotiate']) -- cgit v1.2.3 From 3c7aa6d76c4de62f27a0493baefe8e10044c9f9d Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Thu, 6 Aug 2026 21:59:21 +0200 Subject: smoketest: T3871: discard staged changes after an expected commit failure Two ethtool test cases intentionally trigger a commit failure for an unsupported driver, then move on to the next interface in the same loop. Commit does not auto-rollback on failure and the session is shared across the loop, so the failed change stayed staged and could silently carry into the next interface's commit - failing an otherwise passing interface if it followed an unsupported one. Discard the candidate configuration right after each expected failure, matching the pattern already used elsewhere in the suite. Assisted-by: Claude:claude-sonnet-5 --- smoketest/scripts/cli/test_interfaces_ethernet.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'smoketest/scripts/cli') diff --git a/smoketest/scripts/cli/test_interfaces_ethernet.py b/smoketest/scripts/cli/test_interfaces_ethernet.py index 39b7c5195..086eed338 100755 --- a/smoketest/scripts/cli/test_interfaces_ethernet.py +++ b/smoketest/scripts/cli/test_interfaces_ethernet.py @@ -229,6 +229,10 @@ class EthernetInterfaceTest(BasicInterfaceTest.TestCase): msg = 'Driver does not fully support coalesce configuration' with self.assertRaisesRegex(ConfigSessionError, msg): self.cli_commit() + # the failed commit leaves rx-usecs/tx-usecs staged in + # the candidate config (commit() does not auto-rollback) - + # discard it so it doesn't leak into the next interface + self.cli_discard() continue # To find out the supported features @@ -300,6 +304,10 @@ class EthernetInterfaceTest(BasicInterfaceTest.TestCase): if not ethtool.check_flow_control(): with self.assertRaises(ConfigSessionError): self.cli_commit() + # the failed commit leaves disable-flow-control staged in + # the candidate config (commit() does not auto-rollback) - + # discard it so it doesn't leak into the next interface + self.cli_discard() else: out, err = popen(f'sudo ethtool --json --show-pause {interface}') out = loads(out) -- cgit v1.2.3