summaryrefslogtreecommitdiff
path: root/docs/reference/node-startup-controller/test-luc-management.xml
blob: 49f8662d25b9af313fd8eddb7b82476bda334424 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<!--
SPDX license identifier: CC-BY-SA-4.0

Copyright (C) 2015, GENIVI

This work is licensed under a Creative Commons Attribution-ShareAlike 

4.0 International License. 
-->
<?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-luc-management">
  <refmeta>
    <refentrytitle>Tests for LUC management</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>Tests for LUC management</refname>
    <refpurpose>
      How to verify that the NSC correctly sets the LUC and brings up apps in the LUC
      correctly during start-up.
    </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Test environment and setup</title>
    <refsect2>
      <title>GDBus</title>
      <para>
        This test assumes that the <command>gdbus</command> command line tool is installed
        on the system. Without this application, the LUC tests described here can not be
        performed.
      </para>
    </refsect2>
    <refsect2>
      <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>
    </refsect2>
    <refsect2>
      <title>Starting the necessary services</title>
      <para>
        The NSM dummy and the Node Startup Controller services need to be started
        prior to running any of the tests described here. This is done using the
        following commands:
      </para>
      <programlisting>systemctl start nsm-dummy.service
systemctl start node-startup-controller.service</programlisting>
      <note>
        <para>
          Check the DLT log after starting these services. If the following messages
          was logged to the DLT you need to restart
          <literal>node-startup-controller.service</literal>:
        </para>
        <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>
        <para>
          To restart <literal>node-startup-controller.service</literal> simply run:
        </para>
        <programlisting>systemctl restart node-startup-controller.service</programlisting>
      </note>
    </refsect2>
  </refsect1>

  <refsect1>
    <title>Test cases</title>
    <para>
      The following test cases for LUC management are described in this document:
      <itemizedlist>
        <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>
    <note>
      All of these tests need to be executed in the order they are listed here.
    </note>
  </refsect1>

  <refsect1 id="test-luc-register-simple">
    <title id="test-luc-register-simple-title">1. Registration of a simple dictionary</title>
    <refsect2>
      <title>Description</title>
      <para>
        Registers one application for a single LUC type, restarts the
        Node Startup Controller and verifies that it attempts to start this app
        as part of the LUC.
      </para>
    </refsect2>
    <refsect2>
      <title>Test commands</title>
      <programlisting>begin
register "{0: ['app1.unit']}"
end

systemctl restart node-startup-controller.service</programlisting>
    </refsect2>
    <refsect2>
      <title>Desired behaviour and output</title>
      <para>
        The DLT log should now contain the following log messages:
      </para>
      <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>[Updated LUC to: "{0: ['app1.unit']}"]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC group: 0]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC app: app1.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC app: app1.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC group: 0]</entry></row>
        </tbody>
      </tgroup></informaltable>
    </refsect2>
  </refsect1>
  <refsect1 id="test-luc-register-only">
    <title id="test-luc-register-only-title">2. Registration does not happen on an isolated RegisterWithLUC() call</title>
    <refsect2>
      <title>Description</title>
      <para>
        Attempts to register an application by calling 
        <literal>RegisterWithLUC()</literal> all by itself. Restarts the Node Startup 
        Controller and verifies that the last user context hasn't changed.
      </para>
    </refsect2>
    <refsect2>
      <title>Test commands</title>
      <programlisting>register "{1: ['app2.unit']}"

systemctl restart node-startup-controller.service
      </programlisting>
    </refsect2>
    <refsect2>
      <title>Desired behaviour and output</title>
      <para>
        The DLT log should now contain the following log messages:
      </para>
      <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>[Starting LUC group: 0]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC app: app1.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC app: app1.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC group: 0]</entry></row>
        </tbody>
      </tgroup></informaltable>
    </refsect2>
  </refsect1>
  <refsect1 id="test-luc-finish-only">
    <title id="test-luc-finish-only-title">3. An isolated FinishLUCRegistration() call will not change the LUC</title>
    <refsect2>
      <title>Description</title>
      <para>
        Calls <literal>FinishLUCRegistration()</literal> without having started
        registration or registered any apps with it. Restarts the Node Startup Controller
        to verify that the LUC hasn't changed.
      </para>
    </refsect2>
    <refsect2>
      <title>Test commands</title>
      <programlisting>end

