mirror of
https://github.com/systemd/systemd.git
synced 2026-08-13 17:08:14 +00:00
test: add ServiceContext/Runtime enum and integration tests
Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user