summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzesimir Nowak <knowak@microsoft.com>2024-02-28 15:41:46 +0100
committerKrzesimir Nowak <knowak@microsoft.com>2024-03-25 08:33:22 +0100
commitbaaa1679268a4ad05aeb037b028f2b5cdbff463f (patch)
tree18a425282e8dcb5f8654476ecd1f805de14ce952
parenttest: Add test cases for sysext ephemeral-import mode (diff)
downloadsystemd-baaa1679268a4ad05aeb037b028f2b5cdbff463f.tar.xz
systemd-baaa1679268a4ad05aeb037b028f2b5cdbff463f.zip
test, sysext: Actually fail the whole operation if sd-merge worker failed
This also fixes a wrong merge failure check.
-rw-r--r--src/sysext/sysext.c3
-rwxr-xr-xtest/units/testsuite-50.sh2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/sysext/sysext.c b/src/sysext/sysext.c
index 57f06b2678..267c90f976 100644
--- a/src/sysext/sysext.c
+++ b/src/sysext/sysext.c
@@ -1742,9 +1742,10 @@ static int merge(ImageClass image_class,
r = wait_for_terminate_and_check("(sd-merge)", pid, WAIT_LOG_ABNORMAL);
if (r < 0)
return r;
-
if (r == 123) /* exit code 123 means: didn't do anything */
return 0;
+ if (r > 0)
+ return log_error_errno(SYNTHETIC_ERRNO(ENXIO), "Failed to merge hierarchies");
r = need_reload(image_class, hierarchies, no_reload);
if (r < 0)
diff --git a/test/units/testsuite-50.sh b/test/units/testsuite-50.sh
index d358b38354..e2ab409c26 100755
--- a/test/units/testsuite-50.sh
+++ b/test/units/testsuite-50.sh
@@ -1323,7 +1323,7 @@ ln -sfTr "${real_ext_dir}" "${ext_data_path}"
prep_ro_hierarchy "${fake_root}" "${hierarchy}"
# run systemd-sysext
-SYSTEMD_SYSEXT_HIERARCHIES="${hierarchy}" systemd-sysext --root="${fake_root}" --mutable=auto merge || die "expected merge to fail"
+SYSTEMD_SYSEXT_HIERARCHIES="${hierarchy}" systemd-sysext --root="${fake_root}" --mutable=auto merge && die "expected merge to fail"
#