From c2a02943e3ee196b64c5753cdee02d3ea735001c Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Fri, 2 Nov 2018 12:09:54 +0100 Subject: aktualizr: attempt to get ptest enabled to build test suite. --- recipes-sota/aktualizr/aktualizr_git.bb | 10 ++++++--- ...se-aktualizr-repo-without-a-provided-path.patch | 24 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 recipes-sota/aktualizr/files/0001-Use-aktualizr-repo-without-a-provided-path.patch diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 50a9f16..002d681 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" DEPENDS = "boost curl openssl libarchive libsodium asn1c-native sqlite3 " DEPENDS_append_class-target = "ostree ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' libp11', '', d)} " DEPENDS_append_class-native = "glib-2.0-native " +DEPENDS_append = "${@bb.utils.contains('PTEST_ENABLED', '1', ' coreutils-native ostree-native aktualizr-native ', '', d)}" RDEPENDS_${PN}_class-target = "lshw " RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', ' slcand-start', '', d)} " @@ -21,6 +22,7 @@ PR = "7" SRC_URI = " \ gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \ + file://0001-Use-aktualizr-repo-without-a-provided-path.patch \ file://aktualizr.service \ file://aktualizr-secondary.service \ file://aktualizr-secondary.socket \ @@ -32,9 +34,7 @@ BRANCH ?= "master" S = "${WORKDIR}/git" -inherit cmake - -inherit systemd +inherit cmake systemd ptest SYSTEMD_PACKAGES = "${PN} ${PN}-secondary" SYSTEMD_SERVICE_${PN} = "aktualizr.service" @@ -56,6 +56,10 @@ EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON \ -DGARAGE_SIGN_VERSION=${GARAGE_SIGN_VERSION} \ -DGARAGE_SIGN_SHA256=${GARAGE_SIGN_SHA256}" +do_compile_ptest() { + cmake_runcmake_build --target build_tests +} + do_install_append () { install -d ${D}${libdir}/sota install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml diff --git a/recipes-sota/aktualizr/files/0001-Use-aktualizr-repo-without-a-provided-path.patch b/recipes-sota/aktualizr/files/0001-Use-aktualizr-repo-without-a-provided-path.patch new file mode 100644 index 0000000..29c75fc --- /dev/null +++ b/recipes-sota/aktualizr/files/0001-Use-aktualizr-repo-without-a-provided-path.patch @@ -0,0 +1,24 @@ +From f5a501f842749ba31f76526a395f09cc61435ec3 Mon Sep 17 00:00:00 2001 +From: Patrick Vacek +Date: Wed, 31 Oct 2018 14:55:48 +0100 +Subject: [PATCH] Use aktualizr-repo without a provided path. + +This is necessary for building the tests for ptest because we want to +use the native version of aktualizr-repo (built for the host). +--- + tests/uptane_repo_generation/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/uptane_repo_generation/CMakeLists.txt b/tests/uptane_repo_generation/CMakeLists.txt +index 83c14230..6f89d6a5 100644 +--- a/tests/uptane_repo_generation/CMakeLists.txt ++++ b/tests/uptane_repo_generation/CMakeLists.txt +@@ -1,4 +1,4 @@ + add_custom_target(uptane_repo_full_no_correlation_id + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/full_no_correlation_id.sh +- $ ${PROJECT_BINARY_DIR}/uptane_repos/full_no_correlation_id) ++ aktualizr-repo ${PROJECT_BINARY_DIR}/uptane_repos/full_no_correlation_id) + add_dependencies(uptane_repo_full_no_correlation_id aktualizr-repo) +-- +2.17.1 + -- cgit v1.2.3-54-g00ecf