]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
tests: xlate: Properly split input in replay mode
authorPhil Sutter <phil@nwl.cc>
Fri, 3 Feb 2023 17:48:33 +0000 (18:48 +0100)
committerPhil Sutter <phil@nwl.cc>
Fri, 17 Feb 2023 17:18:48 +0000 (18:18 +0100)
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 <phil@nwl.cc>
xlate-test.py

index 1b544600aa242436e4d57aaa6e16ddabcc5057a6..09e3b67a853df5f95c9af2dea3a84161640d9871 100755 (executable)
@@ -64,7 +64,7 @@ def test_one_replay(name, sourceline, expected, result):
     if sourceline.find(';') >= 0:
         sourceline, searchline = sourceline.split(';')
 
-    srcwords = sourceline.split()
+    srcwords = shlex.split(sourceline)
 
     srccmd = srcwords[0]
     ipt = srccmd.split('-')[0]