diff options
author | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2012-08-02 09:44:33 +0100 |
---|---|---|
committer | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-08-02 16:17:42 +0100 |
commit | 8436dc84b15abd4bf77842412681ab7ce975e81a (patch) | |
tree | 4ef0b09565b36ec10025b312927498a5d46138a4 | |
parent | 01149c2a14e5b96ec0f40d8570f3b557fc7c0e3c (diff) | |
download | node-startup-controller-8436dc84b15abd4bf77842412681ab7ce975e81a.tar.gz |
Add test scenarios for the Last User Context handling
The following test scenarios are added to the documentation:
* Registration of a simple dictionary
* Registration does not happen on an isolated RegisterWithLUC() call
* An isolated FinishLUCRegistration() call will not change the LUC
* Registration of a complex dictionary
* Registration can happen with a series of RegisterWithLUC() calls
* Repeated registration of an app changes the order in the LUC
-rw-r--r-- | docs/reference/node-startup-controller/node-startup-controller-docs.xml | 1 | ||||
-rw-r--r-- | docs/reference/node-startup-controller/test-luc.xml | 277 |
2 files changed, 278 insertions, 0 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 5530b78..91081e7 100644 --- a/docs/reference/node-startup-controller/node-startup-controller-docs.xml +++ b/docs/reference/node-startup-controller/node-startup-controller-docs.xml @@ -103,6 +103,7 @@ </note> <xi:include href="test-example.xml"/> <xi:include href="test-tsm.xml"/> + <xi:include href="test-luc.xml"/> </section> </chapter> diff --git a/docs/reference/node-startup-controller/test-luc.xml b/docs/reference/node-startup-controller/test-luc.xml new file mode 100644 index 0000000..6a7b765 --- /dev/null +++ b/docs/reference/node-startup-controller/test-luc.xml @@ -0,0 +1,277 @@ +<?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-luc"> + <title>Last User Context handling</title> + <para> + Testing that the Node Startup Controller(NSC) correctly sets the Last User Context (LUC), + and starts the apps correctly on NSC startup. + </para> + + <section> + <title>Test environment and setup</title> + <section> + <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> + + <section> + <title>Helpful functions</title> + <para> + gdbus functions will be used frequently. To avoid excessive typing, the following + functions should be defined and called: + <programlisting> + # function to begin registration + begin() + { + gdbus call --system \ + -d org.genivi.NodeStartupController1 \ + -o /org/genivi/NodeStartupController1/NodeStartupController \ + -m org.genivi.NodeStartupController1.NodeStartupController.BeginLUCRegistration \ + } + + # function to make a registration call + register() + { + gdbus call --system \ + -d org.genivi.NodeStartupController1 \ + -o /org/genivi/NodeStartupController1/NodeStartupController \ + -m org.genivi.NodeStartupController1.NodeStartupController.RegisterWithLUC \ + "$1" + } + + # function to finish registration + end() + { + gdbus call --system \ + -d org.genivi.NodeStartupController1 \ + -o /org/genivi/NodeStartupController1/NodeStartupController \ + -m org.genivi.NodeStartupController1.NodeStartupController.FinishLUCRegistration \ + } + </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 & + </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> + + <section> + <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> + </itemizedlist> + </para> + </section> + + <section> + <title>Test steps</title> + <para> + <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 + <orderedlist continuation="continues"> + <listitem><programlisting>begin</programlisting></listitem> + <listitem><programlisting>register "{0: ['app1.unit']}"</programlisting></listitem> + <listitem><programlisting>end</programlisting></listitem> + <listitem> + Read the DLT log and verify this entry appears: + <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']}"]</entry></row> + </tbody> + </tgroup></informaltable> + </listitem> + <listitem><programlisting>systemctl restart node-startup-controller.service</programlisting></listitem> + <note> + If the following entry is seen: + <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>[LUC is not required]</entry></row> + </tbody> + </tgroup></informaltable> + perform the following command line again: + <programlisting>systemctl restart node-startup-controller.service</programlisting> + </note> + <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> + </tbody> + </tgroup></informaltable> + </listitem> + </orderedlist> + + + Registration does not happen on an isolated RegisterWithLUC() call + <orderedlist continuation="continues"> + <listitem><programlisting>register "{1: ['app2.unit']}"</programlisting></listitem> + <listitem> + Read the DLT log and verify this entry <emphasis>doesn't</emphasis> 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: "{1: ['app2.unit']}"]</entry></row> + </tbody> + </tgroup></informaltable> + </listitem> + </orderedlist> + + + An isolated FinishLUCRegistration() call will not change the LUC + <orderedlist continuation="continues"> + <listitem><programlisting>end</programlisting></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> + </tbody> + </tgroup></informaltable> + </listitem> + </orderedlist> + + + Registration of a complex dictionary + <orderedlist continuation="continues"> + <listitem><programlisting>begin</programlisting></listitem> + <listitem><programlisting>register "{0: ['app1.unit']}"</programlisting></listitem> + <listitem><programlisting>register "{1: ['app3.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']}"]</entry></row> + <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[The new context is: "{0: ['app1.unit'], 1: ['app3.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 0]</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 + <orderedlist continuation="continues"> + <listitem><programlisting>begin</programlisting></listitem> + <listitem><programlisting>register "{1: ['app1.unit', 'app2.unit']}"</programlisting></listitem> + <listitem><programlisting>register "{1: ['app1.unit']}"</programlisting></listitem> + <listitem><programlisting>end</programlisting></listitem> + <listitem> + Read the DLT logs 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: "{1: ['app1.unit', 'app2.unit']}"]</entry></row> + <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[The new context is: "{1: ['app2.unit', 'app1.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 1]</entry></row> + <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[start app 'app2.unit']</entry></row> + <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[start app 'app1.unit']</entry></row> + </tbody> + </tgroup></informaltable> + </listitem> + + </orderedlist> + </para> + </section> + +</section> |