diff options
Diffstat (limited to 'meta-selftest/recipes-test')
98 files changed, 1234 insertions, 66 deletions
diff --git a/meta-selftest/recipes-test/aspell/aspell_0.60.8.bbappend b/meta-selftest/recipes-test/aspell/aspell_%.bbappend index 205720982c..205720982c 100644 --- a/meta-selftest/recipes-test/aspell/aspell_0.60.8.bbappend +++ b/meta-selftest/recipes-test/aspell/aspell_%.bbappend diff --git a/meta-selftest/recipes-test/aspell/aspell_0.0.0.1.bb b/meta-selftest/recipes-test/aspell/aspell_0.0.0.1.bb index 9f905a5198..e1e473fe80 100644 --- a/meta-selftest/recipes-test/aspell/aspell_0.0.0.1.bb +++ b/meta-selftest/recipes-test/aspell/aspell_0.0.0.1.bb @@ -4,8 +4,9 @@ SUMMARY = "GNU Aspell spell-checker" SECTION = "console/utils" +HOMEPAGE = "https://ftp.gnu.org/gnu/aspell/" -LICENSE = "LGPLv2 | LGPLv2.1" +LICENSE = "LGPL-2.0-only | LGPL-2.1-only" LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34" SRC_URI = "${GNU_MIRROR}/aspell/aspell-${PV}.tar.gz" @@ -19,15 +20,15 @@ PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses" PACKAGES += "libaspell libpspell libpspell-dev aspell-utils" -FILES_${PN}-dbg += "${libdir}/aspell-0.60/.debu*" -FILES_libaspell = "${libdir}/libaspell.so.* ${libdir}/aspell*" -FILES_aspell-utils = "${bindir}/word-list-compress ${bindir}/aspell-import ${bindir}/run-with-aspell ${bindir}/pre*" -FILES_${PN} = "${bindir}/aspell" -FILES_libpspell = "${libdir}/libpspell.so.*" -FILES_libpspell-dev = "${libdir}/libpspell* ${bindir}/pspell-config ${includedir}/pspell" +FILES:${PN}-dbg += "${libdir}/aspell-0.60/.debu*" +FILES:libaspell = "${libdir}/libaspell.so.* ${libdir}/aspell*" +FILES:aspell-utils = "${bindir}/word-list-compress ${bindir}/aspell-import ${bindir}/run-with-aspell ${bindir}/pre*" +FILES:${PN} = "${bindir}/aspell" +FILES:libpspell = "${libdir}/libpspell.so.*" +FILES:libpspell-dev = "${libdir}/libpspell* ${bindir}/pspell-config ${includedir}/pspell" -ARM_INSTRUCTION_SET_armv4 = "arm" -ARM_INSTRUCTION_SET_armv5 = "arm" -ARM_INSTRUCTION_SET_armv6 = "arm" +ARM_INSTRUCTION_SET:armv4 = "arm" +ARM_INSTRUCTION_SET:armv5 = "arm" +ARM_INSTRUCTION_SET:armv6 = "arm" inherit autotools gettext diff --git a/meta-selftest/recipes-test/base-files/base-files_%.bbappend b/meta-selftest/recipes-test/base-files/base-files_%.bbappend new file mode 100644 index 0000000000..205720982c --- /dev/null +++ b/meta-selftest/recipes-test/base-files/base-files_%.bbappend @@ -0,0 +1,2 @@ +# This bbappend is used to alter the recipe using the test_recipe.inc file created by tests. +include test_recipe.inc diff --git a/meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb b/meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb new file mode 100644 index 0000000000..f9fc59a494 --- /dev/null +++ b/meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb @@ -0,0 +1,17 @@ +LICENSE = "MIT" + +inherit allarch systemd update-rc.d + +do_install() { + install -d ${D}${systemd_system_unitdir} + touch ${D}${systemd_system_unitdir}/${BPN}.service + + install -d ${D}${INIT_D_DIR} + touch ${D}${INIT_D_DIR}/${BPN} +} + +INITSCRIPT_NAME = "${BPN}" + +SYSTEMD_SERVICE:${PN} = "${BPN}.service" + +EXCLUDE_FROM_WORLD="1" diff --git a/meta-selftest/recipes-test/bbclasses/systemd-only.bb b/meta-selftest/recipes-test/bbclasses/systemd-only.bb new file mode 100644 index 0000000000..590a27b9cb --- /dev/null +++ b/meta-selftest/recipes-test/bbclasses/systemd-only.bb @@ -0,0 +1,12 @@ +LICENSE = "MIT" + +inherit allarch systemd + +do_install() { + install -d ${D}${systemd_system_unitdir} + touch ${D}${systemd_system_unitdir}/${BPN}.service +} + +SYSTEMD_SERVICE:${PN} = "${BPN}.service" + +EXCLUDE_FROM_WORLD="1" diff --git a/meta-selftest/recipes-test/binutils/binutils_%.bbappend b/meta-selftest/recipes-test/binutils/binutils_%.bbappend new file mode 100644 index 0000000000..205720982c --- /dev/null +++ b/meta-selftest/recipes-test/binutils/binutils_%.bbappend @@ -0,0 +1,2 @@ +# This bbappend is used to alter the recipe using the test_recipe.inc file created by tests. +include test_recipe.inc diff --git a/meta-selftest/recipes-test/container-image/container-image-testpkg.bb b/meta-selftest/recipes-test/container-image/container-image-testpkg.bb index f8dd2290b3..929bc29753 100644 --- a/meta-selftest/recipes-test/container-image/container-image-testpkg.bb +++ b/meta-selftest/recipes-test/container-image/container-image-testpkg.bb @@ -2,7 +2,7 @@ LICENSE = "MIT" INHIBIT_DEFAULT_DEPS = "1" -do_install_append() { +do_install:append() { install -d ${D}${bindir} touch ${D}${bindir}/theapp } diff --git a/meta-selftest/recipes-test/cpp/.gitignore b/meta-selftest/recipes-test/cpp/.gitignore new file mode 100644 index 0000000000..30d388a12b --- /dev/null +++ b/meta-selftest/recipes-test/cpp/.gitignore @@ -0,0 +1 @@ +build*
\ No newline at end of file diff --git a/meta-selftest/recipes-test/cpp/cmake-example.bb b/meta-selftest/recipes-test/cpp/cmake-example.bb new file mode 100644 index 0000000000..aecfcf780a --- /dev/null +++ b/meta-selftest/recipes-test/cpp/cmake-example.bb @@ -0,0 +1,25 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +SUMMARY = "A C++ example compiled with cmake." + +require cpp-example.inc + +SRC_URI += "file://CMakeLists.txt" + +inherit cmake-qemu + +PACKAGECONFIG[failing_test] = "-DFAILING_TEST=ON" + +FILES:${PN}-ptest += "${bindir}/test-cmake-example" + +do_run_tests () { + bbnote ${DESTDIR:+DESTDIR=${DESTDIR} }${CMAKE_VERBOSE} cmake --build '${B}' --target test -- ${EXTRA_OECMAKE_BUILD} + eval ${DESTDIR:+DESTDIR=${DESTDIR} }${CMAKE_VERBOSE} cmake --build '${B}' --target test -- ${EXTRA_OECMAKE_BUILD} +} +do_run_tests[doc] = "Run cmake --target=test using qemu-user" + +addtask do_run_tests after do_compile diff --git a/meta-selftest/recipes-test/cpp/cmake-example/run-ptest b/meta-selftest/recipes-test/cpp/cmake-example/run-ptest new file mode 100644 index 0000000000..94b620a198 --- /dev/null +++ b/meta-selftest/recipes-test/cpp/cmake-example/run-ptest @@ -0,0 +1,10 @@ +#!/bin/sh +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +test-cmake-example + +# Note: run-ptests exits with exit value from test-cmake-example diff --git a/meta-selftest/recipes-test/cpp/cpp-example.inc b/meta-selftest/recipes-test/cpp/cpp-example.inc new file mode 100644 index 0000000000..41aaa7219a --- /dev/null +++ b/meta-selftest/recipes-test/cpp/cpp-example.inc @@ -0,0 +1,25 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +DEPENDS += "json-c" + +PV = "1.0" + +SRC_URI = "\ + file://cpp-example.cpp \ + file://cpp-example-lib.hpp \ + file://cpp-example-lib.cpp \ + file://test-cpp-example.cpp \ + file://run-ptest \ +" + +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" + +inherit ptest diff --git a/meta-selftest/recipes-test/cpp/files/CMakeLists.txt b/meta-selftest/recipes-test/cpp/files/CMakeLists.txt new file mode 100644 index 0000000000..6fa6917d89 --- /dev/null +++ b/meta-selftest/recipes-test/cpp/files/CMakeLists.txt @@ -0,0 +1,61 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +cmake_minimum_required(VERSION 3.22) + +project(cmake-example + VERSION 1.0.0 + LANGUAGES CXX +) + +option(BUILD_SHARED_LIBS "Build using shared libraries" ON) +option(FAILING_TEST "Compile a failing unit test to test the test infrastructure" OFF) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED On) +set(CMAKE_CXX_EXTENSIONS Off) + +include(GNUInstallDirs) + +# Linking a small library makes the example more useful for testing. +find_package(json-c) + +# A simple library linking json-c library found by pkgconfig +add_library(cmake-example-lib cpp-example-lib.cpp cpp-example-lib.hpp) +set_target_properties(cmake-example-lib PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} +) +target_link_libraries(cmake-example-lib PRIVATE json-c::json-c) + +install(TARGETS cmake-example-lib + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +# A simple executable linking the library +add_executable(cmake-example cpp-example.cpp) +target_link_libraries(cmake-example PRIVATE cmake-example-lib) + +install(TARGETS cmake-example + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +# A simple test executable for testing the library +add_executable(test-cmake-example test-cpp-example.cpp) +target_link_libraries(test-cmake-example PRIVATE cmake-example-lib) + +if (FAILING_TEST) + target_compile_definitions(test-cmake-example PRIVATE FAIL_COMPARISON_STR="foo") +endif(FAILING_TEST) + +install(TARGETS test-cmake-example + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +include(CTest) +add_test(NAME test-cmake-example COMMAND test-cmake-example) diff --git a/meta-selftest/recipes-test/cpp/files/cpp-example-lib.cpp b/meta-selftest/recipes-test/cpp/files/cpp-example-lib.cpp new file mode 100644 index 0000000000..d3dc976864 --- /dev/null +++ b/meta-selftest/recipes-test/cpp/files/cpp-example-lib.cpp @@ -0,0 +1,33 @@ +/* + * Copyright OpenEmbedded Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include <iostream> +#include <string> +#include <json-c/json.h> +#include "cpp-example-lib.hpp" + +const std::string &CppExample::get_string() +{ + return test_string; +} + +const char *CppExample::get_json_c_version() +{ + return json_c_version(); +} + +void CppExample::print_json() +{ + struct json_object *jobj; + const int flag = JSON_C_TO_STRING_SPACED | JSON_C_TO_STRING_PRETTY; + + jobj = json_object_new_object(); + json_object_object_add(jobj, "test_string", json_object_new_string(test_string.c_str())); + + std::cout << json_object_to_json_string_ext(jobj, flag) << std::endl; + + json_object_put(jobj); // Delete the json object +} diff --git a/meta-selftest/recipes-test/cpp/files/cpp-example-lib.hpp b/meta-selftest/recipes-test/cpp/files/cpp-example-lib.hpp new file mode 100644 index 0000000000..0ad9e7b7b2 --- /dev/null +++ b/meta-selftest/recipes-test/cpp/files/cpp-example-lib.hpp @@ -0,0 +1,21 @@ +/* + * Copyright OpenEmbedded Contributors + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +#include <string> + +struct CppExample +{ + inline static const std::string test_string = "cpp-example-lib Magic: 123456789"; + + /* Retrieve a constant string */ + const std::string &get_string(); + /* Retrieve a constant string from a library */ + const char *get_json_c_version(); + /* Call a more advanced function from a library */ + void print_json(); +}; diff --git a/meta-selftest/recipes-test/cpp/files/cpp-example.cpp b/meta-selftest/recipes-test/cpp/files/cpp-example.cpp new file mode 100644 index 0000000000..9889554e0c --- /dev/null +++ b/meta-selftest/recipes-test/cpp/files/cpp-example.cpp @@ -0,0 +1,18 @@ +/* + * Copyright OpenEmbedded Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "cpp-example-lib.hpp" + +#include <iostream> + +int main() +{ + auto cpp_example = CppExample(); + std::cout << "C++ example linking " << cpp_example.get_string() << std::endl; + std::cout << "Linking json-c version " << cpp_example.get_json_c_version() << std::endl; + cpp_example.print_json(); + return 0; +} diff --git a/meta-selftest/recipes-test/cpp/files/meson.build b/meta-selftest/recipes-test/cpp/files/meson.build new file mode 100644 index 0000000000..0e2b55f3a2 --- /dev/null +++ b/meta-selftest/recipes-test/cpp/files/meson.build @@ -0,0 +1,38 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +project('meson-example', 'cpp', + version: '1.0.0', + default_options: ['cpp_std=c++17'] + ) + +jsoncdep = dependency('json-c') + +if get_option('FAILING_TEST').enabled() + add_project_arguments('-DFAIL_COMPARISON_STR=foo', language: 'cpp') +endif + +mesonexlib = shared_library('mesonexlib', + 'cpp-example-lib.cpp', 'cpp-example-lib.hpp', + version: meson.project_version(), + soversion: meson.project_version().split('.')[0], + dependencies : jsoncdep, + install : true + ) + +executable('mesonex', + 'cpp-example.cpp', + link_with : mesonexlib, + install : true + ) + +test_mesonex = executable('test-mesonex', + 'test-cpp-example.cpp', + link_with : mesonexlib, + install : true +) + +test('meson example test', test_mesonex) diff --git a/meta-selftest/recipes-test/cpp/files/meson.options b/meta-selftest/recipes-test/cpp/files/meson.options new file mode 100644 index 0000000000..58a0bf9e61 --- /dev/null +++ b/meta-selftest/recipes-test/cpp/files/meson.options @@ -0,0 +1,3 @@ + +option('FAILING_TEST', type : 'feature', value : 'disabled', + description : 'Compile a failing unit test to test the test infrastructure') diff --git a/meta-selftest/recipes-test/cpp/files/test-cpp-example.cpp b/meta-selftest/recipes-test/cpp/files/test-cpp-example.cpp new file mode 100644 index 0000000000..83c9bfa844 --- /dev/null +++ b/meta-selftest/recipes-test/cpp/files/test-cpp-example.cpp @@ -0,0 +1,25 @@ +/* +* Copyright OpenEmbedded Contributors +* +* SPDX-License-Identifier: MIT +*/ + +#include "cpp-example-lib.hpp" + +#include <iostream> + +/* This is for creating a failing test for testing the test infrastructure */ +#ifndef FAIL_COMPARISON_STR +#define FAIL_COMPARISON_STR "" +#endif + +int main() { + auto cpp_example = CppExample(); + auto ret_string = cpp_example.get_string(); + if(0 == ret_string.compare(CppExample::test_string + FAIL_COMPARISON_STR)) { + std::cout << "PASS: " << ret_string << " = " << CppExample::test_string << std::endl; + } else { + std::cout << "FAIL: " << ret_string << " != " << CppExample::test_string << std::endl; + return 1; + } +} diff --git a/meta-selftest/recipes-test/cpp/meson-example.bb b/meta-selftest/recipes-test/cpp/meson-example.bb new file mode 100644 index 0000000000..14a7ca8dc9 --- /dev/null +++ b/meta-selftest/recipes-test/cpp/meson-example.bb @@ -0,0 +1,27 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +SUMMARY = "A C++ example compiled with meson." + +require cpp-example.inc + +SRC_URI += "\ + file://meson.build \ + file://meson.options \ +" + +inherit pkgconfig meson + +PACKAGECONFIG[failing_test] = "-DFAILING_TEST=enabled" + +FILES:${PN}-ptest += "${bindir}/test-mesonex" + +do_run_tests () { + meson test -C "${B}" --no-rebuild +} +do_run_tests[doc] = "Run meson test using qemu-user" + +addtask do_run_tests after do_compile diff --git a/meta-selftest/recipes-test/cpp/meson-example/run-ptest b/meta-selftest/recipes-test/cpp/meson-example/run-ptest new file mode 100644 index 0000000000..b1804f0096 --- /dev/null +++ b/meta-selftest/recipes-test/cpp/meson-example/run-ptest @@ -0,0 +1,10 @@ +#!/bin/sh +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +test-mesonex + +# Note: run-ptests exits with exit value from test-mesonex diff --git a/meta-selftest/recipes-test/devtool/devtool-patch-overrides.bb b/meta-selftest/recipes-test/devtool/devtool-patch-overrides.bb new file mode 100644 index 0000000000..f12bee0b3d --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-patch-overrides.bb @@ -0,0 +1,8 @@ +SUMMARY = "devtool test for overrides and patches" +LICENSE = "CLOSED" +INHIBIT_DEFAULT_DEPS = "1" +EXCLUDE_FROM_WORLD = "1" + +SRC_URI = "file://source;subdir=${BP}" +SRC_URI:append:qemuarm = " file://arm.patch;striplevel=0" +SRC_URI:append:qemux86 = " file://x86.patch;striplevel=0" diff --git a/meta-selftest/recipes-test/devtool/devtool-patch-overrides/qemuarm/arm.patch b/meta-selftest/recipes-test/devtool/devtool-patch-overrides/qemuarm/arm.patch new file mode 100644 index 0000000000..17ed5a54f1 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-patch-overrides/qemuarm/arm.patch @@ -0,0 +1,7 @@ +Upstream-Status: Inappropriate [Test artefact] + +--- source.orig 2020-10-06 13:26:10.792688630 +0100 ++++ source 2020-10-06 13:26:18.853424694 +0100 +@@ -1 +1 @@ +-This is a test for something ++This is a test for qemuarm diff --git a/meta-selftest/recipes-test/devtool/devtool-patch-overrides/qemux86/x86.patch b/meta-selftest/recipes-test/devtool/devtool-patch-overrides/qemux86/x86.patch new file mode 100644 index 0000000000..0af5ebbfaf --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-patch-overrides/qemux86/x86.patch @@ -0,0 +1,7 @@ +Upstream-Status: Inappropriate [Test artefact] + +--- source.orig 2020-10-06 13:26:10.792688630 +0100 ++++ source 2020-10-06 13:26:18.853424694 +0100 +@@ -1 +1 @@ +-This is a test for something ++This is a test for qemux86 diff --git a/meta-selftest/recipes-test/devtool/devtool-patch-overrides/source b/meta-selftest/recipes-test/devtool/devtool-patch-overrides/source new file mode 100644 index 0000000000..cc14ce627c --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-patch-overrides/source @@ -0,0 +1 @@ +This is a test for something diff --git a/meta-selftest/recipes-test/devtool/devtool-test-ignored.bb b/meta-selftest/recipes-test/devtool/devtool-test-ignored.bb new file mode 100644 index 0000000000..6a3d58c884 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-ignored.bb @@ -0,0 +1,9 @@ +LICENSE = "CLOSED" +INHIBIT_DEFAULT_DEPS = "1" + +SRC_URI = "file://${BPN}.tar.gz \ + file://${BPN}.patch" + +S = "${WORKDIR}/${BPN}" + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-selftest/recipes-test/devtool/devtool-test-ignored/devtool-test-ignored.patch b/meta-selftest/recipes-test/devtool/devtool-test-ignored/devtool-test-ignored.patch new file mode 100644 index 0000000000..bc1ca4bc4a --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-ignored/devtool-test-ignored.patch @@ -0,0 +1,9 @@ +Upstream-Status: Inappropriate [Test artefact] + +diff --git a/ignored b/ignored +index a579759..e3d7b43 100644 +--- a/ignored ++++ b/ignored +@@ -1 +1 @@ +-I'm so ignored ++# I'm so ignored diff --git a/meta-selftest/recipes-test/devtool/devtool-test-ignored/devtool-test-ignored.patch.expected b/meta-selftest/recipes-test/devtool/devtool-test-ignored/devtool-test-ignored.patch.expected new file mode 100644 index 0000000000..8ead9ee1ce --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-ignored/devtool-test-ignored.patch.expected @@ -0,0 +1,17 @@ +From 3a286343cc5cadd83f41d524ee3606ae51df9ee7 Mon Sep 17 00:00:00 2001 +From: Martin Jansa <Martin.Jansa@gmail.com> +Date: Thu, 28 May 2020 01:32:31 +0200 +Subject: [PATCH] meta-selftest: add test of .gitignore in tarball + +Upstream-Status: Inappropriate [Test artefact] +--- + ignored | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ignored b/ignored +index a579759..e3d7b43 100644 +--- a/ignored ++++ b/ignored +@@ -1 +1 @@ +-I'm so ignored ++# I'm so ignored diff --git a/meta-selftest/recipes-test/devtool/devtool-test-ignored/devtool-test-ignored.tar.gz b/meta-selftest/recipes-test/devtool/devtool-test-ignored/devtool-test-ignored.tar.gz Binary files differnew file mode 100644 index 0000000000..b2e9935eb9 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-ignored/devtool-test-ignored.tar.gz diff --git a/meta-selftest/recipes-test/devtool/devtool-test-local/file3 b/meta-selftest/recipes-test/devtool/devtool-test-local/file3 new file mode 100644 index 0000000000..0f30e9eec4 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-local/file3 @@ -0,0 +1 @@ +The third file. diff --git a/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb b/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb index 6bfc557060..d0fd697978 100644 --- a/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb +++ b/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb @@ -1,4 +1,4 @@ -LICENSE = "GPLv2+" +LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" INHIBIT_DEFAULT_DEPS = "1" @@ -7,9 +7,12 @@ SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/syslinux-${PV}.tar.x file://file1 \ file://file2" +SRC_URI:append:class-native = " file://file3" + SRC_URI[md5sum] = "92a253df9211e9c20172796ecf388f13" SRC_URI[sha256sum] = "26d3986d2bea109d5dc0e4f8c4822a459276cf021125e8c9f23c3cca5d8c850e" S = "${WORKDIR}/syslinux-${PV}" EXCLUDE_FROM_WORLD = "1" +BBCLASSEXTEND = "native" diff --git a/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb b/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb index 3f7123cda0..446c51f09b 100644 --- a/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb +++ b/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb @@ -4,4 +4,10 @@ INHIBIT_DEFAULT_DEPS = "1" SRC_URI = "file://file1 \ file://file2" +SRC_URI:append:class-native = " file://file3" + +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" + EXCLUDE_FROM_WORLD = "1" +BBCLASSEXTEND = "native" diff --git a/meta-selftest/recipes-test/devtool/devtool-test-localonly/file3 b/meta-selftest/recipes-test/devtool/devtool-test-localonly/file3 new file mode 100644 index 0000000000..0f30e9eec4 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-localonly/file3 @@ -0,0 +1 @@ +The third file. diff --git a/meta-selftest/recipes-test/devtool/devtool-test-long-filename.bb b/meta-selftest/recipes-test/devtool/devtool-test-long-filename.bb new file mode 100644 index 0000000000..3ec22cae7f --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-long-filename.bb @@ -0,0 +1,9 @@ +LICENSE = "CLOSED" +INHIBIT_DEFAULT_DEPS = "1" + +SRC_URI = "file://${BPN}.tar.gz \ + file://0001-I-ll-patch-you-only-if-devtool-lets-me-to-do-it-corr.patch" + +S = "${WORKDIR}/${BPN}" + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-selftest/recipes-test/devtool/devtool-test-long-filename/0001-I-ll-patch-you-only-if-devtool-lets-me-to-do-it-corr.patch b/meta-selftest/recipes-test/devtool/devtool-test-long-filename/0001-I-ll-patch-you-only-if-devtool-lets-me-to-do-it-corr.patch new file mode 100644 index 0000000000..2b7088e367 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-long-filename/0001-I-ll-patch-you-only-if-devtool-lets-me-to-do-it-corr.patch @@ -0,0 +1,9 @@ +Upstream-Status: Inappropriate [Test artefact] + +diff --git a/patch-me b/patch-me +index a20b29a..5e35d1b 100644 +--- a/patch-me ++++ b/patch-me +@@ -1 +1 @@ +-please ++NO diff --git a/meta-selftest/recipes-test/devtool/devtool-test-long-filename/0001-I-ll-patch-you-only-if-devtool-lets-me-to-do-it-corr.patch.expected b/meta-selftest/recipes-test/devtool/devtool-test-long-filename/0001-I-ll-patch-you-only-if-devtool-lets-me-to-do-it-corr.patch.expected new file mode 100644 index 0000000000..52b0df74ce --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-long-filename/0001-I-ll-patch-you-only-if-devtool-lets-me-to-do-it-corr.patch.expected @@ -0,0 +1,17 @@ +From 45ba3d107ea60777a6b6e134fd00fe5009749177 Mon Sep 17 00:00:00 2001 +From: Martin Jansa <Martin.Jansa@gmail.com> +Date: Thu, 28 May 2020 02:03:39 +0200 +Subject: [PATCH] meta-selftest: add test for .patch file with long filename + +Upstream-Status: Inappropriate [Test artefact] +--- + patch-me | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/patch-me b/patch-me +index a20b29a..5e35d1b 100644 +--- a/patch-me ++++ b/patch-me +@@ -1 +1 @@ +-please ++NO diff --git a/meta-selftest/recipes-test/devtool/devtool-test-long-filename/devtool-test-long-filename.tar.gz b/meta-selftest/recipes-test/devtool/devtool-test-long-filename/devtool-test-long-filename.tar.gz Binary files differnew file mode 100644 index 0000000000..ab6242aae7 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-long-filename/devtool-test-long-filename.tar.gz diff --git a/meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb b/meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb index fc3799590c..e25b3d9747 100644 --- a/meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb +++ b/meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb @@ -1,4 +1,4 @@ -LICENSE = "GPLv2+" +LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" DEPENDS = "libxres libxext virtual/libx11 ncurses" diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test1-1.5.3/0001-Add-a-note-line-to-the-quick-reference.patch b/meta-selftest/recipes-test/devtool/devtool-upgrade-test1-1.5.3/0001-Add-a-note-line-to-the-quick-reference.patch index 4ea3d74f0f..db66a284b7 100644 --- a/meta-selftest/recipes-test/devtool/devtool-upgrade-test1-1.5.3/0001-Add-a-note-line-to-the-quick-reference.patch +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test1-1.5.3/0001-Add-a-note-line-to-the-quick-reference.patch @@ -4,6 +4,8 @@ Date: Wed, 24 Feb 2016 17:43:03 +1300 Subject: [PATCH] Add a note line to the quick reference A test patch so we have a file to move around. + +Upstream-Status: Inappropriate [Test artefact] --- doc/quickref.1.in | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test1-1.5.3/backported.patch b/meta-selftest/recipes-test/devtool/devtool-upgrade-test1-1.5.3/backported.patch index c4f3f12666..5159652f69 100644 --- a/meta-selftest/recipes-test/devtool/devtool-upgrade-test1-1.5.3/backported.patch +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test1-1.5.3/backported.patch @@ -4,6 +4,8 @@ Date: Mon Nov 18 18:43:15 2019 +0100 Backport of the NEWS file from version 1.6.0 +Upstream-Status: Inappropriate [Test artefact] + diff --git a/doc/NEWS b/doc/NEWS index 69793fc..fd49b1c 100644 --- a/doc/NEWS diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded b/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded index 66e45c7e84..d75df0c8c7 100644 --- a/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded @@ -9,7 +9,6 @@ SRC_URI = "http://www.ivarch.com/programs/sources/pv-${PV}.tar.gz \ UPSTREAM_CHECK_URI = "http://www.ivarch.com/programs/pv.shtml" RECIPE_NO_UPDATE_REASON = "This recipe is used to test devtool upgrade feature" -SRC_URI[md5sum] = "062bca5ff33df1dd09472e7fc3bbe332" SRC_URI[sha256sum] = "9dd45391806b0ed215abee4c5ac1597d018c386fe9c1f5afd2f6bc3b07fd82c3" S = "${WORKDIR}/pv-${PV}" diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb b/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb index 07b83276fb..2558a22ce5 100644 --- a/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb @@ -1,17 +1,17 @@ SUMMARY = "A simple tool to wait for a specific signal over DBus" HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/dbus-wait" SECTION = "base" -LICENSE = "GPLv2" +LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" DEPENDS = "dbus" # Note: this is intentionally not the latest version in the original .bb SRCREV = "1a3e1343761b30750bed70e0fd688f6d3c7b3717" -PV = "0.1+git${SRCPV}" +PV = "0.1+git" PR = "r2" -SRC_URI = "git://git.yoctoproject.org/dbus-wait" +SRC_URI = "git://git.yoctoproject.org/dbus-wait;branch=master" UPSTREAM_CHECK_COMMITS = "1" RECIPE_NO_UPDATE_REASON = "This recipe is used to test devtool upgrade feature" diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded b/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded index 32ec4b14fa..eaa8bd898d 100644 --- a/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded @@ -1,16 +1,16 @@ SUMMARY = "A simple tool to wait for a specific signal over DBus" HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/dbus-wait" SECTION = "base" -LICENSE = "GPLv2" +LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" DEPENDS = "dbus" # Note: this is intentionally not the latest version in the original .bb SRCREV = "6cc6077a36fe2648a5f993fe7c16c9632f946517" -PV = "0.1+git${SRCPV}" +PV = "0.1+git" -SRC_URI = "git://git.yoctoproject.org/dbus-wait" +SRC_URI = "git://git.yoctoproject.org/dbus-wait;branch=master" UPSTREAM_CHECK_COMMITS = "1" RECIPE_NO_UPDATE_REASON = "This recipe is used to test devtool upgrade feature" diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test3_1.5.3.bb b/meta-selftest/recipes-test/devtool/devtool-upgrade-test3_1.5.3.bb new file mode 100644 index 0000000000..69c0d351ec --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test3_1.5.3.bb @@ -0,0 +1,16 @@ +SUMMARY = "Pipe viewer test recipe for devtool upgrade test" +LICENSE = "Artistic-2.0" +LIC_FILES_CHKSUM = "file://doc/COPYING;md5=9c50db2589ee3ef10a9b7b2e50ce1d02" + +SRC_URI = "http://www.ivarch.com/programs/sources/pv-${PV}.tar.gz" +UPSTREAM_CHECK_URI = "http://www.ivarch.com/programs/pv.shtml" +RECIPE_NO_UPDATE_REASON = "This recipe is used to test devtool upgrade feature" + +SRC_URI[md5sum] = "9365d86bd884222b4bf1039b5a9ed1bd" + +S = "${WORKDIR}/pv-${PV}" + +EXCLUDE_FROM_WORLD = "1" + +inherit autotools + diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test3_1.5.3.bb.upgraded b/meta-selftest/recipes-test/devtool/devtool-upgrade-test3_1.5.3.bb.upgraded new file mode 100644 index 0000000000..3ce7e85e10 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test3_1.5.3.bb.upgraded @@ -0,0 +1,15 @@ +SUMMARY = "Pipe viewer test recipe for devtool upgrade test" +LICENSE = "Artistic-2.0" +LIC_FILES_CHKSUM = "file://doc/COPYING;md5=9c50db2589ee3ef10a9b7b2e50ce1d02" + +SRC_URI[sha256sum] = "9dd45391806b0ed215abee4c5ac1597d018c386fe9c1f5afd2f6bc3b07fd82c3" +SRC_URI = "http://www.ivarch.com/programs/sources/pv-${PV}.tar.gz" +UPSTREAM_CHECK_URI = "http://www.ivarch.com/programs/pv.shtml" +RECIPE_NO_UPDATE_REASON = "This recipe is used to test devtool upgrade feature" + +S = "${WORKDIR}/pv-${PV}" + +EXCLUDE_FROM_WORLD = "1" + +inherit autotools + diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test4_1.5.3.bb b/meta-selftest/recipes-test/devtool/devtool-upgrade-test4_1.5.3.bb new file mode 100644 index 0000000000..9abf80e6ed --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test4_1.5.3.bb @@ -0,0 +1,22 @@ +SUMMARY = "Pipe viewer test recipe for devtool upgrade test" +LICENSE = "Artistic-2.0" +LIC_FILES_CHKSUM = "file://doc/COPYING;md5=9c50db2589ee3ef10a9b7b2e50ce1d02" + +SRC_URI = "http://www.ivarch.com/programs/sources/pv-${PV}.tar.gz" +UPSTREAM_CHECK_URI = "http://www.ivarch.com/programs/pv.shtml" +RECIPE_NO_UPDATE_REASON = "This recipe is used to test devtool upgrade feature" + +SRC_URI[md5sum] = "9365d86bd884222b4bf1039b5a9ed1bd" +SRC_URI[sha1sum] = "63a0801350e812541c7f8e9ad74e0d6b629d0b39" +SRC_URI[sha256sum] = "681bcca9784bf3cb2207e68236d1f68e2aa7b80f999b5750dc77dcd756e81fbc" +SRC_URI[sha384sum] = "5fff6390465ff23dbf573fcf39dfad3aed2f92074a35e6c02abe58b7678858d90fa6572ff4cb56df8b3e217c739cdbe3" +SRC_URI[sha512sum] = "32efe7071a363f547afc74e96774f711795edda1d2702823a347d0f9953e859b7d8c45b3e63e18ffb9e0d5ed5910be652d7d727c8676e81b6cb3aed0b13aec00" + +PR = "r5" + +S = "${WORKDIR}/pv-${PV}" + +EXCLUDE_FROM_WORLD = "1" + +inherit autotools + diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test4_1.5.3.bb.upgraded b/meta-selftest/recipes-test/devtool/devtool-upgrade-test4_1.5.3.bb.upgraded new file mode 100644 index 0000000000..cd2a0842f4 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test4_1.5.3.bb.upgraded @@ -0,0 +1,19 @@ +SUMMARY = "Pipe viewer test recipe for devtool upgrade test" +LICENSE = "Artistic-2.0" +LIC_FILES_CHKSUM = "file://doc/COPYING;md5=9c50db2589ee3ef10a9b7b2e50ce1d02" + +SRC_URI = "http://www.ivarch.com/programs/sources/pv-${PV}.tar.gz" +UPSTREAM_CHECK_URI = "http://www.ivarch.com/programs/pv.shtml" +RECIPE_NO_UPDATE_REASON = "This recipe is used to test devtool upgrade feature" + +SRC_URI[sha1sum] = "395ce62f4f3e035b86c77038f04b96c5aa233595" +SRC_URI[sha256sum] = "9dd45391806b0ed215abee4c5ac1597d018c386fe9c1f5afd2f6bc3b07fd82c3" +SRC_URI[sha384sum] = "218c8d2d097aeba5310be759bc20573f18ffa0b11701eac6dd2e7e14ddf13c6e0e094ca7ca026eaa05ef92a056402e36" +SRC_URI[sha512sum] = "1cf9d7376fceefcd594d0a8b591afc8e11ce89f7210d10ad74438974ecebe9cc5d9ec4db9cc79e0566bfd2b0278c0cc263c07547803e7536432cd1ffd32d8a45" + +S = "${WORKDIR}/pv-${PV}" + +EXCLUDE_FROM_WORLD = "1" + +inherit autotools + diff --git a/meta-selftest/recipes-test/fortran/fortran-helloworld.bb b/meta-selftest/recipes-test/fortran/fortran-helloworld.bb index 3a46404477..11928dc95a 100644 --- a/meta-selftest/recipes-test/fortran/fortran-helloworld.bb +++ b/meta-selftest/recipes-test/fortran/fortran-helloworld.bb @@ -6,12 +6,15 @@ DEPENDS = "libgfortran" SRC_URI = "file://hello.f95" +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" + # These set flags that Fortran doesn't support SECURITY_CFLAGS = "" SECURITY_LDFLAGS = "" do_compile() { - ${FC} ${LDFLAGS} ${WORKDIR}/hello.f95 -o ${B}/fortran-hello + ${FC} ${LDFLAGS} hello.f95 -o ${B}/fortran-hello } do_install() { diff --git a/meta-selftest/recipes-test/gcc-source/gcc-source_%.bbappend b/meta-selftest/recipes-test/gcc-source/gcc-source_%.bbappend new file mode 100644 index 0000000000..205720982c --- /dev/null +++ b/meta-selftest/recipes-test/gcc-source/gcc-source_%.bbappend @@ -0,0 +1,2 @@ +# This bbappend is used to alter the recipe using the test_recipe.inc file created by tests. +include test_recipe.inc diff --git a/meta-selftest/recipes-test/git-submodule-test/git-submodule-test.bb b/meta-selftest/recipes-test/git-submodule-test/git-submodule-test.bb new file mode 100644 index 0000000000..90d9b66b2c --- /dev/null +++ b/meta-selftest/recipes-test/git-submodule-test/git-submodule-test.bb @@ -0,0 +1,26 @@ +SUMMARY = "Test recipe for fetching git submodules" +HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/git-submodule-test/" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +INHIBIT_DEFAULT_DEPS = "1" + +UPSTREAM_VERSION_UNKNOWN = "1" + +SRC_URI = "gitsm://git.yoctoproject.org/git-submodule-test;branch=master" +SRCREV = "a2885dd7d25380d23627e7544b7bbb55014b16ee" + +S = "${WORKDIR}/git" + +do_test_git_as_user() { + cd ${S} + git status +} +addtask test_git_as_user after do_unpack + +fakeroot do_test_git_as_root() { + cd ${S} + git status +} +do_test_git_as_root[depends] += "virtual/fakeroot-native:do_populate_sysroot" +addtask test_git_as_root after do_unpack diff --git a/meta-selftest/recipes-test/gitrepotest/gitrepotest.bb b/meta-selftest/recipes-test/gitrepotest/gitrepotest.bb new file mode 100644 index 0000000000..f1b6c55833 --- /dev/null +++ b/meta-selftest/recipes-test/gitrepotest/gitrepotest.bb @@ -0,0 +1,16 @@ +SUMMARY = "Test recipe for git repo initialization" +HOMEPAGE = "https://git.yoctoproject.org/git/matchbox-panel-2" +LICENSE = "GPL-2.0-or-later" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" + +INHIBIT_DEFAULT_DEPS = "1" + +PATCHTOOL="git" + +SRC_URI = "git://git.yoctoproject.org/git/matchbox-panel-2;branch=master;protocol=https \ + file://0001-testpatch.patch \ + " + +SRCREV = "f82ca3f42510fb3ef10f598b393eb373a2c34ca7" + +S = "${WORKDIR}/git" diff --git a/meta-selftest/recipes-test/gitrepotest/gitrepotest/0001-testpatch.patch b/meta-selftest/recipes-test/gitrepotest/gitrepotest/0001-testpatch.patch new file mode 100644 index 0000000000..4f8b745995 --- /dev/null +++ b/meta-selftest/recipes-test/gitrepotest/gitrepotest/0001-testpatch.patch @@ -0,0 +1,11 @@ +Upstream-Status: Inappropriate [Test artefact] + +diff --git a/Makefile.am b/Makefile.am +index 432a9b4..bbf7c74 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,3 +1,4 @@ ++## This is useless comment to test if patch works + ACLOCAL_AMFLAGS = -I m4 + + SUBDIRS = matchbox-panel applets data po diff --git a/meta-selftest/recipes-test/gitunpackoffline/gitunpackoffline-fail.bb b/meta-selftest/recipes-test/gitunpackoffline/gitunpackoffline-fail.bb new file mode 100644 index 0000000000..5146129666 --- /dev/null +++ b/meta-selftest/recipes-test/gitunpackoffline/gitunpackoffline-fail.bb @@ -0,0 +1,4 @@ +require gitunpackoffline.inc + +# Clear the base.bbclass magic srcrev call +fetcher_hashes_dummyfunc[vardepvalue] = "" diff --git a/meta-selftest/recipes-test/gitunpackoffline/gitunpackoffline.bb b/meta-selftest/recipes-test/gitunpackoffline/gitunpackoffline.bb new file mode 100644 index 0000000000..d9a54690b2 --- /dev/null +++ b/meta-selftest/recipes-test/gitunpackoffline/gitunpackoffline.bb @@ -0,0 +1,5 @@ +require gitunpackoffline.inc + +TAGVALUE = "2.11" + +PV = "0.0+git" diff --git a/meta-selftest/recipes-test/gitunpackoffline/gitunpackoffline.inc b/meta-selftest/recipes-test/gitunpackoffline/gitunpackoffline.inc new file mode 100644 index 0000000000..602e895199 --- /dev/null +++ b/meta-selftest/recipes-test/gitunpackoffline/gitunpackoffline.inc @@ -0,0 +1,16 @@ +SUMMARY = "Test recipe for fetching git submodules" +HOMEPAGE = "https://git.yoctoproject.org/git/matchbox-panel-2" +LICENSE = "GPL-2.0-or-later" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" + +INHIBIT_DEFAULT_DEPS = "1" + +TAGVALUE = "2.10" + +# Deliberately have a tag which has to be resolved but ensure do_unpack doesn't access the network again. +SRC_URI = "git://git.yoctoproject.org/git/matchbox-panel-2;branch=master;protocol=https" +SRC_URI:append:gitunpack-enable-recipe = ";tag=${TAGVALUE}" +SRCREV = "f82ca3f42510fb3ef10f598b393eb373a2c34ca7" +SRCREV:gitunpack-enable-recipe = "" + +S = "${WORKDIR}/git" diff --git a/meta-selftest/recipes-test/images/oe-selftest-image.bb b/meta-selftest/recipes-test/images/oe-selftest-image.bb index 5d4d10eef6..317a0712aa 100644 --- a/meta-selftest/recipes-test/images/oe-selftest-image.bb +++ b/meta-selftest/recipes-test/images/oe-selftest-image.bb @@ -1,6 +1,7 @@ SUMMARY = "An image used during oe-selftest tests" -IMAGE_INSTALL = "packagegroup-core-boot dropbear" +# libudev is needed for deploy mdadm via devtool +IMAGE_INSTALL = "packagegroup-core-boot packagegroup-core-ssh-dropbear libudev" IMAGE_FEATURES = "debug-tweaks" IMAGE_LINGUAS = " " diff --git a/meta-selftest/recipes-test/images/wic-image-minimal.bb b/meta-selftest/recipes-test/images/wic-image-minimal.bb index e1da203b59..84d3721885 100644 --- a/meta-selftest/recipes-test/images/wic-image-minimal.bb +++ b/meta-selftest/recipes-test/images/wic-image-minimal.bb @@ -6,7 +6,10 @@ IMAGE_INSTALL = "packagegroup-core-boot" IMAGE_FSTYPES = "wic" -WKS_FILE_DEPENDS = "syslinux syslinux-native dosfstools-native mtools-native gptfdisk-native" +WKS_FILE_DEPENDS = "dosfstools-native mtools-native gptfdisk-native" +WKS_FILE_DEPENDS:append:x86 = " syslinux-native syslinux" +WKS_FILE_DEPENDS:append:x86-64 = " syslinux-native syslinux" +WKS_FILE_DEPENDS:append:x86-x32 = " syslinux-native syslinux" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" diff --git a/meta-selftest/recipes-test/license/incompatible-license-alias.bb b/meta-selftest/recipes-test/license/incompatible-license-alias.bb index e0b4e13c26..1af99e7809 100644 --- a/meta-selftest/recipes-test/license/incompatible-license-alias.bb +++ b/meta-selftest/recipes-test/license/incompatible-license-alias.bb @@ -1,3 +1,5 @@ SUMMARY = "Recipe with an alias of an SPDX license" DESCRIPTION = "Is licensed with an alias of an SPDX license to be used for testing" LICENSE = "GPLv3" + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-selftest/recipes-test/license/incompatible-license.bb b/meta-selftest/recipes-test/license/incompatible-license.bb index 1728ad76b7..6fdc58fd30 100644 --- a/meta-selftest/recipes-test/license/incompatible-license.bb +++ b/meta-selftest/recipes-test/license/incompatible-license.bb @@ -1,3 +1,5 @@ SUMMARY = "Recipe with an SPDX license" DESCRIPTION = "Is licensed with an SPDX license to be used for testing" -LICENSE = "GPL-3.0" +LICENSE = "GPL-3.0-only" + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-selftest/recipes-test/license/incompatible-licenses.bb b/meta-selftest/recipes-test/license/incompatible-licenses.bb new file mode 100644 index 0000000000..47bd8d7c00 --- /dev/null +++ b/meta-selftest/recipes-test/license/incompatible-licenses.bb @@ -0,0 +1,5 @@ +SUMMARY = "Recipe with multiple SPDX licenses" +DESCRIPTION = "Is licensed with multiple SPDX licenses to be used for testing" +LICENSE = "GPL-2.0-only & GPL-3.0-only & LGPL-3.0-only" + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-selftest/recipes-test/license/incompatible-nonspdx-license.bb b/meta-selftest/recipes-test/license/incompatible-nonspdx-license.bb index 35af0966ef..142d73158e 100644 --- a/meta-selftest/recipes-test/license/incompatible-nonspdx-license.bb +++ b/meta-selftest/recipes-test/license/incompatible-nonspdx-license.bb @@ -1,3 +1,5 @@ SUMMARY = "Recipe with a non-SPDX license" DESCRIPTION = "Is licensed with a non-SPDX license to be used for testing" LICENSE = "FooLicense" + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-selftest/recipes-test/logging-test/logging-test.bb b/meta-selftest/recipes-test/logging-test/logging-test.bb new file mode 100644 index 0000000000..ac3fb46f45 --- /dev/null +++ b/meta-selftest/recipes-test/logging-test/logging-test.bb @@ -0,0 +1,34 @@ +SUMMARY = "Destined to fail" +LICENSE = "CLOSED" + +deltask do_patch +INHIBIT_DEFAULT_DEPS = "1" + +do_shelltest() { + echo "This is shell stdout" + echo "This is shell stderr" >&2 + exit 1 +} +addtask do_shelltest + +python do_pythontest_exec_func_shell() { + bb.build.exec_func('do_shelltest', d) +} +addtask do_pythontest_exec_func_shell + +python do_pythontest_exit () { + print("This is python stdout") + sys.exit(1) +} +addtask do_pythontest_exit + +python do_pythontest_exec_func_python() { + bb.build.exec_func('do_pythontest_exit', d) +} +addtask do_pythontest_exec_func_python + +python do_pythontest_fatal () { + print("This is python fatal test stdout") + bb.fatal("This is a fatal error") +} +addtask do_pythontest_fatal diff --git a/meta-selftest/recipes-test/man-db/files/0001-Test-patch-here.patch b/meta-selftest/recipes-test/man-db/files/0001-Test-patch-here.patch index b1d5eab2b8..7df224e5c8 100644 --- a/meta-selftest/recipes-test/man-db/files/0001-Test-patch-here.patch +++ b/meta-selftest/recipes-test/man-db/files/0001-Test-patch-here.patch @@ -4,6 +4,8 @@ Date: Fri, 9 Feb 2018 17:37:48 +0200 Subject: [PATCH] Test patch here! This is an invalid patch used by oe-selftest + +Upstream-Status: Inappropriate [Test artefact] --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb b/meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb index a76a6bea1b..d7785cee2e 100644 --- a/meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb +++ b/meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb @@ -1,21 +1,25 @@ LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" -MCMACHINE_virtclass-mcextend-musl = "qemux86-64" -MCMACHINE_virtclass-mcextend-tiny = "qemux86" -MCIMGTYPE_virtclass-mcextend-musl = "ext4" -MCIMGTYPE_virtclass-mcextend-tiny = "cpio.gz" +MCMACHINE:virtclass-mcextend-musl = "qemux86-64" +MCMACHINE:virtclass-mcextend-tiny = "qemux86" +MCIMGTYPE:virtclass-mcextend-musl = "ext4" +MCIMGTYPE:virtclass-mcextend-tiny = "cpio.gz" MC_DEPLOY_DIR_IMAGE = "${TOPDIR}/tmp-mc-${MCNAME}/deploy/images/${MCMACHINE}" +MC_DEPLOY_IMAGE_BASENAME = "core-image-minimal" do_install[mcdepends] += "mc::${MCNAME}:core-image-minimal:do_image_complete mc::${MCNAME}:virtual/kernel:do_deploy" do_install () { install -d ${D}/var/lib/machines/${MCNAME} - install ${MC_DEPLOY_DIR_IMAGE}/core-image-minimal-${MCMACHINE}.${MCIMGTYPE} ${D}/var/lib/machines/${MCNAME}/core-image-minimal.${MCIMGTYPE} + install ${MC_DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME_CORE_IMAGE_MINIMAL}.${MCIMGTYPE} ${D}/var/lib/machines/${MCNAME}/${MC_DEPLOY_IMAGE_BASENAME}.${MCIMGTYPE} install ${MC_DEPLOY_DIR_IMAGE}/bzImage ${D}/var/lib/machines/${MCNAME} } +# for IMAGE_LINK_NAME, IMAGE_BASENAME +inherit image-artifact-names + python () { mcname = d.getVar('MCNAME') if not mcname: @@ -23,6 +27,18 @@ python () { multiconfigs = d.getVar('BBMULTICONFIG') or "" if mcname not in multiconfigs: raise bb.parse.SkipRecipe("multiconfig target %s not enabled" % mcname) + + # these will most likely start with my BPN multiconfig-image-packager, but I want them from core-image-minimal + # as there is no good way to query core-image-minimal's context lets assume that there are no overrides + # and that we can just replace IMAGE_BASENAME + image_link_name = d.getVar('IMAGE_LINK_NAME') + image_basename = d.getVar('IMAGE_BASENAME') + machine = d.getVar('MACHINE') + mcmachine = d.getVar('MCMACHINE') + image_to_deploy = d.getVar('MC_DEPLOY_IMAGE_BASENAME') + image_link_name_to_deploy = image_link_name.replace(image_basename, image_to_deploy).replace(machine, mcmachine) + bb.warn('%s: assuming that "%s" built for "%s" has IMAGE_LINK_NAME "%s"' % (d.getVar('PN'), mcmachine, image_to_deploy, image_link_name_to_deploy)) + d.setVar('IMAGE_LINK_NAME_CORE_IMAGE_MINIMAL', image_link_name_to_deploy) } BBCLASSEXTEND = "mcextend:tiny mcextend:musl" diff --git a/meta-selftest/recipes-test/nopackages/selftest-nopackages.bb b/meta-selftest/recipes-test/nopackages/selftest-nopackages.bb new file mode 100644 index 0000000000..154df910e4 --- /dev/null +++ b/meta-selftest/recipes-test/nopackages/selftest-nopackages.bb @@ -0,0 +1,6 @@ +SUMMARY = "Test recipe for nopackages bbclass" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +INHIBIT_DEFAULT_DEPS = "1" +inherit nopackages diff --git a/meta-selftest/recipes-test/overlayfs-user/overlayfs-user.bb b/meta-selftest/recipes-test/overlayfs-user/overlayfs-user.bb new file mode 100644 index 0000000000..3b59e37619 --- /dev/null +++ b/meta-selftest/recipes-test/overlayfs-user/overlayfs-user.bb @@ -0,0 +1,22 @@ +SUMMARY = "Overlayfs class unit test" +DESCRIPTION = "Contains an overlayfs configuration" +LICENSE = "MIT" + +INHIBIT_DEFAULT_DEPS = "1" +EXCLUDE_FROM_WORLD = "1" + +inherit_defer ${@bb.utils.contains("DISTRO_FEATURES", "overlayfs", "overlayfs", "", d)} +include test_recipe.inc + +OVERLAYFS_WRITABLE_PATHS[mnt-overlay] += "/usr/share/my-application" + +do_install() { + install -d ${D}/usr/share/my-application + install -d ${D}${sysconfdir} + echo "Original file in /etc" >> ${D}${sysconfdir}/lower-layer-test.txt +} + +FILES:${PN} += "\ + ${exec_prefix} \ + ${sysconfdir} \ +" diff --git a/meta-selftest/recipes-test/packagenameconflict/packagenameconflict.bb b/meta-selftest/recipes-test/packagenameconflict/packagenameconflict.bb new file mode 100644 index 0000000000..5d19a4dd25 --- /dev/null +++ b/meta-selftest/recipes-test/packagenameconflict/packagenameconflict.bb @@ -0,0 +1,10 @@ +SUMMARY = "Test case that tries to rename a package to an existing one and fails" +DESCRIPTION = "This generates a packaging error when a package is renamed to a pre-existing name" +LICENSE = "MIT" + +# Add a new package ${PN}-renametest +PACKAGES += "${PN}-renametest" +# ... and try to rename the ${PN}-dev to the new ${PN}-renametest (conflict) +PKG:${PN}-dev = "${PN}-renametest" + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-selftest/recipes-test/perlcross/perlcross_%.bbappend b/meta-selftest/recipes-test/perlcross/perlcross_%.bbappend new file mode 100644 index 0000000000..205720982c --- /dev/null +++ b/meta-selftest/recipes-test/perlcross/perlcross_%.bbappend @@ -0,0 +1,2 @@ +# This bbappend is used to alter the recipe using the test_recipe.inc file created by tests. +include test_recipe.inc diff --git a/meta-selftest/recipes-test/poison/poison.bb b/meta-selftest/recipes-test/poison/poison.bb new file mode 100644 index 0000000000..e9eee0cdba --- /dev/null +++ b/meta-selftest/recipes-test/poison/poison.bb @@ -0,0 +1,20 @@ +SUMMARY = "Sysroot poisoning test" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +LICENSE = "MIT" + +inherit nopackages + +# This test confirms that compiling code that searches /usr/include for headers +# will result in compiler errors. This recipe should will fail to build and +# oe-selftest has a test that verifies that. +do_compile() { + bbnote Testing preprocessor + echo "int main(int argc, char** argv) {}" | ${CPP} -I/usr/include - + bbnote Testing C compiler + echo "int main(int argc, char** argv) {}" | ${CC} -x c -I/usr/include - + bbnote Testing C++ compiler + echo "int main(int argc, char** argv) {}" | ${CC} -x c++ -I/usr/include - +} + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-selftest/recipes-test/postinst/postinst_1.0.bb b/meta-selftest/recipes-test/postinst/postinst_1.0.bb index 913bfabf89..b936c4f44b 100644 --- a/meta-selftest/recipes-test/postinst/postinst_1.0.bb +++ b/meta-selftest/recipes-test/postinst/postinst_1.0.bb @@ -5,19 +5,19 @@ inherit allarch PACKAGES = "${PN}-rootfs ${PN}-delayed-a ${PN}-delayed-b ${PN}-rootfs-failing" -ALLOW_EMPTY_${PN}-rootfs = "1" -ALLOW_EMPTY_${PN}-delayed-a = "1" -ALLOW_EMPTY_${PN}-delayed-b = "1" -ALLOW_EMPTY_${PN}-rootfs-failing = "1" +ALLOW_EMPTY:${PN}-rootfs = "1" +ALLOW_EMPTY:${PN}-delayed-a = "1" +ALLOW_EMPTY:${PN}-delayed-b = "1" +ALLOW_EMPTY:${PN}-rootfs-failing = "1" -RDEPENDS_${PN}-delayed-a = "${PN}-rootfs" -RDEPENDS_${PN}-delayed-b = "${PN}-delayed-a" +RDEPENDS:${PN}-delayed-a = "${PN}-rootfs" +RDEPENDS:${PN}-delayed-b = "${PN}-delayed-a" TESTDIR = "${sysconfdir}/postinst-test" # At rootfs time touch $TESTDIR/rootfs. Errors if the file already exists, or # if the function runs on first boot. -pkg_postinst_${PN}-rootfs () { +pkg_postinst:${PN}-rootfs () { set -e if [ -z "$D" ]; then @@ -36,7 +36,7 @@ pkg_postinst_${PN}-rootfs () { # Depends on rootfs, delays until first boot, verifies that the rootfs file was # written. -pkg_postinst_ontarget_${PN}-delayed-a () { +pkg_postinst_ontarget:${PN}-delayed-a () { set -e if [ ! -e ${TESTDIR}/rootfs ]; then @@ -49,7 +49,7 @@ pkg_postinst_ontarget_${PN}-delayed-a () { # Depends on delayed-a, delays until first boot, verifies that the delayed-a file was # written. This verifies the ordering between delayed postinsts. -pkg_postinst_ontarget_${PN}-delayed-b () { +pkg_postinst_ontarget:${PN}-delayed-b () { set -e if [ ! -e ${TESTDIR}/delayed-a ]; then @@ -62,7 +62,7 @@ pkg_postinst_ontarget_${PN}-delayed-b () { # This scriptlet intentionally includes a bogus command in the middle to test # that we catch and report such errors properly. -pkg_postinst_${PN}-rootfs-failing () { +pkg_postinst:${PN}-rootfs-failing () { mkdir -p $D${TESTDIR} touch $D${TESTDIR}/rootfs-before-failure run_a_really_broken_command diff --git a/meta-selftest/recipes-test/pseudo-pyc-test/pseudo-pyc-test.bb b/meta-selftest/recipes-test/pseudo-pyc-test/pseudo-pyc-test.bb new file mode 100644 index 0000000000..12dc91a8f3 --- /dev/null +++ b/meta-selftest/recipes-test/pseudo-pyc-test/pseudo-pyc-test.bb @@ -0,0 +1,15 @@ +SUMMARY = "pseudo env test" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +INHIBIT_DEFAULT_DEPS = "1" + +python do_compile() { + import pseudo_pyc_test1 + print(pseudo_pyc_test1.STRING) +} + +python do_install() { + import pseudo_pyc_test2 + print(pseudo_pyc_test2.STRING) +} diff --git a/meta-selftest/recipes-test/recipetool/files/add-file.patch b/meta-selftest/recipes-test/recipetool/files/add-file.patch index bdc99c94f0..cb43cc629d 100644 --- a/meta-selftest/recipes-test/recipetool/files/add-file.patch +++ b/meta-selftest/recipes-test/recipetool/files/add-file.patch @@ -1,3 +1,5 @@ +Upstream-Status: Inappropriate [Test artefact] + diff --git a/file2 b/file2 new file mode 100644 index 0000000..049b42e diff --git a/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-src-globfile b/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-src-globfile deleted file mode 100644 index 1e20a2b03e..0000000000 --- a/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-src-globfile +++ /dev/null @@ -1 +0,0 @@ -A file matched by a glob in SRC_URI diff --git a/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb b/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb index 7375c47933..7698413d4d 100644 --- a/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb +++ b/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb @@ -10,7 +10,6 @@ SRC_URI = "file://installscript.sh \ file://file1 \ file://add-file.patch \ file://subdir \ - file://selftest-replaceme-src-glob* \ file://selftest-replaceme-inst-globfile \ file://selftest-replaceme-inst-todir-globfile \ file://selftest-replaceme-inst-func" @@ -18,27 +17,26 @@ SRC_URI = "file://installscript.sh \ EXCLUDE_FROM_WORLD = "1" install_extrafunc() { - install -m 0644 ${WORKDIR}/selftest-replaceme-inst-func ${D}${datadir}/selftest-replaceme-inst-func + install -m 0644 ${UNPACKDIR}/selftest-replaceme-inst-func ${D}${datadir}/selftest-replaceme-inst-func } do_install() { install -d ${D}${datadir}/ - install -m 0644 ${WORKDIR}/selftest-replaceme-orig ${D}${datadir}/selftest-replaceme-orig - install -m 0644 ${WORKDIR}/selftest-replaceme-todir ${D}${datadir} - install -m 0644 ${WORKDIR}/file1 ${D}${datadir}/selftest-replaceme-renamed - install -m 0644 ${WORKDIR}/subdir/fileinsubdir ${D}${datadir}/selftest-replaceme-subdir - install -m 0644 ${WORKDIR}/selftest-replaceme-src-globfile ${D}${datadir}/selftest-replaceme-src-globfile - cp ${WORKDIR}/selftest-replaceme-inst-glob* ${D}${datadir}/selftest-replaceme-inst-globfile - cp ${WORKDIR}/selftest-replaceme-inst-todir-glob* ${D}${datadir} + install -m 0644 ${UNPACKDIR}/selftest-replaceme-orig ${D}${datadir}/selftest-replaceme-orig + install -m 0644 ${UNPACKDIR}/selftest-replaceme-todir ${D}${datadir} + install -m 0644 ${UNPACKDIR}/file1 ${D}${datadir}/selftest-replaceme-renamed + install -m 0644 ${UNPACKDIR}/subdir/fileinsubdir ${D}${datadir}/selftest-replaceme-subdir + cp ${UNPACKDIR}/selftest-replaceme-inst-glob* ${D}${datadir}/selftest-replaceme-inst-globfile + cp ${UNPACKDIR}/selftest-replaceme-inst-todir-glob* ${D}${datadir} install -d ${D}${sysconfdir} install -m 0644 ${S}/file2 ${D}${sysconfdir}/selftest-replaceme-patched - sh ${WORKDIR}/installscript.sh ${D}${datadir} + sh ${UNPACKDIR}/installscript.sh ${D}${datadir} install_extrafunc } -pkg_postinst_${PN} () { +pkg_postinst:${PN} () { echo "Test file installed by postinst" > $D${datadir}/selftest-replaceme-postinst } -FILES_${PN} += "${datadir}" +FILES:${PN} += "${datadir}" diff --git a/meta-selftest/recipes-test/recipeutils/recipeutils-test_1.2.bb b/meta-selftest/recipes-test/recipeutils/recipeutils-test_1.2.bb index 0cd0494da8..8b314d396e 100644 --- a/meta-selftest/recipes-test/recipeutils/recipeutils-test_1.2.bb +++ b/meta-selftest/recipes-test/recipeutils/recipeutils-test_1.2.bb @@ -2,12 +2,15 @@ SUMMARY = "Test recipe for recipeutils.patch_recipe()" require recipeutils-test.inc -LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://${WORKDIR}/somefile;md5=d41d8cd98f00b204e9800998ecf8427e" +LICENSE = "HPND" +LIC_FILES_CHKSUM = "file://${UNPACKDIR}/somefile;md5=d41d8cd98f00b204e9800998ecf8427e" DEPENDS += "zlib" +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" + BBCLASSEXTEND = "native nativesdk" SRC_URI += "file://somefile" -SRC_URI_append = " file://anotherfile" +SRC_URI:append = " file://anotherfile" diff --git a/meta-selftest/recipes-test/selftest-chown/selftest-chown.bb b/meta-selftest/recipes-test/selftest-chown/selftest-chown.bb new file mode 100644 index 0000000000..a0eeb4f223 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-chown/selftest-chown.bb @@ -0,0 +1,31 @@ +SUMMARY = "selftest chown" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +LICENSE = "MIT" + +DEPENDS += "coreutils-native" + +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" + +inherit useradd allarch + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "-u 1234 -M test" +TESTDIR = "${D}${sysconfdir}/selftest-chown" + +do_install() { + install -d ${TESTDIR} + install -d ${TESTDIR}/dir + touch ${TESTDIR}/file + ln -s ./file ${TESTDIR}/symlink + install -d ${TESTDIR}/fifotest + mkfifo ${TESTDIR}/fifotest/fifo + + chown test:test ${TESTDIR}/file + chown -R test:test ${TESTDIR}/dir + chown -h test:test ${TESTDIR}/symlink + chown -R test:test ${TESTDIR}/fifotest +} + +FILES:${PN} = "${sysconfdir}/selftest-chown/*" diff --git a/meta-selftest/recipes-test/selftest-ed/selftest-ed_0.5.bb b/meta-selftest/recipes-test/selftest-ed/selftest-ed_0.5.bb index 8e0d1cdd8e..1a140a532f 100644 --- a/meta-selftest/recipes-test/selftest-ed/selftest-ed_0.5.bb +++ b/meta-selftest/recipes-test/selftest-ed/selftest-ed_0.5.bb @@ -1,11 +1,10 @@ -SUMMARY = "Line-oriented text editor -- selftest GPLv2 version" +SUMMARY = "Line-oriented text editor -- selftest GPL-2.0-or-later version" HOMEPAGE = "http://www.gnu.org/software/ed/" SECTION = "base" -LICENSE = "GPLv2+" +LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=6ddd5335ef96fb858a138230af773710 \ file://main.c;beginline=1;endline=17;md5=36d4b85e5ae9028e918d1cc775c2475e" -PR = "r2" SRC_URI = "${SAVANNAH_GNU_MIRROR}/ed/ed-${PV}.tar.bz2" SRC_URI[md5sum] = "4ee21e9dcc9b5b6012c23038734e1632" @@ -17,6 +16,8 @@ S = "${WORKDIR}/ed-${PV}" EXTRA_OECONF = "'CC=${CC}' 'CXX=${CXX}' 'CFLAGS=${CFLAGS}' 'CXXFLAGS=${CXXFLAGS}' 'CPPFLAGS=${CPPFLAGS}' 'LDFLAGS=${LDFLAGS}'" -CONFIGUREOPTS_remove = "--disable-dependency-tracking" -CONFIGUREOPTS_remove = "--disable-silent-rules" -EXTRA_OECONF_remove = "--disable-static" +CONFIGUREOPTS:remove = "--disable-dependency-tracking" +CONFIGUREOPTS:remove = "--disable-silent-rules" +EXTRA_OECONF:remove = "--disable-static" + +BBCLASSEXTEND = "native" diff --git a/meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb b/meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb index 8a2b565ce5..b92740de32 100644 --- a/meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb +++ b/meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb @@ -1,7 +1,7 @@ SUMMARY = "Line-oriented text editor -- selftest variant" HOMEPAGE = "http://www.gnu.org/software/ed/" -LICENSE = "GPLv3+" +LICENSE = "GPL-3.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=0c7051aef9219dc7237f206c5c4179a7 \ file://ed.h;endline=20;md5=4e36b7a40e137f42aee718165590d125 \ file://main.c;endline=17;md5=c5b8f78f115df187af76868a2aead16a" @@ -34,3 +34,5 @@ do_install() { rm -f ${D}${infodir}/dir fi } + +BBCLASSEXTEND = "native" diff --git a/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb b/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb index 842a9772cb..64fea8ed95 100644 --- a/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb +++ b/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb @@ -6,15 +6,19 @@ SRC_URI = "file://hello.c \ file://gdb.sh \ " -S = "${WORKDIR}" +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" do_compile () { ${CC} hello.c -o hello1 ${CFLAGS} ${LDFLAGS} + + ${CC} hello.c -c -o hello.o ${CFLAGS} + ${AR} rcs libhello.a hello.o } do_install () { install -d ${D}${bindir} - install -m 755 ${WORKDIR}/gdb.sh ${D}${bindir}/ + install -m 755 ${S}/gdb.sh ${D}${bindir}/ install -m 755 hello1 ${D}${bindir}/hello1 ln ${D}${bindir}/hello1 ${D}${bindir}/hello2 @@ -22,9 +26,19 @@ do_install () { ln ${D}${bindir}/hello1 ${D}${libexecdir}/hello3 ln ${D}${bindir}/hello1 ${D}${libexecdir}/hello4 + # We need so many hardlink copies to look for specific race conditions + install -d ${D}${libdir} + install -m 0644 libhello.a ${D}${libdir} + for num in `seq 1 100` ; do + ln ${D}${libdir}/libhello.a ${D}${libdir}/libhello-${num}.a + done + dd if=/dev/zero of=${D}${bindir}/sparsetest bs=1 count=0 seek=1M } -RDEPENDS_${PN}-gdb += "gdb" +RDEPENDS:${PN}-gdb += "gdb" PACKAGES =+ "${PN}-gdb" -FILES_${PN}-gdb = "${bindir}/gdb.sh" +FILES:${PN}-gdb = "${bindir}/gdb.sh" + +PACKAGE_STRIP_STATIC = "1" +PACKAGE_DEBUG_STATIC_SPLIT = "1" diff --git a/meta-selftest/recipes-test/selftest-hello/files/helloworld.c b/meta-selftest/recipes-test/selftest-hello/files/helloworld.c new file mode 100644 index 0000000000..fc7169b7b8 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-hello/files/helloworld.c @@ -0,0 +1,8 @@ +#include <stdio.h> + +int main(void) +{ + printf("Hello world!\n"); + + return 0; +} diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb new file mode 100644 index 0000000000..2dc352d479 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb @@ -0,0 +1,20 @@ +DESCRIPTION = "Simple helloworld application -- selftest variant" +SECTION = "examples" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = "file://helloworld.c" + +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" + +do_compile() { + ${CC} ${CFLAGS} ${LDFLAGS} helloworld.c -o helloworld +} + +do_install() { + install -d ${D}${bindir} + install -m 0755 helloworld ${D}${bindir} +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-selftest/recipes-test/selftest-users/acreategroup.bb b/meta-selftest/recipes-test/selftest-users/acreategroup.bb new file mode 100644 index 0000000000..7805182d48 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-users/acreategroup.bb @@ -0,0 +1,33 @@ +SUMMARY = "creategroup_a" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +LICENSE = "MIT" + +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" + +EXCLUDE_FROM_WORLD="1" + +inherit useradd allarch + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "-u 5560 --gid a_group a_user" +GROUPADD_PARAM:${PN} = "-r a_group" + +TESTDIR = "${D}${sysconfdir}/creategroup" + +do_install() { + install -d ${TESTDIR} + install -d ${TESTDIR}/dir + touch ${TESTDIR}/file + ln -s ./file ${TESTDIR}/symlink + install -d ${TESTDIR}/fifotest + mkfifo ${TESTDIR}/fifotest/fifo + + chown a_user:a_group ${TESTDIR}/file + chown -R a_user:a_group ${TESTDIR}/dir + chown -h a_user:a_group ${TESTDIR}/symlink + chown -R a_user:a_group ${TESTDIR}/fifotest +} + +FILES:${PN} = "${sysconfdir}/creategroup/*" diff --git a/meta-selftest/recipes-test/selftest-users/bcreategroup.bb b/meta-selftest/recipes-test/selftest-users/bcreategroup.bb new file mode 100644 index 0000000000..b15c07d7b2 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-users/bcreategroup.bb @@ -0,0 +1,38 @@ +SUMMARY = "creategroup_b" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +LICENSE = "MIT" + +# This recipe requires a and c. C requires A. Reverse alpha. + +USERADD_DEPENDS = "acreategroup ccreategroup" + +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" + +EXCLUDE_FROM_WORLD="1" + +inherit useradd allarch + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "-u 5561 -g b_group -G a_group,c_group b_user " +GROUPADD_PARAM:${PN} = "-r b_group" + +TESTDIR = "${D}${sysconfdir}/creategroup" + +do_install() { + install -d ${TESTDIR} + install -d ${TESTDIR}/dir + touch ${TESTDIR}/file + ln -s ./file ${TESTDIR}/symlink + install -d ${TESTDIR}/fifotest + mkfifo ${TESTDIR}/fifotest/fifo + + chown a_user:a_group ${TESTDIR}/file + chown -R c_user:c_group ${TESTDIR}/dir + chown -h a_user:a_group ${TESTDIR}/symlink + chown -R b_user:b_group ${TESTDIR}/fifotest +} + +FILES:${PN} = "${sysconfdir}/creategroup/*" + diff --git a/meta-selftest/recipes-test/selftest-users/ccreategroup.bb b/meta-selftest/recipes-test/selftest-users/ccreategroup.bb new file mode 100644 index 0000000000..ff2da1c039 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-users/ccreategroup.bb @@ -0,0 +1,35 @@ +SUMMARY = "creategroup_c" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +LICENSE = "MIT" + +USERADD_DEPENDS = "acreategroup" + +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" + +EXCLUDE_FROM_WORLD="1" + +inherit useradd allarch + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "-u 5563 --gid c_group -G a_group c_user" +GROUPADD_PARAM:${PN} = "-r c_group" + +TESTDIR = "${D}${sysconfdir}/creategroup" + +do_install() { + install -d ${TESTDIR} + install -d ${TESTDIR}/dir + touch ${TESTDIR}/file + ln -s ./file ${TESTDIR}/symlink + install -d ${TESTDIR}/fifotest + mkfifo ${TESTDIR}/fifotest/fifo + + chown c_user:c_group ${TESTDIR}/file + chown -R c_user:c_group ${TESTDIR}/dir + chown -h c_user:c_group ${TESTDIR}/symlink + chown -R c_user:c_group ${TESTDIR}/fifotest +} + +FILES:${PN} = "${sysconfdir}/creategroup/*" diff --git a/meta-selftest/recipes-test/selftest-users/creategroup1.bb b/meta-selftest/recipes-test/selftest-users/creategroup1.bb new file mode 100644 index 0000000000..4ab278f589 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-users/creategroup1.bb @@ -0,0 +1,31 @@ +SUMMARY = "creategroup pt 1" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +LICENSE = "MIT" + +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" + +inherit useradd allarch + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "-u 5555 --gid grouptest gt1" +GROUPADD_PARAM:${PN} = "-r grouptest" + +TESTDIR = "${D}${sysconfdir}/creategroup" + +do_install() { + install -d ${TESTDIR} + install -d ${TESTDIR}/dir + touch ${TESTDIR}/file + ln -s ./file ${TESTDIR}/symlink + install -d ${TESTDIR}/fifotest + mkfifo ${TESTDIR}/fifotest/fifo + + chown gt1:grouptest ${TESTDIR}/file + chown -R gt1:grouptest ${TESTDIR}/dir + chown -h gt1:grouptest ${TESTDIR}/symlink + chown -R gt1:grouptest ${TESTDIR}/fifotest +} + +FILES:${PN} = "${sysconfdir}/creategroup/*" diff --git a/meta-selftest/recipes-test/selftest-users/creategroup2.bb b/meta-selftest/recipes-test/selftest-users/creategroup2.bb new file mode 100644 index 0000000000..179aba9bfc --- /dev/null +++ b/meta-selftest/recipes-test/selftest-users/creategroup2.bb @@ -0,0 +1,33 @@ +SUMMARY = "creategroup pt 2" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +LICENSE = "MIT" + +USERADD_DEPENDS = "creategroup1" + +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" + +inherit useradd allarch + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "-u 5556 --gid grouptest gt2" + +TESTDIR = "${D}${sysconfdir}/creategroup" + +do_install() { + install -d ${TESTDIR} + install -d ${TESTDIR}/dir + touch ${TESTDIR}/file + ln -s ./file ${TESTDIR}/symlink + install -d ${TESTDIR}/fifotest + mkfifo ${TESTDIR}/fifotest/fifo + + chown gt2:grouptest ${TESTDIR}/file + chown -R gt2:grouptest ${TESTDIR}/dir + chown -h gt2:grouptest ${TESTDIR}/symlink + chown -R gt2:grouptest ${TESTDIR}/fifotest +} + +FILES:${PN} = "${sysconfdir}/creategroup/*" + diff --git a/meta-selftest/recipes-test/selftest-users/dcreategroup.bb b/meta-selftest/recipes-test/selftest-users/dcreategroup.bb new file mode 100644 index 0000000000..ab0a529669 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-users/dcreategroup.bb @@ -0,0 +1,34 @@ +SUMMARY = "creategroup_d" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +LICENSE = "MIT" + +USERADD_DEPENDS = "bcreategroup" + +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" + +EXCLUDE_FROM_WORLD="1" + +inherit useradd allarch + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "-u 5564 -g d_group -G b_group d_user " +GROUPADD_PARAM:${PN} = "-r d_group" + +TESTDIR = "${D}${sysconfdir}/creategroup" + +do_install() { + install -d ${TESTDIR} + install -d ${TESTDIR}/dir + touch ${TESTDIR}/file + ln -s ./file ${TESTDIR}/symlink + install -d ${TESTDIR}/fifotest + mkfifo ${TESTDIR}/fifotest/fifo + + chown d_user:d_group ${TESTDIR}/file + chown -R d_user:b_group ${TESTDIR}/dir + chown -h d_user:d_group ${TESTDIR}/symlink + chown -R d_user:b_group ${TESTDIR}/fifotest +} + diff --git a/meta-selftest/recipes-test/selftest-users/useraddbadtask.bb b/meta-selftest/recipes-test/selftest-users/useraddbadtask.bb new file mode 100644 index 0000000000..2863541010 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-users/useraddbadtask.bb @@ -0,0 +1,21 @@ +SUMMARY = "UserAddBadTask" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +LICENSE = "MIT" + +DEPENDS:append = "coreutils-native" + +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" + +inherit useradd allarch + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "-u 5555 --gid groupaddtask useraddtask" +GROUPADD_PARAM:${PN} = "-r groupaddtask" + +do_badthingshappen() { + echo "foo" +} + +addtask badthingshappen after do_populate_sysroot before do_package diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-la-test_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-la-test_1.0.bb new file mode 100644 index 0000000000..21f06782fb --- /dev/null +++ b/meta-selftest/recipes-test/sysroot-test/sysroot-la-test_1.0.bb @@ -0,0 +1,16 @@ +SUMMARY = "Produce a broken la file" +LICENSE = "CLOSED" +INHIBIT_DEFAULT_DEPS = "1" + +EXCLUDE_FROM_WORLD = "1" + +# remove-libtool.bbclass is inherited by default and removes all +# .la files which for this test we specifically do not want. +REMOVE_LIBTOOL_LA = "0" + +do_install() { + install -d ${D}${libdir}/test/ + echo '${WORKDIR}' > ${D}${libdir}/test/la-test.la +} + +BBCLASSEXTEND += "native" diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-pc-test_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-pc-test_1.0.bb new file mode 100644 index 0000000000..e748310fc4 --- /dev/null +++ b/meta-selftest/recipes-test/sysroot-test/sysroot-pc-test_1.0.bb @@ -0,0 +1,12 @@ +SUMMARY = "Produce a broken pc file" +LICENSE = "CLOSED" +INHIBIT_DEFAULT_DEPS = "1" + +EXCLUDE_FROM_WORLD = "1" + +do_install() { + install -d ${D}${libdir}/test/ + echo '${WORKDIR}' > ${D}${libdir}/test/test.pc +} + +BBCLASSEXTEND += "native" diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-shebang-test_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-shebang-test_1.0.bb new file mode 100644 index 0000000000..6c834be897 --- /dev/null +++ b/meta-selftest/recipes-test/sysroot-test/sysroot-shebang-test_1.0.bb @@ -0,0 +1,12 @@ +SUMMARY = "Check that shebang does not exceed 128 characters" +LICENSE = "CLOSED" +INHIBIT_DEFAULT_DEPS = "1" + +EXCLUDE_FROM_WORLD = "1" +do_install() { + install -d ${D}${bindir} + echo '#!BiM3cnVd1Amtv6PG+FynrQiVMbZnX5ELgF21q3EkuB+44JEGWtq8TvBJ7EGidfVs3eR3wVOUbLnjYDlKUWcm7YC/ute7f+KDHbwxziRUSUBZAUqgjiQdfQ0HnxajI0ozbM863E9JV9k13yZKYfh9/zR77Y6Dl4Dd3zOWS75LSpkAXV' > ${D}${bindir}/max-shebang + chmod 755 ${D}${bindir}/max-shebang +} + +BBCLASSEXTEND = "native" diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-test-arch1_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-test-arch1_1.0.bb new file mode 100644 index 0000000000..36a682c53d --- /dev/null +++ b/meta-selftest/recipes-test/sysroot-test/sysroot-test-arch1_1.0.bb @@ -0,0 +1,14 @@ +LICENSE = "CLOSED" + +PROVIDES = "virtual/sysroot-test" +INHIBIT_DEFAULT_DEPS = "1" +PACKAGE_ARCH = "${MACHINE_ARCH}" + +TESTSTRING ?= "1" + +do_install() { + install -d ${D}${includedir} + echo "# test ${TESTSTRING}" > ${D}${includedir}/sysroot-test.h +} + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-test-arch2_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-test-arch2_1.0.bb new file mode 100644 index 0000000000..67172f3cab --- /dev/null +++ b/meta-selftest/recipes-test/sysroot-test/sysroot-test-arch2_1.0.bb @@ -0,0 +1,14 @@ +LICENSE = "CLOSED" + +PROVIDES = "virtual/sysroot-test" +INHIBIT_DEFAULT_DEPS = "1" +PACKAGE_ARCH = "${MACHINE_ARCH}" + +TESTSTRING ?= "2" + +do_install() { + install -d ${D}${includedir} + echo "# test ${TESTSTRING}" > ${D}${includedir}/sysroot-test.h +} + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-test_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-test_1.0.bb new file mode 100644 index 0000000000..560487c159 --- /dev/null +++ b/meta-selftest/recipes-test/sysroot-test/sysroot-test_1.0.bb @@ -0,0 +1,6 @@ +SUMMARY = "Virtual provider sysroot test" +LICENSE = "CLOSED" +INHIBIT_DEFAULT_DEPS = "1" +DEPENDS = "virtual/sysroot-test" + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-selftest/recipes-test/systemd-machine-units/systemd-machine-units_%.bbappend b/meta-selftest/recipes-test/systemd-machine-units/systemd-machine-units_%.bbappend new file mode 100644 index 0000000000..205720982c --- /dev/null +++ b/meta-selftest/recipes-test/systemd-machine-units/systemd-machine-units_%.bbappend @@ -0,0 +1,2 @@ +# This bbappend is used to alter the recipe using the test_recipe.inc file created by tests. +include test_recipe.inc diff --git a/meta-selftest/recipes-test/testrpm/files/testfile.txt b/meta-selftest/recipes-test/testrpm/files/testfile.txt new file mode 100644 index 0000000000..c4d7630c1e --- /dev/null +++ b/meta-selftest/recipes-test/testrpm/files/testfile.txt @@ -0,0 +1 @@ +== This file serves the purposes of SRC_URI only diff --git a/meta-selftest/recipes-test/testrpm/testrpm_0.0.1.bb b/meta-selftest/recipes-test/testrpm/testrpm_0.0.1.bb new file mode 100644 index 0000000000..db674d0efc --- /dev/null +++ b/meta-selftest/recipes-test/testrpm/testrpm_0.0.1.bb @@ -0,0 +1,21 @@ +SUMMARY = "Test recipe for testing rpm generated by oe-core" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +LICENSE = "MIT" + +SRC_URI = "file://testfile.txt" +INHIBIT_DEFAULT_DEPS = "1" + +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" + +do_compile(){ + echo "testdata" > ${B}/"file with [brackets].txt" + echo "testdata" > ${B}/"file with (parentheses).txt" +} + +do_install(){ + install ${B}/* ${D}/ +} + +FILES:${PN} = "*" diff --git a/meta-selftest/recipes-test/wrapper/cmdline-shebang-wrapper-test.bb b/meta-selftest/recipes-test/wrapper/cmdline-shebang-wrapper-test.bb new file mode 100644 index 0000000000..c91d00c8d9 --- /dev/null +++ b/meta-selftest/recipes-test/wrapper/cmdline-shebang-wrapper-test.bb @@ -0,0 +1,30 @@ +SUMMARY = "Check that create_cmdline_shebang works" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +INHIBIT_DEFAULT_DEPS = "1" + +SRC_URI += "file://test.awk" + +EXCLUDE_FROM_WORLD = "1" +do_install() { + install -d ${D}${bindir} + # was not able to make ownership preservation check + install -m 0400 ${UNPACKDIR}/test.awk ${D}${bindir}/test + + perm_old="$(stat --format='%a' ${D}${bindir}/test)" + sed -i -e 's|@AWK_BIN@|${bindir}/awk|g' ${D}${bindir}/test + create_cmdline_shebang_wrapper ${D}${bindir}/test + if [ $(${D}${bindir}/test) != "Don't Panic!" ]; then + bbfatal "Wrapper is broken" + else + bbnote "Wrapper is good" + fi + + perm_new="$(stat --format='%a' ${D}${bindir}/test.real)" + + if [ "$perm_new" != "$perm_old" ]; then + bbfatal "Wrapper permissions for ${D}${bindir}/test.real not preserved. Found $perm_new but expected $perm_old" + fi +} + +BBCLASSEXTEND = "native" diff --git a/meta-selftest/recipes-test/wrapper/files/test.awk b/meta-selftest/recipes-test/wrapper/files/test.awk new file mode 100644 index 0000000000..91429197b1 --- /dev/null +++ b/meta-selftest/recipes-test/wrapper/files/test.awk @@ -0,0 +1,2 @@ +#! @AWK_BIN@ -f +BEGIN { print "Don't Panic!" } |