diff options
Diffstat (limited to 'meta-ivi-test/recipes-extended/node-startup-controller')
2 files changed, 73 insertions, 1 deletions
diff --git a/meta-ivi-test/recipes-extended/node-startup-controller/node-startup-controller/node-startup-controller_t.inc b/meta-ivi-test/recipes-extended/node-startup-controller/node-startup-controller/node-startup-controller_t.inc new file mode 100644 index 0000000..6516461 --- /dev/null +++ b/meta-ivi-test/recipes-extended/node-startup-controller/node-startup-controller/node-startup-controller_t.inc @@ -0,0 +1,69 @@ +#!/bin/sh +get_list() { + return 1 +} + +get_title() { + echo "Node Startup Controller" +} + +_run_dir=/opt/tests/node-startup-controller +_luc_check() { + while true; do + ${_run_dir}/luc_check.sh > /tmp/t + is_nsc=`grep LUC is not required` + if [ "x${is_nsc}" != "x" ]; then + echo "restart node-startup-controller" + systemctl stop node-startup-controller + sleep 1 + systemctl start node-startup-controller + else + break + fi + done +} +_run_() { + systemctl start dlt-receive + systemctl start nsm-dummy + systemctl start node-startup-controller + + _luc_check + ${_run_dir}/${1} + + systemctl stop node-startup-controller + systemctl stop nsm-dummy + #systemctl stop dlt-receive +} + +_check_luc_test_01() { + cat /tmp/t | grep 'NSC-' | grep 'CTRL' > /tmp/t2 + _c1=`cat /tmp/t2 | grep "Updated LUC to:" | grep app1.unit` + _c2=`cat /tmp/t2 | grep "\[Starting LUC group: 0\]"` + _c3=`cat /tmp/t2 | grep "\[Starting LUC app: app1.unit\]"` + _c4=`cat /tmp/t2 | grep "\[Finished starting LUC app: app1.unit\]"` + _c5=`cat /tmp/t2 | grep "\[Finished starting LUC group: 0\]"` + if [ "x${_c1}" != "x" -a "x${_c2}" != "x" -a "x${_c3}" != "x" -a \ + "x${_c4}" != "x" -a "x${_c5}" != "x" ]; then + echo "[ PASSED ]" + else + echo "[ FAILED ]" + fi +} + +_run() { + if [ "x${2}" != "x" ]; then + _run_ ${1}.sh > /tmp/t 2> /tmp/t.err + eval _check_${1} + else + _run_ ${1}.sh 2> /tmp/t.err + fi +} + +run_1() { + _run luc_test_01 $* + +} + +run_2() { + _run nhm-systemd-test $* +} diff --git a/meta-ivi-test/recipes-extended/node-startup-controller/node-startup-controller_%.bbappend b/meta-ivi-test/recipes-extended/node-startup-controller/node-startup-controller_%.bbappend index c9ccacc..1d8e2a1 100644 --- a/meta-ivi-test/recipes-extended/node-startup-controller/node-startup-controller_%.bbappend +++ b/meta-ivi-test/recipes-extended/node-startup-controller/node-startup-controller_%.bbappend @@ -4,16 +4,19 @@ FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" SRC_URI_append += " \ file://helper.zip \ + file://${BPN}_t.inc \ " do_install_append() { install -d ${D}/opt/tests/${PN} install -m 0755 ${WORKDIR}/helper/*.sh ${D}/opt/tests/${PN} install -m 0644 ${WORKDIR}/helper/*.service ${D}/${systemd_unitdir}/system + + install -m 0755 ${WORKDIR}/${BPN}_t.inc ${D}/opt/tests/${PN} } FILES_${PN}-nsm-dummy += " \ - /opt/tests/${PN}/* \ + /opt/tests/${PN}/ \ ${systemd_unitdir}/system/example.service \ ${systemd_unitdir}/system/hello.service \ " |