systemd service agent
- https://github.com/troydhanson/uthash (header file only)
Initialization of the service agent requires a directory name to be provided. In this directory, the following files will be written:
-
/logs -- directory where log files will be written
-
svcagt_exclude_services.txt -- list of services to be excluded (one per line)
-
svcagt_goal_states.txt -- list of services that have been started or stopped by service agent -- and the state.
Two types of test can be run. The systemd tests invoke systemctl, and actually start and stop services. The pass-fail tests use a mock systemctl, so that code paths can be tested without actually invoking systemctl.
Before you can run the systemd tests, you need to run a setup script:
- cd .../service-agent-c/tests
- python setup_svcagt_services.py
The setup creates a mock_systemctl. It also creates and installs three test services for use with the systemd tests.
To run the systemd tests :
- cd .../service-agent-c/tests
- . start_systemd_test.sh
- In a separate terminal window, run test_svcagt
To run the pass-fail tests :
- cd .../service-agent-c/tests
- ../build/tests/test_svcagt