]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-systemd-tmpfiles: skip on python3.4
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 2 Dec 2017 13:00:58 +0000 (14:00 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 6 Dec 2017 09:30:26 +0000 (10:30 +0100)
python3.4 is used by our CI.
Let's revert this when we stop supporting python < 3.5.

src/test/test-systemd-tmpfiles.py

index b73368ddef211fa75993b67e83f7af51197fba7e..1368839381cd59e2067fc2252479459b68422af7 100755 (executable)
@@ -21,15 +21,21 @@ except ImportError:
     id128 = None
 
 EX_DATAERR = 65 # from sysexits.h
+EXIT_TEST_SKIP = 77
+
+try:
+    subprocess.run
+except AttributeError:
+    sys.exit(EXIT_TEST_SKIP)
 
 exe = sys.argv[1]
 
 def test_line(line, *, user, returncode=EX_DATAERR, extra={}):
     args = ['--user'] if user else []
     print('Running {} {} on {!r}'.format(exe, ' '.join(args), line))
-    c = subprocess.run([exe, '--create', *args, '-'],
-                       **extra,
-                       input=line, stdout=subprocess.PIPE, universal_newlines=True)
+    c = subprocess.run([exe, '--create', '-'] + args,
+                       input=line, stdout=subprocess.PIPE, universal_newlines=True,
+                       **extra)
     assert c.returncode == returncode, c
 
 def test_invalids(*, user):