tests: xlate: Properly split input in replay mode
Phil Sutter
reviewerPATCH 1/2 tests: xlate: Properly split input in replay mode
Source command may contain quotes, using shlex.split() does the right thing there.
Fixes 7705b2daa3bdc ("tests: xlate: Use --check to verify replay")
Signed-off-by Phil Sutter <[email protected]>
--- xlate-test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xlate-test.py +1 -1
@@ -64,7 +64,7 @@ xtables_nft_multi = 'xtables-nft-multi' if sourceline.find(';') >= 0: sourceline, searchline = sourceline.split(';') - srcwords = sourceline.split() + srcwords = shlex.split(sourceline) srccmd = srcwords[0] ipt = srccmd.split('-')[0]
Signature · 1 line
2.38.0
Phil Sutter
reviewerPATCH 2/2 tests: xlate: Print file names even if specified
Since the script now supports running for multiple files given on command line, do not skip printing a status line for each.
Signed-off-by Phil Sutter <[email protected]>
--- xlate-test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xlate-test.py +1 -1
@@ -176,7 +176,7 @@ xtables_nft_multi = 'xtables-nft-multi' result.append(name + ": " + red("Fail")) result.append("nft flush ruleset call failed: " + error) - if (passed == tests) and not args.test: + if (passed == tests): print(name + ": " + green("OK")) if not test_passed: print("\n".join(result), file=sys.stderr)
Signature · 1 line
2.38.0
Phil Sutter
reviewerQuoted 5 lines · Phil Sutter
Source command may contain quotes, using
shlex.split()does the right thing there.Fixes 7705b2daa3bdc ("tests: xlate: Use --check to verify replay")Signed-off-by Phil Sutter <[email protected]>
Series also applied.