]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-execute: check for s390x first and duplicate test
authorLuca Boccassi <bluca@debian.org>
Sun, 7 Apr 2024 15:24:38 +0000 (16:24 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 7 Apr 2024 22:29:06 +0000 (07:29 +0900)
s390x will define both s390x and s390, so exec-personality-s390.service is ran
in both cases but fails on s390x, as the personality returned is s390x.
Split the test and check specifically for s390x.

src/test/test-execute.c
test/test-execute/exec-personality-s390x.service [new file with mode: 0644]

index e154901f13fac9d7ee17ac89bb3106a5edeb7046..e9b922b42ef34d5b8bb7d665a4b7701aac0aab76 100644 (file)
@@ -456,6 +456,9 @@ static void test_exec_personality(Manager *m) {
 #if defined(__x86_64__)
         test(m, "exec-personality-x86-64.service", 0, CLD_EXITED);
 
+#elif defined(__s390x__)
+        test(m, "exec-personality-s390x.service", 0, CLD_EXITED);
+
 #elif defined(__s390__)
         test(m, "exec-personality-s390.service", 0, CLD_EXITED);
 
diff --git a/test/test-execute/exec-personality-s390x.service b/test/test-execute/exec-personality-s390x.service
new file mode 100644 (file)
index 0000000..4545dee
--- /dev/null
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Description=Test for Personality=s390x
+
+[Service]
+ExecStart=sh -x -c 'c=$$(uname -m); test "$$c" = "s390x"'
+Type=oneshot
+Personality=s390x