aboutsummaryrefslogtreecommitdiffstats
path: root/meta-ivi-test/recipes-extended
diff options
context:
space:
mode:
Diffstat (limited to 'meta-ivi-test/recipes-extended')
-rw-r--r--meta-ivi-test/recipes-extended/common-api/capicxx-perf/capicxx-perf_t.inc22
-rw-r--r--meta-ivi-test/recipes-extended/common-api/common-api-test/common-api-test_t.inc25
-rw-r--r--meta-ivi-test/recipes-extended/dlt-daemon/dlt-daemon/dlt-daemon_t.inc25
-rw-r--r--meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor/node-health-monitor_t.inc45
-rw-r--r--meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor_%.bbappend9
-rw-r--r--meta-ivi-test/recipes-extended/node-startup-controller/node-startup-controller/node-startup-controller_t.inc69
-rw-r--r--meta-ivi-test/recipes-extended/node-startup-controller/node-startup-controller_%.bbappend5
-rw-r--r--meta-ivi-test/recipes-extended/node-state-manager/node-state-manager/node-state-manager_t.inc44
-rw-r--r--meta-ivi-test/recipes-extended/persistence-administrator/persistence-administrator/persistence-administrator_t.inc29
-rw-r--r--meta-ivi-test/recipes-extended/persistence-client-library/persistence-client-library/persistence-client-library_t.inc31
-rw-r--r--meta-ivi-test/recipes-extended/persistence-common-object/persistence-common-object/persistence-common-object_t.inc20
11 files changed, 293 insertions, 31 deletions
diff --git a/meta-ivi-test/recipes-extended/common-api/capicxx-perf/capicxx-perf_t.inc b/meta-ivi-test/recipes-extended/common-api/capicxx-perf/capicxx-perf_t.inc
index 2503c10..09199db 100644
--- a/meta-ivi-test/recipes-extended/common-api/capicxx-perf/capicxx-perf_t.inc
+++ b/meta-ivi-test/recipes-extended/common-api/capicxx-perf/capicxx-perf_t.inc
@@ -7,9 +7,25 @@ get_title() {
echo "Common API C++ test code"
}
-run_1() {
- /opt/tests/capicxx-perf/capicxx-server &
- /opt/tests/capicxx-perf/capicxx-client
+_run_dir=/opt/tests/capicxx-perf
+_run_1() {
+ ${_run_dir}/capicxx-server &
+ ${_run_dir}/capicxx-client
kill -9 `pidof capicxx-server`
sleep 1
}
+
+run_1() {
+ if [ "x${1}" != "x" ]; then
+ _run_1 >& /tmp/t
+ _test_completed=`cat /tmp/t | grep "test completed"`
+ _10000_sent=`cat /tmp/t | grep "sync messages sent" | grep 10000`
+ if [ "x${_test_completed}" != "x" -a "y${_10000_sent}" != "y" ]; then
+ echo " PASSED"
+ else
+ echo " FAILED"
+ fi
+ else
+ _run_1
+ fi
+}
diff --git a/meta-ivi-test/recipes-extended/common-api/common-api-test/common-api-test_t.inc b/meta-ivi-test/recipes-extended/common-api/common-api-test/common-api-test_t.inc
index 8b304f1..1c7cca9 100644
--- a/meta-ivi-test/recipes-extended/common-api/common-api-test/common-api-test_t.inc
+++ b/meta-ivi-test/recipes-extended/common-api/common-api-test/common-api-test_t.inc
@@ -7,11 +7,30 @@ get_title() {
echo "Common API C++ runtime"
}
-run_1() {
- /opt/tests/common-api-test/E05ManagerService &
- /opt/tests/common-api-test/E05ManagerClient &
+_run_dir=/opt/tests/common-api-test
+_run_1() {
+ ${_run_dir}/E05ManagerService &
+ ${_run_dir}/E05ManagerClient &
sleep 5
kill -9 `pidof E05ManagerClient`
kill -9 `pidof E05ManagerService`
sleep 1
}
+
+run_1() {
+ if [ "x${1}" != "x" ]; then
+ _run_1 >& /tmp/t
+ _c1=`cat /tmp/t | grep "Special device 0 detected"`
+ _c2=`cat /tmp/t | grep "Special device 0 removed"`
+ _c3=`cat /tmp/t | grep "Device 1 detected"`
+ _c4=`cat /tmp/t | grep "Device 1 removed"`
+ if [ "x${_c1}" != "x" -a "x${_c2}" != "x" -a \
+ "x${_c3}" != "x" -a "x${_c4}" != "x" ]; then
+ echo " PASSED"
+ else
+ echo " FAILED"
+ fi
+ else
+ _run_1
+ fi
+}
diff --git a/meta-ivi-test/recipes-extended/dlt-daemon/dlt-daemon/dlt-daemon_t.inc b/meta-ivi-test/recipes-extended/dlt-daemon/dlt-daemon/dlt-daemon_t.inc
index 195db76..ab96fa0 100644
--- a/meta-ivi-test/recipes-extended/dlt-daemon/dlt-daemon/dlt-daemon_t.inc
+++ b/meta-ivi-test/recipes-extended/dlt-daemon/dlt-daemon/dlt-daemon_t.inc
@@ -7,10 +7,31 @@ get_title() {
echo "dlt-daemon"
}
+_run_dir=/opt/tests/dlt-daemon
run_1() {
- /opt/tests/dlt-daemon/dlt-test-filetransfer
+ if [ "x${1}" != "x" ]; then
+ ${_run_dir}/dlt-test-filetransfer > /tmp/t
+ _c1=$?
+ if [ "x${_c1}" = "x0" ]; then
+ echo " PASSED"
+ else
+ echo " FAILED"
+ fi
+ else
+ ${_run_dir}/dlt-test-filetransfer
+ fi
}
run_2() {
- /opt/tests/dlt-daemon/dlt-test-user
+ if [ "x${1}" != "x" ]; then
+ ${_run_dir}/dlt-test-user > /tmp/t
+ _c1=`cat /tmp/t | grep -v -E Test.. | grep -v "locally printed"`
+ if [ "x${_c1}" = "x" ]; then
+ echo " PASSED"
+ else
+ echo " FAILED"
+ fi
+ else
+ ${_run_dir}/dlt-test-user
+ fi
}
diff --git a/meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor/node-health-monitor_t.inc b/meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor/node-health-monitor_t.inc
new file mode 100644
index 0000000..2afbc92
--- /dev/null
+++ b/meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor/node-health-monitor_t.inc
@@ -0,0 +1,45 @@
+#!/bin/sh
+get_list() {
+ return 2
+}
+
+get_title() {
+ echo "Node Health Monitor"
+}
+
+_run_dir=/opt/tests/node-health-monitor
+_run_() {
+ systemctl start nsm-dummy
+ node-health-monitor &
+
+ cd ${_run_dir}
+ ./${1}
+
+ kill -9 `pidof node-health-monitor`
+ systemctl stop nsm-dummy
+}
+
+_run() {
+ echo "[ FAILED ] node-head-monitor is not working properly"
+ return 0
+
+ if [ "x${2}" != "x" ]; then
+ _run_ $1 > /tmp/t 2> /tmp/t.err
+ _c1=$?
+ if [ "x${_c1}" = "x0" ]; then
+ echo "[ PASSED ]"
+ else
+ echo "[ FAILED ]"
+ fi
+ else
+ _run_ $1 2> /tmp/t.err
+ fi
+}
+
+run_1() {
+ _run nhm-main-test $*
+}
+
+run_2() {
+ _run nhm-systemd-test $*
+}
diff --git a/meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor_%.bbappend b/meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor_%.bbappend
index fa2055a..fbe0ad1 100644
--- a/meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor_%.bbappend
+++ b/meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor_%.bbappend
@@ -1,6 +1,11 @@
#
# for test
#
+FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
+SRC_URI_append += " \
+ file://${BPN}_t.inc \
+ "
+
do_compile_append() {
make -C tst nhm-main-test
make -C tst nhm-systemd-test
@@ -11,6 +16,8 @@ do_install_append() {
install -m 0755 ${S}/tst/nhm-main-test ${D}/opt/tests/${PN}
install -m 0755 ${S}/tst/nhm-systemd-test ${D}/opt/tests/${PN}
ln -s /etc ${D}/opt/tests/cfg
+
+ install -m 0755 ${WORKDIR}/${BPN}_t.inc ${D}/opt/tests/${PN}
}
PACKAGES += "${PN}-test"
@@ -20,6 +27,6 @@ FILES_${PN}-dbg += " \
/opt/tests/${PN}/.debug/* \
"
FILES_${PN}-test = " \
- /opt/tests/${PN}/* \
+ /opt/tests/${PN}/ \
/opt/tests/cfg \
"
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 \
"
diff --git a/meta-ivi-test/recipes-extended/node-state-manager/node-state-manager/node-state-manager_t.inc b/meta-ivi-test/recipes-extended/node-state-manager/node-state-manager/node-state-manager_t.inc
index 6ac298c..f68b454 100644
--- a/meta-ivi-test/recipes-extended/node-state-manager/node-state-manager/node-state-manager_t.inc
+++ b/meta-ivi-test/recipes-extended/node-state-manager/node-state-manager/node-state-manager_t.inc
@@ -7,22 +7,50 @@ get_title() {
echo "Node State Manager"
}
+_run_dir=/opt/tests/node-state-manager
+_run_1() {
+ ${_run_dir}/NodeStateTest
+}
+
+_lib=/usr/lib/libNodeStateMachineStub.so
+_lib_t=${_run_dir}/lib/libNodeStateMachineTest.so
+_lib_bak=${_run_dir}/lib/libNodeStateMachineStub.so
run_1() {
- cd /usr/lib
- mv libNodeStateMachineStub.so libNodeStateMachineStub.so.bak
- cp /opt/tests/node-state-manager/lib/libNodeStateMachineTest.so \
- libNodeStateMachineStub.so
+ if [ ! -f ${_lib_bak} ]; then
+ cp ${_lib} ${_run_dir}/lib
+ fi
+ cp ${_lib_t} ${_lib}
ldconfig
sleep 1
systemctl start node-startup-controller
- /opt/tests/node-state-manager/NodeStateTest
+ if [ "x${1}" != "x" ]; then
+ _run_1 > /tmp/t 2> /tmp/t.err
+ _c1=`cat /tmp/t | grep success | wc -l`
+ _c2=`cat /tmp/t | grep failed | wc -l`
+ if [ "x${_c1}" = "x0" ]; then
+ echo "[ FAILED ] ${_c2} tests."
+ elif [ "x${_c2}" = "x0" ]; then
+ echo "[ PASSED ] ${_c1} tests."
+ else
+ echo " ${_c1} PASSED, ${_c2} FAILED"
+ fi
+ else
+ _run_1 2> /tmp/t.err
+ fi
systemctl stop node-startup-controller
- kill -9 `pidof NodeStateManager`
+ _p=`pidof NodeStateManager`
+ if [ "x${_p}" != "x" ]; then
+ kill -9 ${_p} >& /dev/null
+ fi
+ _p=`pidof nsm-dummy`
+ if [ "x${_p}" != "x" ]; then
+ kill -9 ${_p} >& /dev/null
+ fi
- rm -f libNodeStateMachineStub.so
- mv libNodeStateMachineStub.so.bak libNodeStateMachineStub.so
+ rm -f ${_lib}
+ cp ${_lib_bak} ${_lib}
ldconfig
}
diff --git a/meta-ivi-test/recipes-extended/persistence-administrator/persistence-administrator/persistence-administrator_t.inc b/meta-ivi-test/recipes-extended/persistence-administrator/persistence-administrator/persistence-administrator_t.inc
index 0e3a65c..d9ff540 100644
--- a/meta-ivi-test/recipes-extended/persistence-administrator/persistence-administrator/persistence-administrator_t.inc
+++ b/meta-ivi-test/recipes-extended/persistence-administrator/persistence-administrator/persistence-administrator_t.inc
@@ -7,21 +7,38 @@ get_title() {
echo "persistence-administrator"
}
+_run_dir=/opt/tests/persistence-administrator
+_run_1() {
+ persadmin_tool install /Data/Data.tar.gz > /tmp/t
+ ${_run_dir}/pers_admin_test_framework
+}
+
run_1() {
- echo "error!"
- echo "segfault at 7fa2ac0b6010 ip 000000364d88e130 sp 00007fa2ae0f2aa8 error 4 in libc-2.23.so[364d800000+197000]"
- exit -1
+ echo "[ FAILED ] segfault at 7fa2ac0b6010 ip 000000364d88e130 sp 00007fa2ae0f2aa8 error 4 in libc-2.23.so[364d800000+197000]"
+ return 0
if [ ! -d /tmp/PAS ]; then
rm -f /tmp/PAS
mkdir -p /tmp/PAS
fi
- cp /opt/tests/persistence-administrator/resource*.tar.gz /tmp/PAS/
+ cp ${_run_dir}/resource*.tar.gz /tmp/PAS/
systemctl restart dlt-dbus
systemctl restart dlt-example-user
systemctl restart pas-daemon
systemctl restart node-startup-controller
- persadmin_tool install /Data/Data.tar.gz
- /opt/tests/persistence-administrator/pers_admin_test_framework
+ if [ "x${1}" != "x" ]; then
+ _run_1 > /tmp/t
+ _c1=`cat /tmp/t | grep :P: | wc -l`
+ _c2=`cat /tmp/t | grep :F: | wc -l`
+ if [ "x${_c1}" = "x0" ]; then
+ echo "[ FAILED ] ${_c2} tests."
+ elif [ "x${_c2}" = "x0" ]; then
+ echo "[ PASSED ] ${_c1} tests."
+ else
+ echo " ${_c1} PASSED, ${_c2} FAILED"
+ fi
+ else
+ _run_1
+ fi
}
diff --git a/meta-ivi-test/recipes-extended/persistence-client-library/persistence-client-library/persistence-client-library_t.inc b/meta-ivi-test/recipes-extended/persistence-client-library/persistence-client-library/persistence-client-library_t.inc
index 7fbec91..825fa32 100644
--- a/meta-ivi-test/recipes-extended/persistence-client-library/persistence-client-library/persistence-client-library_t.inc
+++ b/meta-ivi-test/recipes-extended/persistence-client-library/persistence-client-library/persistence-client-library_t.inc
@@ -7,11 +7,30 @@ get_title() {
echo "persisitence-client-library"
}
+_run_dir=/opt/tests/persistence-client-library
+_run_1() {
+ persadmin_tool install /Data/Data.tar.gz > /tmp/t
+ ${_run_dir}/persistence_client_library_test
+}
+
run_1() {
- systemctl restart dlt-dbus
- systemctl restart dlt-example-user
- systemctl restart pas-daemon
- systemctl restart node-startup-controller
- persadmin_tool install /Data/Data.tar.gz
- /opt/tests/persistence-client-library/persistence_client_library_test
+ #systemctl restart dlt-dbus
+ #systemctl restart dlt-example-user
+ #systemctl restart pas-daemon
+ #systemctl restart node-startup-controller
+ if [ "x${1}" != "x" ]; then
+ _run_1 > /tmp/t
+ _c1=`cat /tmp/t | grep :P: | wc -l`
+ _c2=`cat /tmp/t | grep :F: | wc -l`
+ if [ "x${_c1}" = "x0" ]; then
+ echo "[ FAILED ] ${_c2} tests."
+ elif [ "x${_c2}" = "x0" ]; then
+ echo "[ PASSED ] ${_c1} tests."
+ else
+ echo " ${_c1} PASSED, ${_c2} FAILED"
+ fi
+ else
+ _run_1
+ fi
+ killall -9 nsm-dummy
}
diff --git a/meta-ivi-test/recipes-extended/persistence-common-object/persistence-common-object/persistence-common-object_t.inc b/meta-ivi-test/recipes-extended/persistence-common-object/persistence-common-object/persistence-common-object_t.inc
index c113bd3..bd45a3b 100644
--- a/meta-ivi-test/recipes-extended/persistence-common-object/persistence-common-object/persistence-common-object_t.inc
+++ b/meta-ivi-test/recipes-extended/persistence-common-object/persistence-common-object/persistence-common-object_t.inc
@@ -7,6 +7,24 @@ get_title() {
echo "persisitence-common-object"
}
+_run_dir=/opt/tests/persistence-common-object
+_run_1() {
+ ${_run_dir}/test_pco_key_value_store
+}
+
run_1() {
- /opt/tests/persistence-common-object/test_pco_key_value_store
+ if [ "x${1}" != "x" ]; then
+ _run_1 > /tmp/t
+ _c1=`cat /tmp/t | grep :P: | wc -l`
+ _c2=`cat /tmp/t | grep :F: | wc -l`
+ if [ "x${_c1}" = "x0" ]; then
+ echo "[ FAILED ] ${_c2} tests."
+ elif [ "x${_c2}" = "x0" ]; then
+ echo "[ PASSED ] ${_c1} tests."
+ else
+ echo " ${_c1} PASSED, ${_c2} FAILED"
+ fi
+ else
+ _run_1
+ fi
}