diff options
Diffstat (limited to 'meta-ivi-test/recipes-extended')
23 files changed, 491 insertions, 127 deletions
diff --git a/meta-ivi-test/recipes-extended/common-api/capicxx-core-native_3.1.5p2.bb b/meta-ivi-test/recipes-extended/common-api/capicxx-core-native_3.1.5p2.bb deleted file mode 100644 index 3e9c36c..0000000 --- a/meta-ivi-test/recipes-extended/common-api/capicxx-core-native_3.1.5p2.bb +++ /dev/null @@ -1,10 +0,0 @@ -SUMMARY = "Common API C++ core generator" - -LAUNCHER_BASE = "commonapi-generator" -LAUNCHER_LINK = "capicxx-core-gen" - -require capicxx-native.inc - -SRC_URI = "${BASE_URL}/generator/${BASE_VER}/${PV}/commonapi-generator.zip" -SRC_URI[md5sum] = "c12551e8f61da944b17a22c00d3e6559" -SRC_URI[sha256sum] = "538a923a1e596106b9f2ce0838fcf85fd81c4e09b0951c59ad2e2e72eb6d0534" diff --git a/meta-ivi-test/recipes-extended/common-api/capicxx-dbus-native_3.1.5p2.bb b/meta-ivi-test/recipes-extended/common-api/capicxx-dbus-native_3.1.5p2.bb deleted file mode 100644 index 66b90a8..0000000 --- a/meta-ivi-test/recipes-extended/common-api/capicxx-dbus-native_3.1.5p2.bb +++ /dev/null @@ -1,10 +0,0 @@ -SUMMARY = "Common API C++ D-Bus generator" - -LAUNCHER_BASE = "commonapi-dbus-generator" -LAUNCHER_LINK = "capicxx-dbus-gen" - -require capicxx-native.inc - -SRC_URI = "${BASE_URL}/generator/${BASE_VER}/${PV}/commonapi_dbus_generator.zip" -SRC_URI[md5sum] = "70a6f1cf7e42a94260385281a569a486" -SRC_URI[sha256sum] = "de165298b1062951dff07d99f491c8d8a3ca3c1a087de56bc01c083cf71fa742" diff --git a/meta-ivi-test/recipes-extended/common-api/capicxx-native.inc b/meta-ivi-test/recipes-extended/common-api/capicxx-native.inc deleted file mode 100644 index 19b22e3..0000000 --- a/meta-ivi-test/recipes-extended/common-api/capicxx-native.inc +++ /dev/null @@ -1,45 +0,0 @@ -SECTION = "devel" -LICENSE = "MPL-2.0" -LIC_FILES_CHKSUM = \ - "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" - -BASE_URL = "http://docs.projects.genivi.org/yamaica-update-site/CommonAPI" -BASE_VER = "${@'.'.join(d.getVar('PV', True).split('.')[0:2])}" - -def get_launcher_name(d): - BS = d.getVar('BUILD_SYS', True) - if BS == "x86_64-linux": - launcherName = "${LAUNCHER_BASE}-linux-x86_64" - elif BS == "i686-linux": - launcherName = "${LAUNCHER_BASE}-linux-x86" - else: - bb.fatal("Build system '%s' is not supported by ${PN}_${PV} recipe" % BS) - return launcherName - -LAUNCHER = "${@get_launcher_name(d)}" - -inherit native -SANITY_REQUIRED_UTILITIES += "java" - -S = "${WORKDIR}" -DD = "${D}${datadir}/${PN}-${PV}" - -do_install() { - install -d ${DD} - install -m 0644 ${S}/artifacts.xml ${DD} - install -m 0755 ${S}/${LAUNCHER_BASE}-linux-x86 ${DD} - install -m 0644 ${S}/${LAUNCHER_BASE}-linux-x86.ini ${DD} - install -m 0755 ${S}/${LAUNCHER_BASE}-linux-x86_64 ${DD} - install -m 0644 ${S}/${LAUNCHER_BASE}-linux-x86_64.ini ${DD} - for dir in ./configuration ./features ./plugins; do - for item in $(find ${dir} -name '*' -print); do - if [ -d ${item} ]; then - install -d ${DD}/${item} - else - install -m 0644 ${S}/${item} ${DD}/$(dirname ${item}) - fi - done - done - install -d "${D}${bindir}" - ln -sf -T "${DD}/${LAUNCHER}" ${D}${bindir}/${LAUNCHER_LINK} -} 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 new file mode 100644 index 0000000..09199db --- /dev/null +++ b/meta-ivi-test/recipes-extended/common-api/capicxx-perf/capicxx-perf_t.inc @@ -0,0 +1,31 @@ +#!/bin/sh +get_list() { + return 1 +} + +get_title() { + echo "Common API C++ test code" +} + +_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/capicxx-perf_git.bb b/meta-ivi-test/recipes-extended/common-api/capicxx-perf_git.bb index 2263647..f468650 100644 --- a/meta-ivi-test/recipes-extended/common-api/capicxx-perf_git.bb +++ b/meta-ivi-test/recipes-extended/common-api/capicxx-perf_git.bb @@ -6,7 +6,9 @@ LIC_FILES_CHKSUM = \ PR = "r0" SRCREV = "2eacc9d7fb76957e9a5450a559675fddf0a95ce2" -SRC_URI = "git://github.com/GENIVI/capic-poc.git" +SRC_URI = "git://github.com/GENIVI/capic-poc.git \ + file://${BPN}_t.inc \ + " S = "${WORKDIR}/git/test/capicxx-perf" DEPENDS = "common-api-c++ common-api-c++-dbus capicxx-core-native capicxx-dbus-native" @@ -31,4 +33,6 @@ do_install_append() { mv ${D}/usr/bin/* ${_DEST} rmdir ${D}/usr/bin rmdir ${D}/usr + + install -m 0755 ${WORKDIR}/${BPN}_t.inc ${D}/opt/tests/${PN} } diff --git a/meta-ivi-test/recipes-extended/common-api/capicxx-someip-native_3.1.5p2.bb b/meta-ivi-test/recipes-extended/common-api/capicxx-someip-native_3.1.5p2.bb deleted file mode 100644 index d4eccb0..0000000 --- a/meta-ivi-test/recipes-extended/common-api/capicxx-someip-native_3.1.5p2.bb +++ /dev/null @@ -1,10 +0,0 @@ -SUMMARY = "Common API C++ SOME/IP generator" - -LAUNCHER_BASE = "commonapi-someip-generator" -LAUNCHER_LINK = "capicxx-someip-gen" - -require capicxx-native.inc - -SRC_URI = "${BASE_URL}/generator/${BASE_VER}/${PV}/commonapi_someip_generator.zip" -SRC_URI[md5sum] = "23196ec64737ea85b96aa754d17cf01c" -SRC_URI[sha256sum] = "5135d9df40a27d29f60785db9812a65395e077b3e61f3beaa15d08c6094f8e0d" 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 new file mode 100644 index 0000000..1c7cca9 --- /dev/null +++ b/meta-ivi-test/recipes-extended/common-api/common-api-test/common-api-test_t.inc @@ -0,0 +1,36 @@ +#!/bin/sh +get_list() { + return 1 +} + +get_title() { + echo "Common API C++ runtime" +} + +_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/common-api/common-api-test_3.1.5.bb b/meta-ivi-test/recipes-extended/common-api/common-api-test_3.1.5.bb index a286502..04b8154 100644 --- a/meta-ivi-test/recipes-extended/common-api/common-api-test_3.1.5.bb +++ b/meta-ivi-test/recipes-extended/common-api/common-api-test_3.1.5.bb @@ -4,12 +4,13 @@ LICENSE = "MIT" LIC_FILES_CHKSUM = "file://COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" PR = "r0" -inherit autotools cmake pkgconfig +inherit cmake pkgconfig DEPENDS += " common-api-c++ common-api-c++-dbus glib-2.0" SRC_URI = " \ file://${PN}-${PV}.tar.gz \ + file://${BPN}_t.inc \ " S = "${WORKDIR}/${PN}" @@ -22,6 +23,7 @@ FILES_${PN} = " \ /opt/tests/${PN}/*/commonapi4dbus.ini \ /opt/tests/${PN}/*/*Client \ /opt/tests/${PN}/*/*Service \ + /opt/tests/${PN}/${BPN}_t.inc \ ${libdir}/*.so \ " @@ -60,4 +62,6 @@ do_install() { fi install -m 0755 ${_BIN}/${i}/lib${i}-dbus.so ${D}${libdir} done + + install -m 0755 ${WORKDIR}/${BPN}_t.inc ${D}/opt/tests/${PN} } diff --git a/meta-ivi-test/recipes-extended/dlt-daemon/dlt-daemon/0001-change-file-position-for-dlt-test-filetransfer.patch b/meta-ivi-test/recipes-extended/dlt-daemon/dlt-daemon/0001-change-file-position-for-dlt-test-filetransfer.patch index 65be18e..44f5432 100644 --- a/meta-ivi-test/recipes-extended/dlt-daemon/dlt-daemon/0001-change-file-position-for-dlt-test-filetransfer.patch +++ b/meta-ivi-test/recipes-extended/dlt-daemon/dlt-daemon/0001-change-file-position-for-dlt-test-filetransfer.patch @@ -10,32 +10,32 @@ Signed-off-by: Yong-iL Joh <yong-il.joh@windriver.com> 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt -index 6a6a962..bd6808e 100644 +index 7f9dc52..8878919 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt -@@ -58,5 +58,5 @@ install(TARGETS dlt-test-multi-process dlt-test-multi-process-client dlt-test-us +@@ -70,5 +70,5 @@ install(TARGETS dlt-test-multi-process dlt-test-multi-process-client dlt-test-us COMPONENT base) INSTALL(FILES dlt-test-filetransfer-file dlt-test-filetransfer-image.png -- DESTINATION /usr/share/dlt-filetransfer +- DESTINATION share/dlt-filetransfer + DESTINATION /opt/tests/dlt-daemon/data ) diff --git a/src/tests/dlt-test-filetransfer.c b/src/tests/dlt-test-filetransfer.c -index 14b69e4..589926f 100644 +index 591714a..2a2fd1a 100644 --- a/src/tests/dlt-test-filetransfer.c +++ b/src/tests/dlt-test-filetransfer.c -@@ -362,9 +362,9 @@ int testFile3Run3(){ +@@ -369,9 +369,9 @@ int testFile3Run3(){ int main(void) { - //First file contains some text -- file1 = "/usr/share/dlt-filetransfer/dlt-test-filetransfer-file"; -+ file1 = "/opt/tests/dlt-daemon/data/dlt-test-filetransfer-file"; - //Second file is a picture -- file2 = "/usr/share/dlt-filetransfer/dlt-test-filetransfer-image.png"; -+ file2 = "/opt/tests/dlt-daemon/data/dlt-test-filetransfer-image.png"; - //Third file doesn't exist. Just to test the reaction when the file isn't available. - file3_1 = "dlt-test-filetransfer-doesntExist_1"; - //Third file doesn't exist. Just to test the reaction when the file isn't available. + //First file contains some text +- file1 = "/usr/local/share/dlt-filetransfer/dlt-test-filetransfer-file"; ++ file1 = "/opt/tests/dlt-daemon/data/dlt-test-filetransfer-file"; + //Second file is a picture +- file2 = "/usr/local/share/dlt-filetransfer/dlt-test-filetransfer-image.png"; ++ file2 = "/opt/tests/dlt-daemon/data/dlt-test-filetransfer-image.png"; + //Third file doesn't exist. Just to test the reaction when the file isn't available. + file3_1 = "dlt-test-filetransfer-doesntExist_1"; + //Third file doesn't exist. Just to test the reaction when the file isn't available. -- 1.9.1 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 new file mode 100644 index 0000000..ab96fa0 --- /dev/null +++ b/meta-ivi-test/recipes-extended/dlt-daemon/dlt-daemon/dlt-daemon_t.inc @@ -0,0 +1,37 @@ +#!/bin/sh +get_list() { + return 2 +} + +get_title() { + echo "dlt-daemon" +} + +_run_dir=/opt/tests/dlt-daemon +run_1() { + 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() { + 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/dlt-daemon/dlt-daemon_%.bbappend b/meta-ivi-test/recipes-extended/dlt-daemon/dlt-daemon_%.bbappend index 8b50f89..4f6af19 100644 --- a/meta-ivi-test/recipes-extended/dlt-daemon/dlt-daemon_%.bbappend +++ b/meta-ivi-test/recipes-extended/dlt-daemon/dlt-daemon_%.bbappend @@ -4,6 +4,7 @@ FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" SRC_URI_append += " \ file://0001-change-file-position-for-dlt-test-filetransfer.patch \ + file://${BPN}_t.inc \ " EXTRA_OECMAKE += "-DWITH_DLTTEST=ON -DCMAKE_SKIP_RPATH=ON -DWITH_MAN=OFF" @@ -12,15 +13,12 @@ do_install_append() { _BIN=${WORKDIR}/build/src/tests install -d ${D}/opt/tests/${PN}/data install -m 0755 ${_BIN}/dlt-test-* ${D}/opt/tests/${PN} + + install -m 0755 ${WORKDIR}/${BPN}_t.inc ${D}/opt/tests/${PN} } PACKAGES += "${PN}-test" DEPENDS_${PN}-test = "${PN}" -FILES_${PN}-dbg += " \ - /opt/tests/${PN}/.debug/* \ - " -FILES_${PN}-test = " \ - /opt/tests/${PN}/dlt-test* \ - /opt/tests/${PN}/data/* \ - " +FILES_${PN}-dbg += "/opt/tests/${PN}/.debug/* " +FILES_${PN}-test = "/opt/tests/${PN}/ " 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 new file mode 100644 index 0000000..8de5959 --- /dev/null +++ b/meta-ivi-test/recipes-extended/node-state-manager/node-state-manager/node-state-manager_t.inc @@ -0,0 +1,64 @@ +#!/bin/sh +get_list() { + return 1 +} + +get_title() { + echo "Node State Manager" +} + +_run_dir=/opt/tests/node-state-manager +_run_1() { + ${_run_dir}/NodeStateTest +} + +_setup_env() { + systemctl stop node-startup-controller + + _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 +} + +_lib=/usr/lib/libNodeStateMachineStub.so +_lib_2=/usr/lib/libNodeStateMachineTest.so +_lib_t=${_run_dir}/lib/libNodeStateMachineTest.so +_lib_bak=${_run_dir}/lib/libNodeStateMachineStub.so +run_1() { + if [ ! -f ${_lib_bak} ]; then + cp ${_lib} ${_run_dir}/lib + fi + cp ${_lib_t} ${_lib} + ldconfig + sleep 1 + + _setup_env + /usr/bin/NodeStateManager >& /dev/null & + sleep 2 + + 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 + + _setup_env + + rm -f ${_lib} ${_lib_2} + cp ${_lib_bak} ${_lib} + ldconfig +} diff --git a/meta-ivi-test/recipes-extended/node-state-manager/node-state-manager_%.bbappend b/meta-ivi-test/recipes-extended/node-state-manager/node-state-manager_%.bbappend index e8e8a2b..a35ecc5 100644 --- a/meta-ivi-test/recipes-extended/node-state-manager/node-state-manager_%.bbappend +++ b/meta-ivi-test/recipes-extended/node-state-manager/node-state-manager_%.bbappend @@ -1,13 +1,24 @@ # # for test # +FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" +SRC_URI_append += " \ + file://${BPN}_t.inc \ + " + +do_compile_append() { + make -C NodeStateMachineTest +} + do_install_append() { install -d ${D}/opt/tests/${PN}/lib - install -m 0755 ${S}/NodeStateTest/NodeStateTest ${D}/opt/tests/${PN} - install -m 0644 ${S}/NodeStateTest/org.genivi.NodeStateMachineTest.xml \ + install -m 0755 ${S}/NodeStateMachineTest/NodeStateTest ${D}/opt/tests/${PN} + install -m 0644 ${S}/NodeStateMachineTest/org.genivi.NodeStateMachineTest.xml \ ${D}${datadir}/dbus-1/interfaces/ - install -m 0755 ${S}/NodeStateTest/.libs/libNodeStateMachineTest.so \ + install -m 0755 ${S}/NodeStateMachineTest/.libs/libNodeStateMachineTest.so \ ${D}/opt/tests/${PN}/lib + + install -m 0755 ${WORKDIR}/${BPN}_t.inc ${D}/opt/tests/${PN} } PACKAGES += "${PN}-test" @@ -18,7 +29,7 @@ FILES_${PN}-dbg += " \ /opt/tests/${PN}/lib/.debug/* \ " FILES_${PN}-test = " \ - /opt/tests/${PN}/* \ + /opt/tests/${PN}/ \ /opt/tests/${PN}/lib/libNodeStateMachineTest.so \ ${datadir}/dbus-1/interfaces/org.genivi.NodeStateMachineTest.xml \ " 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 new file mode 100644 index 0000000..d9ff540 --- /dev/null +++ b/meta-ivi-test/recipes-extended/persistence-administrator/persistence-administrator/persistence-administrator_t.inc @@ -0,0 +1,44 @@ +#!/bin/sh +get_list() { + return 1 +} + +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 "[ 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 ${_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 + 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-administrator/persistence-administrator_%.bbappend b/meta-ivi-test/recipes-extended/persistence-administrator/persistence-administrator_%.bbappend index c1cc200..13bcb3d 100644 --- a/meta-ivi-test/recipes-extended/persistence-administrator/persistence-administrator_%.bbappend +++ b/meta-ivi-test/recipes-extended/persistence-administrator/persistence-administrator_%.bbappend @@ -1,22 +1,28 @@ # # test # +FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" +SRC_URI_append += " file://${BPN}_t.inc \ + " + do_install_append() { install -d ${D}/opt/tests/${PN} mv ${S}/test/pers_svc_test/.libs/pers_admin_test_framework \ ${D}/opt/tests/${PN} - install -d ${D}/Data + install -m 0644 ${S}/test/pers_svc_test/webtool_export/resource1.tar.gz \ + ${D}/opt/tests/${PN} install -m 0644 ${S}/test/pers_svc_test/webtool_export/resource2.tar.gz \ - ${D}/Data + ${D}/opt/tests/${PN} + install -d ${D}/Data/mnt-wt/ + touch ${D}/Data/mnt-wt/README.wt + install -d ${D}/Data/mnt-c/ + touch ${D}/Data/mnt-wt/README.c + + install -m 0755 ${WORKDIR}/${BPN}_t.inc ${D}/opt/tests/${PN} } PACKAGES += "${PN}-test" DEPENDS_${PN}-test = "${PN}" -FILES_${PN}-dbg += " \ - /opt/tests/${PN}/.debug/* \ - " -FILES_${PN}-test = " \ - /opt/tests/${PN}/* \ - /Data/resource2.tar.gz \ - " +FILES_${PN}-dbg += "/opt/tests/${PN}/.debug/* " +FILES_${PN}-test = "/opt/tests/${PN}/ /Data/* " 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 new file mode 100644 index 0000000..d39149c --- /dev/null +++ b/meta-ivi-test/recipes-extended/persistence-client-library/persistence-client-library/persistence-client-library_t.inc @@ -0,0 +1,46 @@ +#!/bin/sh +get_list() { + return 1 +} + +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 +} + +_setup_env() { + _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 + + systemctl restart pas-daemon +} + +run_1() { + _setup_env + + 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_%.bbappend b/meta-ivi-test/recipes-extended/persistence-client-library/persistence-client-library_%.bbappend index 58f2aa3..963f5fc 100644 --- a/meta-ivi-test/recipes-extended/persistence-client-library/persistence-client-library_%.bbappend +++ b/meta-ivi-test/recipes-extended/persistence-client-library/persistence-client-library_%.bbappend @@ -1,6 +1,10 @@ # # for test # +FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" +SRC_URI_append += " file://${BPN}_t.inc \ + " + EXTRA_OECONF += "--enable-tests" do_install_append() { @@ -10,15 +14,14 @@ do_install_append() { install -d ${D}/Data install -m 0644 ${S}/test/data/PAS_data.tar.gz \ ${D}/Data/Data.tar.gz + install -d ${D}/Data/mnt-c/lt-persistence_client_library_test + touch ${D}/Data/mnt-c/lt-persistence_client_library_test/BLANK + + install -m 0755 ${WORKDIR}/${BPN}_t.inc ${D}/opt/tests/${PN} } PACKAGES += "${PN}-test" DEPENDS_${PN}-test = "${PN}" -FILES_${PN}-dbg += " \ - /opt/tests/${PN}/.debug/* \ - " -FILES_${PN}-test = " \ - /opt/tests/${PN}/persistence_client_library_test \ - /Data/Data.tar.gz \ - " +FILES_${PN}-dbg += "/opt/tests/${PN}/.debug/* " +FILES_${PN}-test = "/opt/tests/${PN}/ /Data/* " 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 new file mode 100644 index 0000000..bd45a3b --- /dev/null +++ b/meta-ivi-test/recipes-extended/persistence-common-object/persistence-common-object/persistence-common-object_t.inc @@ -0,0 +1,30 @@ +#!/bin/sh +get_list() { + return 1 +} + +get_title() { + echo "persisitence-common-object" +} + +_run_dir=/opt/tests/persistence-common-object +_run_1() { + ${_run_dir}/test_pco_key_value_store +} + +run_1() { + 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-common-object/persistence-common-object_%.bbappend b/meta-ivi-test/recipes-extended/persistence-common-object/persistence-common-object_%.bbappend index 6dc26d4..dbc65bb 100644 --- a/meta-ivi-test/recipes-extended/persistence-common-object/persistence-common-object_%.bbappend +++ b/meta-ivi-test/recipes-extended/persistence-common-object/persistence-common-object_%.bbappend @@ -1,21 +1,22 @@ # # for test # +FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" +SRC_URI_append += " file://${BPN}_t.inc \ + " + EXTRA_OECONF += "--enable-tests" do_install_append() { install -d ${D}/opt/tests/${PN} install -m 0755 ${S}/test/.libs/test_pco_key_value_store \ ${D}/opt/tests/${PN} + + install -m 0755 ${WORKDIR}/${BPN}_t.inc ${D}/opt/tests/${PN} } PACKAGES += "${PN}-test" RDEPENDS_${PN}-test += " libcheck" -FILES_${PN}-dbg += " \ - /opt/tests/${PN}/.debug/* \ - " - -FILES_${PN}-test = " \ - /opt/tests/${PN}/test_pco_key_value_store \ - " +FILES_${PN}-dbg += "/opt/tests/${PN}/.debug/* " +FILES_${PN}-test = "/opt/tests/${PN}/ " |