summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bonnans <laurent.bonnans@here.com>2019-02-28 14:51:08 +0100
committerPatrick Vacek <patrickvacek@gmail.com>2019-04-29 09:20:17 +0200
commit4864f5913baccb567e768f647b41f58974283532 (patch)
treea7158b6cd8ab2359f1e8c483630fc2bb5d560df2
parent938d2b556a51148039521be825e604bb6f957d30 (diff)
downloadmeta-updater-4864f5913baccb567e768f647b41f58974283532.tar.gz
Add working ptest suite for aktualizr
Signed-off-by: Laurent Bonnans <laurent.bonnans@here.com>
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb18
-rwxr-xr-xrecipes-sota/aktualizr/files/run-ptest16
2 files changed, 33 insertions, 1 deletions
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index 21271f8..f591c44 100755
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -11,6 +11,8 @@ RDEPENDS_${PN}_class-target = "aktualizr-check-discovery aktualizr-configs lshw"
11RDEPENDS_${PN}-secondary = "aktualizr-check-discovery" 11RDEPENDS_${PN}-secondary = "aktualizr-check-discovery"
12RDEPENDS_${PN}-host-tools = "aktualizr aktualizr-repo aktualizr-cert-provider ${@bb.utils.contains('PACKAGECONFIG', 'sota-tools', 'garage-deploy garage-push', '', d)}" 12RDEPENDS_${PN}-host-tools = "aktualizr aktualizr-repo aktualizr-cert-provider ${@bb.utils.contains('PACKAGECONFIG', 'sota-tools', 'garage-deploy garage-push', '', d)}"
13 13
14RDEPENDS_${PN}-ptest += "bash cmake python3-core python3-io python3-json python3-netserver sqlite3 valgrind"
15
14PV = "1.0+git${SRCPV}" 16PV = "1.0+git${SRCPV}"
15PR = "7" 17PR = "7"
16 18
@@ -18,6 +20,7 @@ GARAGE_SIGN_PV = "0.6.0-3-gc38b9f3"
18 20
19SRC_URI = " \ 21SRC_URI = " \
20 gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \ 22 gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \
23 file://run-ptest \
21 file://aktualizr.service \ 24 file://aktualizr.service \
22 file://aktualizr-secondary.service \ 25 file://aktualizr-secondary.service \
23 file://aktualizr-secondary.socket \ 26 file://aktualizr-secondary.socket \
@@ -40,7 +43,7 @@ SYSTEMD_PACKAGES = "${PN} ${PN}-secondary"
40SYSTEMD_SERVICE_${PN} = "aktualizr.service" 43SYSTEMD_SERVICE_${PN} = "aktualizr.service"
41SYSTEMD_SERVICE_${PN}-secondary = "aktualizr-secondary.socket" 44SYSTEMD_SERVICE_${PN}-secondary = "aktualizr-secondary.socket"
42 45
43EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV}" 46EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV} ${@bb.utils.contains('PTEST_ENABLED', '1', '-DTESTSUITE_VALGRIND=on', '', d)}"
44 47
45GARAGE_SIGN_OPS = "${@ d.expand('-DGARAGE_SIGN_ARCHIVE=${WORKDIR}/cli-${GARAGE_SIGN_PV}.tgz') if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''}" 48GARAGE_SIGN_OPS = "${@ d.expand('-DGARAGE_SIGN_ARCHIVE=${WORKDIR}/cli-${GARAGE_SIGN_PV}.tgz') if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''}"
46 49
@@ -59,6 +62,19 @@ do_compile_ptest() {
59 cmake_runcmake_build --target build_tests 62 cmake_runcmake_build --target build_tests
60} 63}
61 64
65do_install_ptest() {
66 # copy the complete source directory (contains build)
67 cp -r ${B}/ ${D}/${PTEST_PATH}/build
68 cp -r ${S}/ ${D}/${PTEST_PATH}/src
69
70 # remove bogus elf file
71 rm ${D}/${PTEST_PATH}/src/partial/extern/RIOT/cpu/esp32/bin/bootloader.elf
72
73 # fix the absolute paths
74 find ${D}/${PTEST_PATH}/build -name "CMakeFiles" | xargs rm -rf
75 find ${D}/${PTEST_PATH}/build -name "*.cmake" -or -name "DartConfiguration.tcl" -or -name "run-valgrind" | xargs sed -e "s|${S}|${PTEST_PATH}/src|g" -e "s|${B}|${PTEST_PATH}/build|g" -e "s|\"--gtest_output[^\"]*\"||g" -i
76}
77
62do_install_append () { 78do_install_append () {
63 install -d ${D}${libdir}/sota 79 install -d ${D}${libdir}/sota
64 install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml 80 install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml
diff --git a/recipes-sota/aktualizr/files/run-ptest b/recipes-sota/aktualizr/files/run-ptest
new file mode 100755
index 0000000..e5f0d56
--- /dev/null
+++ b/recipes-sota/aktualizr/files/run-ptest
@@ -0,0 +1,16 @@
1#!/bin/sh
2
3set -e
4
5filter_logs() {
6 awk '/^.*Test[[:space:]]*#[[:digit:]]+:/ {
7 a = gensub(/^.*Test[[:space:]]*#[[:digit:]]+:[[:space:]]*([^[:space:]]+).*(Passed|Skipped|Not Run|Failed|Timeout|Exception)[[:space:]:].*$/, "\\2: \\1", "g");
8 a = gensub(/^Passed/, "PASS", "g", a);
9 a = gensub(/^(Skipped|Disabled)/, "SKIP", "g", a);
10 a = gensub(/^(Not Run|Failed|Timeout|Exception)/, "FAIL", "g", a);
11 print a;
12 }'
13}
14
15cd build
16ctest -j 8 -O /tmp/aktualizr-ptest.log --output-on-failure -LE 'noptest' 2> /dev/null | filter_logs