Tests for target startup monitoring Tests 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 setup Target 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}.target Test 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 started Description Starts the NSM dummy and the Node Startup Controller and verifies that it attempts to set the node state. Test commands systemctl start nsm-dummy.service systemctl start node-startup-controller.service Desired behaviour and output The DLT log should now contain the following log messages: APID CTID Payload NSMD NSMC [Applied the node state 2: yes] 2. Node state is set to LUC_RUNNING after focussed.target is started Description Starts the focussed.target systemd unit and verifies that it attempts to set the node state. Test commands systemctl start focussed.target systemctl start focussed.target systemctl 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: APID CTID Payload NSMD NSMC [Node state 3 applied: yes] 3. Node state is set to FULLY_RUNNING after unfocussed.target is started Description Starts the unfocussed.target systemd unit and verifies that it attempts to set the node state. Test commands systemctl start unfocussed.target systemctl start unfocussed.target Desired Behaviour and output The DLT log should now contain the following log messages: APID CTID Payload NSMD NSMC [Node state 4 applied: yes] 4. Node state is set to FULLY_OPERATIONAL after lazy.target is started Description Starts the lazy.target systemd unit and verifies that it attempts to set the node state. Test commands systemctl start lazy.target systemctl start lazy.target Desired behaviour and output The DLT log should now contain the following log messages: APID CTID Payload NSMD NSMC [Node state 5 applied: yes] 5. Stopping a target unit will not try to change the node state Description Stops a systemd unit and verifies that the Node Startup Controller doesn't try to set the node state. Test commands systemctl stop focussed.target Desired behaviour and output The DLT log should now contain the following log messages: APID CTID Payload NSC- 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: APID CTID Payload NSMD NSMC [Node state 3 applied: yes] or APID CTID Payload NSMD NSMC [Node state 3 applied: no]