systemctl restart node-startup-controller.service
      </programlisting>
    </refsect2>
    <refsect2>
      <title>Desired behaviour and output</title>
      <para>
        The DLT log should now contain the following log messages:
      </para>
      <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>[Starting LUC group: 0]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC app: app1.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC app: app1.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC group: 0]</entry></row>
        </tbody>
      </tgroup></informaltable>
    </refsect2>
  </refsect1>
  <refsect1 id="test-luc-register-complex">
    <title id="test-luc-register-complex-title">4. Registration of a complex dictionary</title>
    <refsect2>
      <title>Description</title>
      <para>
        Registers the Last User Context with multiple LUC groups and multiple apps in
        a single LUC group. Restarts the Node Startup Controller to verify the LUC was
        changed and starts the apps in the correct order.
      </para>
    </refsect2>
    <refsect2>
      <title>Test commands</title>
      <programlisting>begin
register "{0: ['app1.unit'], 1: ['app1.unit', 'app3.unit'], 2: ['app2.unit']}"
end

systemctl restart node-startup-controller.service
      </programlisting>
    </refsect2>
    <refsect2>
      <title>Desired behaviour and output</title>
      <note>
        The start order of LUC groups may be different depending on the build-time
        configuration of the Node Startup Controller in the test system.
      </note>
      <para>
        The DLT log should now contain the following messages
      </para>
      <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>[Updated LUC to: "{0: ['app1.unit'], 1: ['app1.unit', 'app3.unit'], 2: ['app2.unit']}"]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC group: 0]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC app: app1.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC app: app1.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC group: 0]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC group: 1]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC app: app1.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC app: app1.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC app: app3.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC app: app3.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC group: 1]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC group: 2]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC app: app2.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC app: app2.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC group: 2]</entry></row>
        </tbody>
      </tgroup></informaltable>
    </refsect2>
  </refsect1>
  <refsect1 id="test-luc-register-series">
    <title id="test-luc-register-series-title">5. Registration can happen with a series of RegisterWithLUC() calls</title>
    <refsect2>
      <title>Description</title>
      <para>
        Registers multiple applications to the LUC in a series of
        <literal>RegisterWithLUC()</literal> calls. Restarts the Node Startup Controller
        and verifies that the apps added in each call are started in the correct order.
      </para>
    </refsect2>
    <refsect2>
      <title>Test commands</title>
      <programlisting>begin
register "{0: ['app1.unit']}"
register "{1: ['app3.unit']}"
end

systemctl restart node-startup-controller.service
      </programlisting>
    </refsect2>
    <refsect2>
      <title>Desired behaviour and output</title>
      <para>
        The DLT log should now contain the following log messages:
      </para>
      <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>[Updated LUC to: "{0: ['app1.unit']}"]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Updated LUC to: "{0: ['app1.unit'], 1: ['app3.unit']}"]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC group: 0]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC app: app1.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC app: app1.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC group: 0]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC group: 1]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC app: app3.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC app: app3.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC group: 1]</entry></row>
        </tbody>
      </tgroup></informaltable>
    </refsect2>
  </refsect1>
  <refsect1 id="tests-luc-register-series-reorder">
    <title id="tests-luc-register-series-reorder-title">6. Repeated registration of an app changes the order in the LUC</title>
    <refsect2>
      <title>Description</title>
      <para>
        Registers two applications, then registers the first application again. Restarts
        the Node Startup Controller to verify that the order the applications start is
        changed by the second registration.
      </para>
    </refsect2>
    <refsect2>
      <title>Test commands</title>
      <programlisting>begin
register "{1: ['app1.unit', 'app2.unit']}"
register "{1: ['app1.unit']}"
end

systemctl restart node-startup-controller.service
      </programlisting>
    </refsect2>
    <refsect2>
      <title>Desired behaviour and output</title>
      <para>
        The DLT log should now contain the following log messages:
      </para>
      <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>[Updated LUC to: "{1: ['app1.unit', 'app2.unit']}"]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Updated LUC to: "{1: ['app2.unit', 'app1.unit']}"]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC group: 1]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC app: app2.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC app: app2.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Starting LUC app: app1.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC app: app1.unit]</entry></row>
          <row><entry>NSC-</entry> <entry>CTRL</entry> <entry>[Finished starting LUC group: 1]</entry></row>
        </tbody>
      </tgroup></informaltable>
    </refsect2>
  </refsect1>
</refentry>