From: Krzesimir Nowak Date: Wed, 28 Feb 2024 14:41:46 +0000 (+0100) Subject: test, sysext: Actually fail the whole operation if sd-merge worker failed X-Git-Tag: v256-rc1~405^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=baaa1679268a4ad05aeb037b028f2b5cdbff463f;p=thirdparty%2Fsystemd.git test, sysext: Actually fail the whole operation if sd-merge worker failed This also fixes a wrong merge failure check. --- diff --git a/src/sysext/sysext.c b/src/sysext/sysext.c index 57f06b26784..267c90f9764 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 d358b38354e..e2ab409c269 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" #