Skip to end of metadata
Go to start of metadata
  1. install *-test at build/conf/local.conf

    IMAGE_INSTALL_append += " \
        node-state-manager-test \
        "
  2. set up test environment
    1. overwrite the "libNodeStateMachine.so" with the test version:

      root@qemux86:~# cd /usr/lib
      root@qemux86:/usr/lib# mv libNodeStateMachine.so libNodeStateMachine.so.bak
      root@qemux86:/usr/lib# cp -vf /opt/tests/node-state-manager/lib/libNodeStateMachineTest.so libNodeStateMachine.so
    2. create an own dbus instance:

      root@qemux86:/usr/lib# dbus-launch 
      DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-ELaodyB01D,guid=66fd87514356c51bb6fbcd0b56d97edb
      DBUS_SESSION_BUS_PID=638
    3. the command will print a DBUS_SESSION_BUS_ADDRESS. Copy/paste and export it as system bus:

      root@qemux86:/usr/lib# export DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-ELaodyB01D,guid=66fd87514356c51bb6fbcd0b56d97edb
    4. start the NodeStateManager (in background)

      root@qemux86:/usr/lib# NodeStateManager &
      root@qemux86:/usr/lib# 2016/03/04 12:51:09.841432     875901 000 ECU1 NSM- 005- log info V 3 [NSM: NodeStateManager started. Version: 2.0.0]
      2016/03/04 12:51:09.913344     876619 000 ECU1 NSM- PCL- log error V 2 [custom_libname_to_id - error - id not found for lib: anInvalidEntry]
      2016/03/04 12:51:10.150295     878988 001 ECU1 NSM- 005- log info V 1 [NSM: Daemon not observed by wdog]
      2016/03/04 12:51:10.208733     879572 002 ECU1 NSM- 005- log info V 2 [NSM: Error in event loop.  Shutting down NodeStateManager.]
      2016/03/04 12:51:10.314196     880627 001 ECU1 NSM- PCL- log info V 2 [removeWatch called  134661192]
      2016/03/04 12:51:10.315834     880643 002 ECU1 NSM- PCL- log info V 2 [removeWatch called  134661152]
      2016/03/04 12:51:10.328651     880772 003 ECU1 NSM- 005- log info V 1 [NSM: NodeStateManager stopped.]
  3. run all test programs

    root@qemux86:/usr/lib# cd /opt/tests/node-state-manager
    root@qemux86:/opt/tests/node-state-manager# ./NodeStateTest
    000;Get connection to system bus.;-;success
    001;Create NodeStateConsumer proxy.;-;success
    002;Create LifecycleControl proxy.;-;success
    003;Create NodeStateMachine proxy.;-;success
    004;Register callbacks for SessionState, NodeState and ApplicationMode signals.;-;success
    005;Set BootMode. Interface: D-Bus. Value: 0x00.;-;success
    006;Get BootMode. Interface: D-Bus. Expected value: 0x00.;-;success
    007;Set BootMode. Interface: D-Bus. Value: 0x01.;-;success
    008;Get BootMode. Interface: D-Bus. Expected value: 0x01.;-;success
    009;Set BootMode. Interface: D-Bus. Value: 0x01.;-;success
    010;Get BootMode. Interface: D-Bus. Expected value: 0x01.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    011;Set BootMode. Interface: StateMachine. Passed DataLen: 4.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    012;Set BootMode. Interface: StateMachine. Passed DataLen: 5.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    013;Set BootMode. Interface: StateMachine. Passed DataLen: 3.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    014;Get BootMode. Interface: StateMachine. Passed DataLen: 4. Expected value: 0x02.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    015;Get BootMode. Interface: StateMachine. Passed DataLen: 5. Expected value: -.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    016;Get BootMode. Interface: StateMachine. Passed DataLen: 3. Expected value: -.;-;success
    017;Get RunningReason. Interface: D-Bus. Expected value: 0x01.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    018;Get RunningReason. Interface: StateMachine. Passed DataLen: 4. Expected value: 0x01.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    019;Get RunningReason. Interface: StateMachine. Passed DataLen: 5. Expected value: -.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    020;Get RunningReason. Interface: StateMachine. Passed DataLen: 3. Expected value: -.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    021;Set ShutdownReason. Interface: StateMachine. Passed DataLen: 4.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    022;Set ShutdownReason. Interface: StateMachine. Passed DataLen: 4.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    023;Set ShutdownReason. Interface: StateMachine. Passed DataLen: 3.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    024;Set ShutdownReason. Interface: StateMachine. Passed DataLen: 5.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    025;Set ShutdownReason. Interface: StateMachine. Passed DataLen: 4.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    026;Set ShutdownReason. Interface: StateMachine. Passed DataLen: 4.;-;success
    027;Get ShutdownReason. Interface: D-Bus. Expected value: 0x01.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    028;Get ShutdownReason. Interface: StateMachine. Passed DataLen: 4. Expected value: 0x01.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    029;Get ShutdownReason. Interface: StateMachine. Passed DataLen: 3. Expected value: -.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    030;Get ShutdownReason. Interface: StateMachine. Passed DataLen: 5. Expected value: -.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    031;Set ShutdownReason. Interface: StateMachine. Passed DataLen: 4.;-;success
    032;Get ShutdownReason. Interface: D-Bus. Expected value: 0x02.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    033;Get ShutdownReason. Interface: StateMachine. Passed DataLen: 4. Expected value: 0x02.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    034;Get ShutdownReason. Interface: StateMachine. Passed DataLen: 3. Expected value: -.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    035;Get ShutdownReason. Interface: StateMachine. Passed DataLen: 5. Expected value: -.;-;success
    036;Get RestartReason. Interface: D-Bus. Expected value: 0x00.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    037;Get RestartReason. Interface: StateMachine. Passed DataLen: 4. Expected value: 0x00.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    038;Get RestartReason. Interface: StateMachine. Passed DataLen: 3. Expected value: -.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    039;Get RestartReason. Interface: StateMachine. Passed DataLen: 5. Expected value: -.;-;success
    040;Set NodeState. Interface: D-Bus. Value: 0x00.;-;success
    041;Set NodeState. Interface: D-Bus. Value: 0xFFFFFFFF.;-;success
    042;Set NodeState. Interface: D-Bus. Value: 0x02.;-;success
    043;Set NodeState. Interface: D-Bus. Value: 0x02.;-;success
    044;Set NodeState. Interface: D-Bus. Value: 0x03.;-;success
    045;Check for NodeState signal.;-;success
    046;Get NodeState. Interface: D-Bus. Expected value: 0x03.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    047;Set NodeState. Interface: StateMachine. Passed DataLen: 4.;-;success
    048;Check for NodeState signal.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    049;Set NodeState. Interface: StateMachine. Passed DataLen: 3.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    050;Set NodeState. Interface: StateMachine. Passed DataLen: 5.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    051;Get NodeState. Interface: StateMachine. Passed DataLen: 4. Expected value: 0x04.;-;success
    (process:629): GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
    052;Get NodeState. Interface: StateMachine. Passed DataLen: 3. Expected value: -.;-;success
    053;Set ApplicationMode. Interface: D-Bus. Value: 0x00.;-;success
    054;Set ApplicationMode. Interface: D-Bus. Value: 0xFFFFFFFF.;-;success
    055;Set ApplicationMode. Interface: D-Bus. Value: 0x01.;-;success
    056;Set ApplicationMode. Interface: D-Bus. Value: 0x01.;-;success
    057;Set ApplicationMode. Interface: D-Bus. Value: 0x02.;-;success
    058;Check for Application mode signal.;-;success
    059;Get ApplicationMode. Interface: D-Bus. Expected value: 0x02.;Did not receive expected ApplicationMode. Received: 0x00. Expected: 0x02.;failed
  • No labels