summaryrefslogtreecommitdiffstats
path: root/recipes-sota/aktualizr/aktualizr_git.bb
diff options
context:
space:
mode:
authorLaurent Bonnans <laurent.bonnans@here.com>2019-02-28 14:51:08 +0100
committerLaurent Bonnans <laurent.bonnans@here.com>2019-03-12 11:35:37 +0100
commit81143ca5802916a5cd3a395ff36e00f8909359bc (patch)
tree0ef377abc5e3cf45d0cd9a550afecc9632ffadd2 /recipes-sota/aktualizr/aktualizr_git.bb
parent72ba172d53da21918c10f78a4386dff17f5df92d (diff)
downloadmeta-updater-81143ca5802916a5cd3a395ff36e00f8909359bc.tar.gz
Add working ptest suite for aktualizr
Signed-off-by: Laurent Bonnans <laurent.bonnans@here.com>
Diffstat (limited to 'recipes-sota/aktualizr/aktualizr_git.bb')
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb18
1 files changed, 17 insertions, 1 deletions
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index 8790fe5..9508f96 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