summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2012-08-02 15:20:51 +0100
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-08-02 16:17:42 +0100
commit1f86809e5b3613e6ab6e7700f968fb84d904e730 (patch)
treed8f835b55ab86fdc5c3124b56f2fcf477f916280
parent8436dc84b15abd4bf77842412681ab7ce975e81a (diff)
downloadnode-startup-controller-1f86809e5b3613e6ab6e7700f968fb84d904e730.tar.gz
Split test scenarios into separate pages, add legacy app skeleton
Each test scenario (i.e. luc, legacy app, tsm) has been split into a separate file. Setup steps which have to be performed for every scenario are moved into test-general-setup.xml Cross-references are used so that the test overview links to each test case, and the "Testing" page links to the general setup and also each test. test-example has been removed because it is no longer necessary.
-rw-r--r--docs/reference/node-startup-controller/node-startup-controller-docs.xml35
-rw-r--r--docs/reference/node-startup-controller/test-example.xml51
-rw-r--r--docs/reference/node-startup-controller/test-general-setup.xml62
-rw-r--r--docs/reference/node-startup-controller/test-luc.xml163
-rw-r--r--docs/reference/node-startup-controller/test-tsm.xml274
5 files changed, 286 insertions, 299 deletions
diff --git a/docs/reference/node-startup-controller/node-startup-controller-docs.xml b/docs/reference/node-startup-controller/node-startup-controller-docs.xml
index 91081e7..657cd77 100644
--- a/docs/reference/node-startup-controller/node-startup-controller-docs.xml
+++ b/docs/reference/node-startup-controller/node-startup-controller-docs.xml
@@ -75,35 +75,22 @@
<chapter>
<title>Building, Installing and Testing the Node Startup Controller</title>
- <sect1>
+ <section>
<title>Building</title>
- </sect1>
- <sect1>
+ </section>
+ <section>
<title>Installing</title>
- </sect1>
+ </section>
<section>
<title>Testing</title>
- <note>
- These tests are performed against the Node State Manager Dummy. The real
- Node State Manager behaves differently from the NSM dummy in the following ways:
- <itemizedlist>
- <listitem>
- When the NSM dummy receives a request to set the node state, it alternates
- between successfully setting the node state, and failing to set the node state.
- </listitem>
- <listitem>
- When the NSM dummy is queried as to whether the LUC is required, it alternates
- between saying no and yes.
- </listitem>
- <listitem>
- On receiving a SIGHUP, the NSM dummy will shut down all its fast shutdown
- clients, then all its normal shutdown clients.
- </listitem>
- </itemizedlist>
- </note>
- <xi:include href="test-example.xml"/>
- <xi:include href="test-tsm.xml"/>
+ <para><xref linkend="test-general-setup" /></para>
+ <para><xref linkend="test-luc" /></para>
+ <para><xref linkend="test-legacy-app" /></para>
+ <para><xref linkend="test-tsm" /></para>
+ <xi:include href="test-general-setup.xml"/>
<xi:include href="test-luc.xml"/>
+ <xi:include href="test-legacy-app.xml"/>
+ <xi:include href="test-tsm.xml"/>
</section>
</chapter>
diff --git a/docs/reference/node-startup-controller/test-example.xml b/docs/reference/node-startup-controller/test-example.xml
deleted file mode 100644
index dbd645f..0000000
--- a/docs/reference/node-startup-controller/test-example.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
- "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
-]>
-
-<section id="test-example">
- <title> Example test</title>
- <para>
- An example of how tests should be structured
- </para>
-
- <section>
- <title>Test environment and setup</title>
- <para>
- Automated testing isn't possible. To make things easier, we have code snippets which
- can be copied exactly, to get the required result.
- <programlisting>
- cp /lib/systemd/system/{graphical,focussed}.target
- systemctl start boot-manager.target
- </programlisting>
- </para>
- </section>
-
- <section>
- <title>Test Overview</title>
- <para>
- A broad explanation of the different test cases in the scenario, i.e.
- <itemizedlist>
- <listitem>Add a shutdown client</listitem>
- <listitem>Tell the shutdown client to shut down</listitem>
- </itemizedlist>
- </para>
- </section>
-
- <section>
- <title>Test steps</title>
- <para>
- Add a shutdown client
- <orderedlist>
- <listitem><programlisting>/usr/local/lib/boot-manager-1/legacy-app-handler -u cups.service -m 1</programlisting></listitem>
- <listitem>Check the DLT log for appropriate output</listitem>
- </orderedlist>
- Tell the shutdown client to shut down
- <orderedlist continuation="continues">
- <listitem><programlisting>kill -HUP $(pidof nsm-dummy)</programlisting></listitem>
- <listitem>Check the DLT log for appropriate output</listitem>
- </orderedlist>
- </para>
- </section>
-
-</section>
diff --git a/docs/reference/node-startup-controller/test-general-setup.xml b/docs/reference/node-startup-controller/test-general-setup.xml
new file mode 100644
index 0000000..6f7bd74
--- /dev/null
+++ b/docs/reference/node-startup-controller/test-general-setup.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+]>
+<refentry id="test-general-setup">
+ <refmeta>
+ <refentrytitle>General Setup</refentrytitle>
+ </refmeta>
+
+ <refnamediv>
+ <refname>general setup</refname>
+ <refpurpose>
+ Setup information that applies to all tests
+ </refpurpose>
+ </refnamediv>
+
+ <note>
+ These tests are performed against the Node State Manager Dummy. The real
+ Node State Manager behaves differently from the NSM dummy in the following ways:
+ <itemizedlist>
+ <listitem>
+ When the NSM dummy receives a request to set the node state, it alternates
+ between successfully setting the node state, and failing to set the node state.
+ </listitem>
+ <listitem>
+ When the NSM dummy is queried as to whether the LUC is required, it alternates
+ between saying no and yes.
+ </listitem>
+ <listitem>
+ On receiving a SIGHUP, the NSM dummy will shut down all its fast shutdown
+ clients, then all its normal shutdown clients.
+ </listitem>
+ </itemizedlist>
+ </note>
+
+ <refsection>
+ <title>Setting up DLT</title>
+ <para>
+ All tests use Diagnostic Log and Trace (DLT). It can be started and directed to a log
+ file by executing the following:
+ <programlisting>
+ dlt-daemon -d
+ dlt-receive -o /tmp/dlt.log localhost &amp;
+ </programlisting>
+ </para>
+ </refsection>
+
+ <refsection>
+ <title>Reading DLT log</title>
+ <para>
+ To read this log file, execute
+ <programlisting>dlt-convert -a /tmp/dlt.log</programlisting> This will display the
+ contents of the log file in the following format:
+ <programlisting>Index Time Timestamp Count Ecuid <emphasis role="bold">Apid Ctid</emphasis> Type Subtype Mode #Args <emphasis role="bold">Payload</emphasis></programlisting>
+ The fields we are interested in are the Apid (Application ID), Ctid (Context ID) and the Payload
+ For example:
+ <programlisting>12 2012/08/01 10:30:32.247913 17066086 006 ECU1 <emphasis role="bold">NSC- CTRL</emphasis> log info V 1 <emphasis role="bold">[Active state of unit "node-startup-controller.service" changed to active]</emphasis></programlisting>
+ </para>
+ </refsection>
+
+</refentry>
+
diff --git a/docs/reference/node-startup-controller/test-luc.xml b/docs/reference/node-startup-controller/test-luc.xml
index 6a7b765..e78896c 100644
--- a/docs/reference/node-startup-controller/test-luc.xml
+++ b/docs/reference/node-startup-controller/test-luc.xml
@@ -3,24 +3,30 @@
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
]>
-<section id="test-luc">
- <title>Last User Context handling</title>
- <para>
- Testing that the Node Startup Controller(NSC) correctly sets the Last User Context (LUC),
+<refentry id="test-luc">
+ <refmeta>
+ <refentrytitle>Last User Context handling</refentrytitle>
+ </refmeta>
+
+ <refnamediv>
+ <refname>luc handling</refname>
+ <refpurpose>
+ Testing that the Node Startup Controller(NSC) correctly sets the Last User Context (LUC),
and starts the apps correctly on NSC startup.
- </para>
+ </refpurpose>
+ </refnamediv>
- <section>
+ <refsection>
<title>Test environment and setup</title>
- <section>
+ <refsection>
<title>GDBus</title>
<para>
This test assumes that the <command>gdbus</command> programme is installed on the
system. Without this programme, this test is impossible.
</para>
- </section>
+ </refsection>
- <section>
+ <refsection>
<title>Helpful functions</title>
<para>
gdbus functions will be used frequently. To avoid excessive typing, the following
@@ -55,71 +61,35 @@
}
</programlisting>
</para>
- </section>
+ </refsection>
- <section>
- <title>Setting up DLT</title>
- <para>
- In addition, this test uses Diagnostic Log and Trace (DLT). It can be started and
- directed to a log file by executing the following:
- <programlisting>
- dlt-daemon -d
- dlt-receive -o /tmp/dlt.log localhost &amp;
- </programlisting>
- </para>
- </section>
+ </refsection>
- <section>
- <title>Reading DLT log</title>
- <para>
- To read this log file, execute
- <programlisting>dlt-convert -a /tmp/dlt.log</programlisting> This will display the
- contents of the log file in the following format:
- <programlisting>Index Time Timestamp Count Ecuid <emphasis role="bold">Apid Ctid</emphasis> Type Subtype Mode #Args <emphasis role="bold">Payload</emphasis></programlisting>
- The fields we are interested in are the Apid (Application ID), Ctid (Context ID) and the Payload
- For example:
- <programlisting>12 2012/08/01 10:30:32.247913 17066086 006 ECU1 <emphasis role="bold">NSC- CTRL</emphasis> log info V 1 <emphasis role="bold">[Active state of unit "node-startup-controller.service" changed to active]</emphasis></programlisting>
- </para>
- </section>
- </section>
-
- <section>
+ <refsection>
<title>Test Overview</title>
<para>
The following behaviours will be confirmed:
<itemizedlist>
- <listitem>
- Registration of a simple dictionary
- </listitem>
- <listitem>
- Registration does not happen on an isolated RegisterWithLUC() call
- </listitem>
- <listitem>
- An isolated FinishLUCRegistration() call will not change the LUC
- </listitem>
- <listitem>
- Registration of a complex dictionary
- </listitem>
- <listitem>
- Registration can happen with a series of RegisterWithLUC() calls
- </listitem>
- <listitem>
- Repeated registration of an app changes the order in the LUC
- </listitem>
+ <listitem><para><xref linkend="test-luc-register-simple" endterm="test-luc-register-simple-title" /></para></listitem>
+ <listitem><para><xref linkend="test-luc-register-only" endterm="test-luc-register-only-title" /></para></listitem>
+ <listitem><para><xref linkend="test-luc-finish-only" endterm="test-luc-finish-only-title" /></para></listitem>
+ <listitem><para><xref linkend="test-luc-register-complex" endterm="test-luc-register-complex-title" /></para></listitem>
+ <listitem><para><xref linkend="test-luc-register-series" endterm="test-luc-register-series-title" /></para></listitem>
+ <listitem><para><xref linkend="tests-luc-register-series-reorder" endterm="tests-luc-register-series-reorder-title" /></para></listitem>
</itemizedlist>
</para>
- </section>
+ </refsection>
- <section>
- <title>Test steps</title>
- <para>
+ <refsection>
+ <title>Test cases</title>
+ <refsection>
<orderedlist>
<listitem><programlisting>systemctl start nsm-dummy.service</programlisting></listitem>
<listitem><programlisting>systemctl start node-startup-controller.service</programlisting></listitem>
</orderedlist>
-
-
- Registration of a simple dictionary
+ </refsection>
+ <refsection id="test-luc-register-simple">
+ <title id="test-luc-register-simple-title">Registration of a simple dictionary</title>
<orderedlist continuation="continues">
<listitem><programlisting>begin</programlisting></listitem>
<listitem><programlisting>register "{0: ['app1.unit']}"</programlisting></listitem>
@@ -162,9 +132,9 @@
</tgroup></informaltable>
</listitem>
</orderedlist>
-
-
- Registration does not happen on an isolated RegisterWithLUC() call
+ </refsection>
+ <refsection id="test-luc-register-only">
+ <title id="test-luc-register-only-title">Registration does not happen on an isolated RegisterWithLUC() call</title>
<orderedlist continuation="continues">
<listitem><programlisting>register "{1: ['app2.unit']}"</programlisting></listitem>
<listitem>
@@ -179,9 +149,9 @@
</tgroup></informaltable>
</listitem>
</orderedlist>
-
-
- An isolated FinishLUCRegistration() call will not change the LUC
+ </refsection>
+ <refsection id="tests-luc-finish-only">
+ <title id="test-luc-finish-only-title">An isolated FinishLUCRegistration() call will not change the LUC</title>
<orderedlist continuation="continues">
<listitem><programlisting>end</programlisting></listitem>
<listitem><programlisting>systemctl restart node-startup-controller.service</programlisting></listitem>
@@ -198,9 +168,46 @@
</tgroup></informaltable>
</listitem>
</orderedlist>
-
-
- Registration of a complex dictionary
+ </refsection>
+ <refsection id="test-luc-register-complex">
+ <title id="test-luc-register-complex-title">Registration of a complex dictionary</title>
+ <orderedlist continuation="continues">
+ <listitem><programlisting>begin</programlisting></listitem>
+ <listitem><programlisting>register "{0: ['app1.unit'], 1: ['app1.unit', 'app3.unit'], 2: ['app2.unit']}"</programlisting></listitem>
+ <listitem><programlisting>end</programlisting></listitem>
+ <listitem>
+ Read the DLT log and verify these entries appear:
+ <informaltable><tgroup cols="3">
+ <thead>
+ <row> <entry>APID</entry> <entry>CTID</entry> <entry>Payload</entry> </row>
+ </thead>
+ <tbody>
+ <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[The new context is: "{0: ['app1.unit'], 1: ['app1.unit', 'app3.unit'], 2: ['app2.unit']}"]</entry></row>
+ </tbody>
+ </tgroup></informaltable>
+ </listitem>
+ <listitem><programlisting>systemctl restart node-startup-controller.service</programlisting></listitem>
+ <listitem>
+ Read the DLT log and verify these entries appear:
+ <informaltable><tgroup cols="3">
+ <thead>
+ <row> <entry>APID</entry> <entry>CTID</entry> <entry>Payload</entry> </row>
+ </thead>
+ <tbody>
+ <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[start group 0]</entry></row>
+ <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[start app 'app1.unit']</entry></row>
+ <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[start group 1]</entry></row>
+ <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[start app 'app1.unit']</entry></row>
+ <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[start app 'app3.unit']</entry></row>
+ <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[start group 2]</entry></row>
+ <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[start app 'app2.unit']</entry></row>
+ </tbody>
+ </tgroup></informaltable>
+ </listitem>
+ </orderedlist>
+ </refsection>
+ <refsection id="test-luc-register-series">
+ <title id="test-luc-register-series-title">Registration can happen with a series of RegisterWithLUC() calls</title>
<orderedlist continuation="continues">
<listitem><programlisting>begin</programlisting></listitem>
<listitem><programlisting>register "{0: ['app1.unit']}"</programlisting></listitem>
@@ -228,15 +235,15 @@
<tbody>
<row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[start group 0]</entry></row>
<row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[start app 'app1.unit']</entry></row>
- <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[start group 0]</entry></row>
+ <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[start group 1]</entry></row>
<row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[start app 'app3.unit']</entry></row>
</tbody>
</tgroup></informaltable>
</listitem>
</orderedlist>
-
-
- Repeated registration of an app changes the order in the LUC
+ </refsection>
+ <refsection id="tests-luc-register-series-reorder">
+ <title id="tests-luc-register-series-reorder-title">Repeated registration of an app changes the order in the LUC</title>
<orderedlist continuation="continues">
<listitem><programlisting>begin</programlisting></listitem>
<listitem><programlisting>register "{1: ['app1.unit', 'app2.unit']}"</programlisting></listitem>
@@ -269,9 +276,7 @@
</tbody>
</tgroup></informaltable>
</listitem>
-
</orderedlist>
- </para>
- </section>
-
-</section>
+ </refsection>
+ </refsection>
+</refentry>
diff --git a/docs/reference/node-startup-controller/test-tsm.xml b/docs/reference/node-startup-controller/test-tsm.xml
index 7b016bc..cbf3579 100644
--- a/docs/reference/node-startup-controller/test-tsm.xml
+++ b/docs/reference/node-startup-controller/test-tsm.xml
@@ -3,16 +3,22 @@
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
]>
-<section id="test-tsm">
- <title>Target Startup Monitor test</title>
- <para>
- Testing that the target startup monitor correctly identifies targets have started, and
- sets the Node State Manager's state accordingly.
- </para>
+<refentry id="test-tsm">
+ <refmeta>
+ <refentrytitle>Target Startup Monitor</refentrytitle>
+ </refmeta>
- <section>
+ <refnamediv>
+ <refname>Target Startup Monitor</refname>
+ <refpurpose>
+ Testing that the target startup monitor correctly identifies targets have started, and
+ sets the Node State Manager's state accordingly.
+ </refpurpose>
+ </refnamediv>
+
+ <refsection>
<title>Test environment and setup</title>
- <section>
+ <refsection>
<title>Target units</title>
<para>
This testing requires the existence of focussed.target, unfocussed.target and
@@ -25,156 +31,134 @@
cp /lib/systemd/system/{graphical,lazy}.target
</programlisting>
</para>
- </section>
- <section>
- <title>Setting up DLT</title>
- <para>
- In addition, this test uses Diagnostic Log and Trace (DLT). It can be started and
- directed to a log file by executing the following:
- <programlisting>
- dlt-daemon -d
- dlt-receive -o /tmp/dlt.log localhost &amp;
- </programlisting>
- </para>
- </section>
-
- <section>
- <title>Reading DLT log</title>
- <para>
- To read this log file, execute
- <programlisting>dlt-convert -a /tmp/dlt.log</programlisting> This will display the
- contents of the log file in the following format:
- <programlisting>Index Time Timestamp Count Ecuid <emphasis role="bold">Apid Ctid</emphasis> Type Subtype Mode #Args <emphasis role="bold">Payload</emphasis></programlisting>
- The fields we are interested in are the Apid (Application ID), Ctid (Context ID) and the Payload
- For example:
- <programlisting>12 2012/08/01 10:30:32.247913 17066086 006 ECU1 <emphasis role="bold">NSC- CTRL</emphasis> log info V 1 <emphasis role="bold">[Active state of unit "node-startup-controller.service" changed to active]</emphasis></programlisting>
- </para>
- </section>
- </section>
+ </refsection>
+ </refsection>
- <section>
+ <refsection>
<title>Test Overview</title>
<para>
The following behaviours will be confirmed:
<itemizedlist>
+ <listitem><para><xref linkend="test-tsm-start-nsc" endterm="test-tsm-start-nsc-title" /></para></listitem>
+ <listitem><para><xref linkend="test-tsm-start-focussed" endterm="test-tsm-start-focussed-title" /></para></listitem>
+ <listitem><para><xref linkend="test-tsm-start-unfocussed" endterm="test-tsm-start-unfocussed-title" /></para></listitem>
+ <listitem><para><xref linkend="test-tsm-start-lazy" endterm="test-tsm-start-lazy-title" /></para></listitem>
+ <listitem><para><xref linkend="test-tsm-stop" endterm="test-tsm-stop-title" /></para></listitem>
+ </itemizedlist>
+ </para>
+ </refsection>
+
+ <refsection>
+ <title>Test cases</title>
+ <refsection id="test-tsm-start-nsc">
+ <title id="test-tsm-start-nsc-title">Starting the Node Startup Controller tries to change the Node State</title>
+ <orderedlist>
+ <listitem><programlisting>systemctl start nsm-dummy.service</programlisting></listitem>
+ <listitem><programlisting>systemctl start node-startup-controller.service</programlisting></listitem>
<listitem>
- Starting the Node Startup Controller tries to change the Node State
+ Read the DLT log and verify these entries appear:
+ <informaltable><tgroup cols="3">
+ <thead>
+ <row> <entry>APID</entry> <entry>CTID</entry> <entry>Payload</entry> </row>
+ </thead>
+ <tbody>
+ <row> <entry>NSMD</entry> <entry>NSMC</entry> <entry>[Applied the node state 2: yes]</entry></row>
+ <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Active state of unit "node-startup-controller.service" changed to active]</entry></row>
+ </tbody>
+ </tgroup></informaltable>
</listitem>
+ </orderedlist>
+ </refsection>
+
+ <refsection id="test-tsm-start-focussed">
+ <title id="test-tsm-start-focussed-title">Starting focussed.target tries to change the node state</title>
+ <orderedlist continuation="continues">
+ <listitem><programlisting>systemctl start focussed.target</programlisting></listitem>
<listitem>
- Starting focussed.target tries to change the Node State
+ Read the DLT log and verify these entries appear:
+ <informaltable><tgroup cols="3">
+ <thead>
+ <row> <entry>APID</entry> <entry>CTID</entry> <entry>Payload</entry> </row>
+ </thead>
+ <tbody>
+ <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Creating D-Bus proxy for unit "/org/freedesktop/systemd1/unit/focussed_2etarget"]</entry></row>
+ <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Active state of unit "focussed.target" changed to active]</entry></row>
+ <row> <entry>NSMD</entry> <entry>NSMC</entry> <entry>[Applied the node state 3: no]</entry></row>
+ <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Failed to set the node state: error code 2]</entry></row>
+ </tbody>
+ </tgroup></informaltable>
</listitem>
+ </orderedlist>
+ </refsection>
+
+ <refsection id="test-tsm-start-unfocussed">
+ <title id="test-tsm-start-unfocussed-title">Starting unfocussed.target tries to change the node state</title>
+ <orderedlist continuation="continues">
+ <listitem><programlisting>systemctl start unfocussed.target</programlisting></listitem>
<listitem>
- Starting unfocussed.target tries to change the Node State
+ Read the DLT log and verify these entries appear:
+ <informaltable><tgroup cols="3">
+ <thead>
+ <row> <entry>APID</entry> <entry>CTID</entry> <entry>Payload</entry> </row>
+ </thead>
+ <tbody>
+ <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Creating D-Bus proxy for unit "/org/freedesktop/systemd1/unit/unfocussed_2etarget"]</entry></row>
+ <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Active state of unit "unfocussed.target" changed to active]</entry></row>
+ <row> <entry>NSMD</entry> <entry>NSMC</entry> <entry>[Applied the node state 4: yes]</entry></row>
+ </tbody>
+ </tgroup></informaltable>
</listitem>
+ </orderedlist>
+ </refsection>
+
+ <refsection id="test-tsm-start-lazy">
+ <title id="test-tsm-start-lazy-title">Starting lazy.target tries to change the node state</title>
+ <orderedlist continuation="continues">
+ <listitem><programlisting>systemctl start lazy.target</programlisting></listitem>
<listitem>
- Starting lazy.target tries to change the Node State
+ Read the DLT log and verify these entries appear:
+ <informaltable><tgroup cols="3">
+ <thead>
+ <row> <entry>APID</entry> <entry>CTID</entry> <entry>Payload</entry> </row>
+ </thead>
+ <tbody>
+ <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Creating D-Bus proxy for unit "/org/freedesktop/systemd1/unit/lazy_2etarget"]</entry></row>
+ <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Active state of unit "lazy.target" changed to active]</entry></row>
+ <row> <entry>NSMD</entry> <entry>NSMC</entry> <entry>[Applied the node state 5: no]</entry></row>
+ <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Failed to set the node state: error code 2]</entry></row>
+ </tbody>
+ </tgroup></informaltable>
</listitem>
+ </orderedlist>
+ </refsection>
+
+ <refsection id="test-tsm-stop">
+ <title id="test-tsm-stop-title">Stopping a target unit will not try to change the node state</title>
+ <orderedlist continuation="continues">
+ <listitem><programlisting>systemctl stop focussed.target</programlisting></listitem>
<listitem>
- Stopping a target unit will not try to change the Node State
+ Read the DLT log and verify that these entries appear:
+ <informaltable><tgroup cols="3">
+ <thead>
+ <row> <entry>APID</entry> <entry>CTID</entry> <entry>Payload</entry> </row>
+ </thead>
+ <tbody>
+ <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Creating D-Bus proxy for unit "/org/freedesktop/systemd1/unit/focussed_2etarget"]</entry></row>
+ <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Active state of unit "focussed.target" changed to inactive]</entry></row>
+ </tbody>
+ </tgroup></informaltable>
+ Verify that these entries do not appear:
+ <informaltable><tgroup cols="3">
+ <thead>
+ <row> <entry>APID</entry> <entry>CTID</entry> <entry>Payload</entry> </row>
+ </thead>
+ <tbody>
+ <row> <entry>NSMD</entry> <entry>NSMC</entry> <entry>[Applied the node state 3: yes]</entry></row>
+ </tbody>
+ </tgroup></informaltable>
</listitem>
- </itemizedlist>
- </para>
- </section>
-
- <section>
- <title>Test steps</title>
- <para>
- Starting the Node Startup Controller tries to change the Node State
- <orderedlist>
- <listitem><programlisting>systemctl start nsm-dummy.service</programlisting></listitem>
- <listitem><programlisting>systemctl start node-startup-controller.service</programlisting></listitem>
- <listitem>
- Read the DLT log and verify these entries appear:
- <informaltable><tgroup cols="3">
- <thead>
- <row> <entry>APID</entry> <entry>CTID</entry> <entry>Payload</entry> </row>
- </thead>
- <tbody>
- <row> <entry>NSMD</entry> <entry>NSMC</entry> <entry>[Applied the node state 2: yes]</entry></row>
- <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Active state of unit "node-startup-controller.service" changed to active]</entry></row>
- </tbody>
- </tgroup></informaltable>
- </listitem>
- </orderedlist>
- Starting focussed.target tries to change the node state
- <orderedlist continuation="continues">
- <listitem><programlisting>systemctl start focussed.target</programlisting></listitem>
- <listitem>
- Read the DLT log and verify these entries appear:
- <informaltable><tgroup cols="3">
- <thead>
- <row> <entry>APID</entry> <entry>CTID</entry> <entry>Payload</entry> </row>
- </thead>
- <tbody>
- <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Creating D-Bus proxy for unit "/org/freedesktop/systemd1/unit/focussed_2etarget"]</entry></row>
- <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Active state of unit "focussed.target" changed to active]</entry></row>
- <row> <entry>NSMD</entry> <entry>NSMC</entry> <entry>[Applied the node state 3: no]</entry></row>
- <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Failed to set the node state: error code 2]</entry></row>
- </tbody>
- </tgroup></informaltable>
- </listitem>
- </orderedlist>
- Starting unfocussed.target tries to change the node state
- <orderedlist continuation="continues">
- <listitem><programlisting>systemctl start unfocussed.target</programlisting></listitem>
- <listitem>
- Read the DLT log and verify these entries appear:
- <informaltable><tgroup cols="3">
- <thead>
- <row> <entry>APID</entry> <entry>CTID</entry> <entry>Payload</entry> </row>
- </thead>
- <tbody>
- <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Creating D-Bus proxy for unit "/org/freedesktop/systemd1/unit/unfocussed_2etarget"]</entry></row>
- <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Active state of unit "unfocussed.target" changed to active]</entry></row>
- <row> <entry>NSMD</entry> <entry>NSMC</entry> <entry>[Applied the node state 4: yes]</entry></row>
- </tbody>
- </tgroup></informaltable>
- </listitem>
- </orderedlist>
- Starting lazy.target tries to change the node state
- <orderedlist continuation="continues">
- <listitem><programlisting>systemctl start lazy.target</programlisting></listitem>
- <listitem>
- Read the DLT log and verify these entries appear:
- <informaltable><tgroup cols="3">
- <thead>
- <row> <entry>APID</entry> <entry>CTID</entry> <entry>Payload</entry> </row>
- </thead>
- <tbody>
- <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Creating D-Bus proxy for unit "/org/freedesktop/systemd1/unit/lazy_2etarget"]</entry></row>
- <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Active state of unit "lazy.target" changed to active]</entry></row>
- <row> <entry>NSMD</entry> <entry>NSMC</entry> <entry>[Applied the node state 5: no]</entry></row>
- <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Failed to set the node state: error code 2]</entry></row>
- </tbody>
- </tgroup></informaltable>
- </listitem>
- </orderedlist>
- Stopping a target unit will not try to change the node state
- <orderedlist continuation="continues">
- <listitem><programlisting>systemctl stop focussed.target</programlisting></listitem>
- <listitem>
- Read the DLT log and verify that these entries appear:
- <informaltable><tgroup cols="3">
- <thead>
- <row> <entry>APID</entry> <entry>CTID</entry> <entry>Payload</entry> </row>
- </thead>
- <tbody>
- <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Creating D-Bus proxy for unit "/org/freedesktop/systemd1/unit/focussed_2etarget"]</entry></row>
- <row> <entry>NSC-</entry> <entry>CTRL</entry> <entry>[Active state of unit "focussed.target" changed to inactive]</entry></row>
- </tbody>
- </tgroup></informaltable>
- Verify that these entries do not appear:
- <informaltable><tgroup cols="3">
- <thead>
- <row> <entry>APID</entry> <entry>CTID</entry> <entry>Payload</entry> </row>
- </thead>
- <tbody>
- <row> <entry>NSMD</entry> <entry>NSMC</entry> <entry>[Applied the node state 3: yes]</entry></row>
- </tbody>
- </tgroup></informaltable>
- </listitem>
- </orderedlist>
- </para>
- </section>
+ </orderedlist>
+ </refsection>
+ </refsection>
-</section>
+</refentry>