mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-27 10:25:06 +03:00
test-execute: check exit code before exit status
The meaning of the status changes depending on the code, hence let's always compare the code first, status second.
This commit is contained in:
parent
727a1a0607
commit
18f8c5d466
@ -62,18 +62,20 @@ static void check(const char *func, Manager *m, Unit *unit, int status_expected,
|
||||
}
|
||||
}
|
||||
exec_status_dump(&service->main_exec_status, stdout, "\t");
|
||||
if (service->main_exec_status.status != status_expected) {
|
||||
log_error("%s: %s: exit status %d, expected %d",
|
||||
func, unit->id,
|
||||
service->main_exec_status.status, status_expected);
|
||||
abort();
|
||||
}
|
||||
|
||||
if (service->main_exec_status.code != code_expected) {
|
||||
log_error("%s: %s: exit code %d, expected %d",
|
||||
func, unit->id,
|
||||
service->main_exec_status.code, code_expected);
|
||||
abort();
|
||||
}
|
||||
|
||||
if (service->main_exec_status.status != status_expected) {
|
||||
log_error("%s: %s: exit status %d, expected %d",
|
||||
func, unit->id,
|
||||
service->main_exec_status.status, status_expected);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
static bool check_nobody_user_and_group(void) {
|
||||
|
Loading…
Reference in New Issue
Block a user