Tests for target startup monitoringTests for target startup monitoring
How to verify that the target startup monitoring functionality of the
NSC correctly identifies targets have started, and sets the node state
accordingly via the NSM.
Test environment and setupTarget units
This testing requires the existence of focussed.target, unfocussed.target and
lazy.target units.
If they do not exist, they can be created by executing the following:
cp /lib/systemd/system/{graphical,focussed}.target
cp /lib/systemd/system/{graphical,unfocussed}.target
cp /lib/systemd/system/{graphical,lazy}.targetTest cases
The node state is defined by the NSMNodeState
enumeration. When the node state is set, the DLT log refers to it by its number.
The following test cases for Target Startup Monitoring are described in this document:
1. Node state is set to BASE_RUNNING after Node Startup Controller is startedDescription
Starts the NSM dummy and the Node Startup Controller and verifies that it attempts
to set the node state.
Test commandssystemctl start nsm-dummy.service
systemctl start node-startup-controller.serviceDesired behaviour and output
The DLT log should now contain the following log messages:
APIDCTIDPayloadNSMDNSMC[Applied the node state 2: yes]2. Node state is set to LUC_RUNNING after focussed.target is startedDescription
Starts the focussed.target systemd unit and verifies that it attempts to set the
node state.
Test commandssystemctl start focussed.target
systemctl start focussed.targetsystemctl start focussed.target is called twice because the NSM
dummy rejects every other call to set the node state.
Desired behaviour and output
The DLT log should now contain the following log messages:
APIDCTIDPayloadNSMDNSMC[Node state 3 applied: yes]3. Node state is set to FULLY_RUNNING after unfocussed.target is startedDescription
Starts the unfocussed.target systemd unit and verifies that it attempts to set the
node state.
Test commandssystemctl start unfocussed.target
systemctl start unfocussed.targetDesired Behaviour and output
The DLT log should now contain the following log messages:
APIDCTIDPayloadNSMDNSMC[Node state 4 applied: yes]4. Node state is set to FULLY_OPERATIONAL after lazy.target is startedDescription
Starts the lazy.target systemd unit and verifies that it attempts to set the
node state.
Test commandssystemctl start lazy.target
systemctl start lazy.targetDesired behaviour and output
The DLT log should now contain the following log messages:
APIDCTIDPayloadNSMDNSMC[Node state 5 applied: yes]5. Stopping a target unit will not try to change the node stateDescription
Stops a systemd unit and verifies that the Node Startup Controller doesn't try to
set the node state.
Test commandssystemctl stop focussed.targetDesired behaviour and output
The DLT log should now contain the following log messages:
APIDCTIDPayloadNSC-CTRL[Creating D-Bus proxy for unit "/org/freedesktop/systemd1/unit/focussed_2etarget"]NSC-CTRL[Active state of unit "focussed.target" changed to inactive]
The DLT log should not contain the following log message:
APIDCTIDPayloadNSMDNSMC[Node state 3 applied: yes]
or
APIDCTIDPayloadNSMDNSMC[Node state 3 applied: no]