From 8436dc84b15abd4bf77842412681ab7ce975e81a Mon Sep 17 00:00:00 2001 From: Jonathan Maw Date: Thu, 2 Aug 2012 09:44:33 +0100 Subject: 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 --- .../node-startup-controller-docs.xml | 1 + .../reference/node-startup-controller/test-luc.xml | 277 +++++++++++++++++++++ 2 files changed, 278 insertions(+) create mode 100644 docs/reference/node-startup-controller/test-luc.xml 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 @@ + 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 @@ + + + +
+ Last User Context handling + + Testing that the Node Startup Controller(NSC) correctly sets the Last User Context (LUC), + and starts the apps correctly on NSC startup. + + +
+ Test environment and setup +
+ GDBus + + This test assumes that the gdbus programme is installed on the + system. Without this programme, this test is impossible. + +
+ +
+ Helpful functions + + gdbus functions will be used frequently. To avoid excessive typing, the following + functions should be defined and called: + + # 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 \ + } + + +
+ +
+ Setting up DLT + + In addition, this test uses Diagnostic Log and Trace (DLT). It can be started and + directed to a log file by executing the following: + + dlt-daemon -d + dlt-receive -o /tmp/dlt.log localhost & + + +
+ +
+ Reading DLT log + + To read this log file, execute + dlt-convert -a /tmp/dlt.log This will display the + contents of the log file in the following format: + Index Time Timestamp Count Ecuid Apid Ctid Type Subtype Mode #Args Payload + The fields we are interested in are the Apid (Application ID), Ctid (Context ID) and the Payload + For example: + 12 2012/08/01 10:30:32.247913 17066086 006 ECU1 NSC- CTRL log info V 1 [Active state of unit "node-startup-controller.service" changed to active] + +
+
+ +
+ Test Overview + + The following behaviours will be confirmed: + + + 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 + + + +
+ +
+ Test steps + + + systemctl start nsm-dummy.service + systemctl start node-startup-controller.service + + + + Registration of a simple dictionary + + begin + register "{0: ['app1.unit']}" + end + + Read the DLT log and verify this entry appears: + + + APID CTID Payload + + + NSC- CTRL [The new context is: "{0: ['app1.unit']}"] + + + + systemctl restart node-startup-controller.service + + If the following entry is seen: + + + APID CTID Payload + + + NSC- CTRL [LUC is not required] + + + perform the following command line again: + systemctl restart node-startup-controller.service + + + Read the DLT log and verify these entries appear: + + + APID CTID Payload + + + NSC- CTRL [start group 0] + NSC- CTRL [start app 'app1.unit'] + + + + + + + Registration does not happen on an isolated RegisterWithLUC() call + + register "{1: ['app2.unit']}" + + Read the DLT log and verify this entry doesn't appear: + + + APID CTID Payload + + + NSC- CTRL [The new context is: "{1: ['app2.unit']}"] + + + + + + + An isolated FinishLUCRegistration() call will not change the LUC + + end + systemctl restart node-startup-controller.service + + Read the DLT log and verify these entries appear: + + + APID CTID Payload + + + NSC- CTRL [start group 0] + NSC- CTRL [start app 'app1.unit'] + + + + + + + Registration of a complex dictionary + + begin + register "{0: ['app1.unit']}" + register "{1: ['app3.unit']}" + end + + Read the DLT log and verify these entries appear: + + + APID CTID Payload + + + NSC- CTRL [The new context is: "{0: ['app1.unit']}"] + NSC- CTRL [The new context is: "{0: ['app1.unit'], 1: ['app3.unit']}"] + + + + systemctl restart node-startup-controller.service + + Read the DLT log and verify these entries appear: + + + APID CTID Payload + + + NSC- CTRL [start group 0] + NSC- CTRL [start app 'app1.unit'] + NSC- CTRL [start group 0] + NSC- CTRL [start app 'app3.unit'] + + + + + + + Repeated registration of an app changes the order in the LUC + + begin + register "{1: ['app1.unit', 'app2.unit']}" + register "{1: ['app1.unit']}" + end + + Read the DLT logs and verify these entries appear: + + + APID CTID Payload + + + NSC- CTRL [The new context is: "{1: ['app1.unit', 'app2.unit']}"] + NSC- CTRL [The new context is: "{1: ['app2.unit', 'app1.unit']}"] + + + + + systemctl restart node-startup-controller.service + + Read the DLT log and verify these entries appear: + + + APID CTID Payload + + + NSC- CTRL [start group 1] + NSC- CTRL [start app 'app2.unit'] + NSC- CTRL [start app 'app1.unit'] + + + + + + +
+ +
-- cgit v1.2.1