diff --git a/src/test/test-varlink-idl-unit.c b/src/test/test-varlink-idl-unit.c index 7859f2d7359..51d5b9396f3 100644 --- a/src/test/test-varlink-idl-unit.c +++ b/src/test/test-varlink-idl-unit.c @@ -67,6 +67,14 @@ TEST(unit_enums_idl) { /* ServiceContext enums */ TEST_IDL_ENUM(ServiceType, service_type, vl_type_ServiceType); + TEST_IDL_ENUM(ServiceExitType, service_exit_type, vl_type_ServiceExitType); + TEST_IDL_ENUM(ServiceRestart, service_restart, vl_type_ServiceRestart); + TEST_IDL_ENUM(ServiceRestartMode, service_restart_mode, vl_type_ServiceRestartMode); + TEST_IDL_ENUM(ServiceTimeoutFailureMode, service_timeout_failure_mode, vl_type_ServiceTimeoutFailureMode); + + /* ServiceRuntime enums */ + TEST_IDL_ENUM(NotifyAccess, notify_access, vl_type_NotifyAccess); + TEST_IDL_ENUM(ServiceResult, service_result, vl_type_ServiceResult); /* PathContext enums */ TEST_IDL_ENUM(PathType, path_type, vl_type_PathType); diff --git a/test/units/TEST-74-AUX-UTILS.varlinkctl.sh b/test/units/TEST-74-AUX-UTILS.varlinkctl.sh index de56b37c315..bbc219decbf 100755 --- a/test/units/TEST-74-AUX-UTILS.varlinkctl.sh +++ b/test/units/TEST-74-AUX-UTILS.varlinkctl.sh @@ -252,6 +252,12 @@ test -n "$path_id" path_params=$(jq -cn --arg name "$path_id" '{name: $name}') varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Unit.List "$path_params" | jq -e '.context.Path' varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Unit.List "$path_params" | jq -e '.runtime.Path' +# test for ServiceContext/Runtime +service_id=$(varlinkctl call --collect /run/systemd/io.systemd.Manager io.systemd.Unit.List '{}' | jq -r '.[] | select(.context.Type == "service" and .runtime.LoadState == "loaded") .context.ID // empty' | tail -n 1) +test -n "$service_id" +service_params=$(jq -cn --arg name "$service_id" '{name: $name}') +varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Unit.List "$service_params" | jq -e '.context.Service' +varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Unit.List "$service_params" | jq -e '.runtime.Service' # test for ScopeContext/Runtime scope_id=$(varlinkctl call --collect /run/systemd/io.systemd.Manager io.systemd.Unit.List '{}' | jq -r '.[] | select(.context.Type == "scope" and .runtime.LoadState == "loaded") .context.ID // empty' | tail -n 1) test -n "$scope_id"