浏览代码

iotests/testrunner: fix recognition of python tests

We should drop final '\n' before comparing with python3 shebang.

Fixes: d74c754c924ca34e90b7c96ce2f5609d82c0e628
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210129090616.84145-1-vsementsov@virtuozzo.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Vladimir Sementsov-Ogievskiy 4 年之前
父节点
当前提交
9da4a314a0
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      tests/qemu-iotests/testrunner.py

+ 1 - 1
tests/qemu-iotests/testrunner.py

@@ -248,7 +248,7 @@ def do_run_test(self, test: str) -> TestResult:
 
 
         with f_test.open(encoding="utf-8") as f:
         with f_test.open(encoding="utf-8") as f:
             try:
             try:
-                if f.readline() == '#!/usr/bin/env python3':
+                if f.readline().rstrip() == '#!/usr/bin/env python3':
                     args.insert(0, self.env.python)
                     args.insert(0, self.env.python)
             except UnicodeDecodeError:  # binary test? for future.
             except UnicodeDecodeError:  # binary test? for future.
                 pass
                 pass