Skip to content

Commit 879207a

Browse files
committed
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
1 parent 1878cc3 commit 879207a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

smoketest/scripts/cli/test_interfaces_ethernet.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ def test_ethtool_coalesce(self):
229229
msg = 'Driver does not fully support coalesce configuration'
230230
with self.assertRaisesRegex(ConfigSessionError, msg):
231231
self.cli_commit()
232+
# the failed commit leaves rx-usecs/tx-usecs staged in
233+
# the candidate config (commit() does not auto-rollback) -
234+
# discard it so it doesn't leak into the next interface
235+
self.cli_discard()
232236
continue
233237

234238
# To find out the supported features
@@ -300,6 +304,10 @@ def test_ethtool_flow_control(self):
300304
if not ethtool.check_flow_control():
301305
with self.assertRaises(ConfigSessionError):
302306
self.cli_commit()
307+
# the failed commit leaves disable-flow-control staged in
308+
# the candidate config (commit() does not auto-rollback) -
309+
# discard it so it doesn't leak into the next interface
310+
self.cli_discard()
303311
else:
304312
out, err = popen(f'sudo ethtool --json --show-pause {interface}')
305313
out = loads(out)

0 commit comments

Comments
 (0)