diff options
Diffstat (limited to 'meta-selftest')
111 files changed, 1276 insertions, 115 deletions
diff --git a/meta-selftest/COPYING.MIT b/meta-selftest/COPYING.MIT deleted file mode 100644 index 89de354795..0000000000 --- a/meta-selftest/COPYING.MIT +++ /dev/null @@ -1,17 +0,0 @@ -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/meta-selftest/classes/test-mkimage-wrapper.bbclass b/meta-selftest/classes/test-mkimage-wrapper.bbclass new file mode 100644 index 0000000000..7c98d7b71e --- /dev/null +++ b/meta-selftest/classes/test-mkimage-wrapper.bbclass @@ -0,0 +1,19 @@ +# Class to test UBOOT_MKIMAGE and UBOOT_MKIMAGE_SIGN +# (in conjunction with kernel-fitimage.bbclass) +# +# SPDX-License-Identifier: MIT +# + +UBOOT_MKIMAGE = "test_mkimage_wrapper" +UBOOT_MKIMAGE_SIGN = "test_mkimage_signing_wrapper" + +test_mkimage_wrapper() { + echo "### uboot-mkimage wrapper message" + uboot-mkimage "$@" +} + +test_mkimage_signing_wrapper() { + echo "### uboot-mkimage signing wrapper message" + uboot-mkimage "$@" +} + diff --git a/meta-selftest/conf/layer.conf b/meta-selftest/conf/layer.conf index a847b78a20..47b917f348 100644 --- a/meta-selftest/conf/layer.conf +++ b/meta-selftest/conf/layer.conf @@ -8,3 +8,5 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ BBFILE_COLLECTIONS += "selftest" BBFILE_PATTERN_selftest = "^${LAYERDIR}/" BBFILE_PRIORITY_selftest = "5" + +LAYERSERIES_COMPAT_selftest = "kirkstone" diff --git a/meta-selftest/files/signing/key.passphrase b/meta-selftest/files/signing/key.passphrase new file mode 100644 index 0000000000..5271a52680 --- /dev/null +++ b/meta-selftest/files/signing/key.passphrase @@ -0,0 +1 @@ +test123 diff --git a/meta-selftest/files/signing/key.pub b/meta-selftest/files/signing/key.pub new file mode 100644 index 0000000000..e197bb3815 --- /dev/null +++ b/meta-selftest/files/signing/key.pub @@ -0,0 +1,30 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1 + +mQENBFYeMycBCADISkEj+u+3SkGbmC4b09StA3Fk4J8bKZrTTpQqUhOH4QFIQpso +q96Q907h/ABAgB+IV0SGIeN866E7BqToqoXZ74X6EoyXWdndaMaFZSj+oNqqg6Gi +hVsuGNpvRyyXSCYW8w9H2lFx09UufFrUxoSeP2iVdJJaUAmb8e00PCwkYrS2BZEa +tO2VgllbaqczldmlUGnkIZt8YUSQSI/xZBDYUvbcZYBaOnDH1SDQl26f+bgyeIyS +TW5TZb96o4tMfiifgPoqAapAxQLahG0WtjF/n1yNV5wUNQYsEQf6/h6W2rHGsCP5 +6FVFnr/ZPVam9iHUxL4lvJSI8dEH37s9GmarABEBAAG0LXRlc3R1c2VyIChub2Nv +bW1lbnQpIDx0ZXN0dXNlckB0ZXN0ZW1haWwuY29tPokBOAQTAQIAIgUCVh4zJwIb +AwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQezExa11krVLM2wf/fW1C8DPx +tZEyl6iPXFjNotslo+t2TL6jPefC22KmbokJCtCnxcopBjQRuhUSNDTkXkUdVagy +TaaYILV8XGajTmcVGQTaKeh+j6TM6CBGApQB5KhHvZCyvNBrGcNyuiex0Sm/rIhS +fZre6ptZM/026W2kLwwJESXzHJEqCoFmU6aSOUCVyiDgMfcNw6c4NmEoqZtLdnxU +B7Nac98o933AIvaaQMGtKIOcyOM7P/dyv8eMc38z2ew5bEB8E9aSdg5koXb3zIt5 +IKea631k4INAsFFyLMQNSmmKV7RK0miF5b4hGyekrYZRtiic5+dq5aWnVka4hBfi +x31euxwQE87gQLkBDQRWHjMnAQgAt7C9QCFPWzLGQuQ/YaQub+8s2lYNQnmfwDHm +5PuON+Wj/f5GyQhHKsbdUAPZ7GsjFIQnva7xNYYF/IvpC+0saB5NLMkBzjfIsg92 +6MkadAKlOR2o9gKlF59mulsJmJqNFTXiRcVXvpUnU8WB9ECmm321XfYHhk+4EMay +H3OUZ0k6dEmvrWBTKNTR7M0z6j/jW+8J3vP3L9k1H+OV0EZwAKXfbh1lN4H467jY +3gA7FU1WDmA06HphoSaFUEGTuXGtrRP0eksCUj3BtVygXnyQb379dISDOWcs/9Ke +v3KMrZWgDnA4pH1eQpjycBhwKOCHYyhSSVOwCS3DGkaaklmQZwARAQABiQEfBBgB +AgAJBQJWHjMnAhsMAAoJEHsxMWtdZK1SoPsIAKadG/tvS5COCyF8FuriL89Ysfov +kMRKeb9hsMDbKX2lm3UtoS5ErmpkEUO/SbazQYm6/vYc8noQquqhkIdCljIvpWDv +17tXEFfTGA493dlTTEWFt5bvzbQN6OhBu3904lAE4JGtlOOa9OKDeguwXbneLOyl +dnlj2f7rw05cB9t/RDu7T11dTI39BMTUUm1lpWxYJk41o59b9g+fpJZkiIAJwnN3 +MwM1u9/AWfTqjNRgMAO5dIYceceTwGogujG+xz93flt+NjQhILG0T9jd0DFBgIAX +Zq4PzX5aFDKjGoFaOOZ6r+kppBLH/HN6okMGIcfqaPPdnJI1MXFQvFzUNpo= +=2cSJ +-----END PGP PUBLIC KEY BLOCK----- diff --git a/meta-selftest/files/signing/key.secret b/meta-selftest/files/signing/key.secret new file mode 100644 index 0000000000..d30d7cd610 --- /dev/null +++ b/meta-selftest/files/signing/key.secret @@ -0,0 +1,59 @@ +-----BEGIN PGP PRIVATE KEY BLOCK----- +Version: GnuPG v1 + +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 +=b+vR +-----END PGP PRIVATE KEY BLOCK----- diff --git a/meta-selftest/files/static-group b/meta-selftest/files/static-group new file mode 100644 index 0000000000..b2e0e2f870 --- /dev/null +++ b/meta-selftest/files/static-group @@ -0,0 +1,25 @@ +messagebus:x:500: +systemd-bus-proxy:x:501: +systemd-network:x:502: +systemd-resolve:x:503: +systemd-timesync:x:504: +polkitd:x:505: +lock:x:506: +systemd-journal:x:507: +netdev:x:508: +avahi:x:509: +avahi-autoipd:x:510: +rpc:x:511: +rpcuser:x:513: +dhcpcd:x:514: +sshd:x:516: +lpadmin:x:517: +crontab:x:518: +tracing:x:519: +pulse:x:520: +bind:x:521: +builder:x:522: +_apt:x:523: +weston-launch:x:524: +weston:x:525: +wayland:x:526: diff --git a/meta-selftest/files/static-passwd b/meta-selftest/files/static-passwd new file mode 100644 index 0000000000..2cfd0c9b42 --- /dev/null +++ b/meta-selftest/files/static-passwd @@ -0,0 +1,19 @@ +messagebus:x:500:500::/var/lib/dbus:/bin/false +systemd-bus-proxy:x:501:501::/:/bin/nologin +systemd-network:x:502:502::/:/bin/nologin +systemd-resolve:x:503:503::/:/bin/nologin +systemd-timesync:x:504:504::/:/bin/nologin +polkitd:x:505:505::/:/bin/nologin +avahi:x:509:509::/:/bin/nologin +avahi-autoipd:x:510:510::/:/bin/nologin +rpc:x:511:511::/:/bin/nologin +distcc:x:512:nogroup::/:/bin/nologin +rpcuser:x:513:513::/var/lib/nfs:/bin/nologin +dhcpcd:x:514:514::/:/bin/nologin +tester:x:515:515::/:/bin/nologin +sshd:x:516:516::/:/bin/nologin +pulse:x:520:520::/:/bin/nologin +bind:x:521:521::/:/bin/nologin +builder:x:522:522::/:/bin/nologin +_apt:x:523:523::/:/bin/nologin +weston:x:525:525::/:/bin/nologin diff --git a/meta-selftest/lib/devtool/__init__.py b/meta-selftest/lib/devtool/__init__.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/meta-selftest/lib/devtool/__init__.py diff --git a/meta-selftest/lib/devtool/bbpath.py b/meta-selftest/lib/devtool/bbpath.py new file mode 100644 index 0000000000..5e8ffb3af6 --- /dev/null +++ b/meta-selftest/lib/devtool/bbpath.py @@ -0,0 +1,44 @@ +import argparse + +already_loaded = False +kept_context = None + +def plugin_name(filename): + return os.path.splitext(os.path.basename(filename))[0] + +def plugin_init(plugins): + global already_loaded + already_loaded = plugin_name(__file__) in (plugin_name(p.__name__) for p in plugins) + +def print_name(args, config, basepath, workspace): + print (__file__) + +def print_bbdir(args, config, basepath, workspace): + print (__file__.replace('/lib/devtool/bbpath.py','')) + +def print_registered(args, config, basepath, workspace): + global kept_context + print(kept_context.loaded) + +def multiloaded(args, config, basepath, workspace): + global already_loaded + print("yes" if already_loaded else "no") + +def register_commands(subparsers, context): + global kept_context + kept_context = context + if 'loaded' in context.__dict__: + context.loaded += 1 + else: + context.loaded = 1 + + def addparser(name, helptxt, func): + parser = subparsers.add_parser(name, help=helptxt, + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.set_defaults(func=func) + return parser + + addparser('pluginfile', 'Print the filename of this plugin', print_name) + addparser('bbdir', 'Print the BBPATH directory of this plugin', print_bbdir) + addparser('count', 'How many times have this plugin been registered.', print_registered) + addparser('multiloaded', 'How many times have this plugin been initialized', multiloaded) diff --git a/meta-selftest/lib/devtool/test.py b/meta-selftest/lib/devtool/test.py new file mode 100644 index 0000000000..31190f58e7 --- /dev/null +++ b/meta-selftest/lib/devtool/test.py @@ -0,0 +1,11 @@ +import argparse + +def selftest_reverse(args, config, basepath, workspace): + """Reverse the value passed to verify the plugin is executing.""" + print(args.value[::-1]) + +def register_commands(subparsers, context): + parser_build = subparsers.add_parser('selftest-reverse', help='Reverse value (for selftest)', + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser_build.add_argument('value', help='Value to reverse') + parser_build.set_defaults(func=selftest_reverse) diff --git a/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py b/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py new file mode 100644 index 0000000000..64a3502370 --- /dev/null +++ b/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py @@ -0,0 +1,50 @@ +from oeqa.core.decorator.depends import OETestDepends +from oeqa.runtime.cases.dnf import DnfTest +from oeqa.utils.httpserver import HTTPService +from oeqa.core.decorator.data import skipIfDataVar + +class DnfSelftest(DnfTest): + + @classmethod + def setUpClass(cls): + import tempfile + cls.temp_dir = tempfile.TemporaryDirectory(prefix="oeqa-remotefeeds-") + cls.repo_server = HTTPService(os.path.join(cls.tc.td['WORKDIR'], 'oe-rootfs-repo'), + cls.tc.target.server_ip) + cls.repo_server.start() + + @classmethod + def tearDownClass(cls): + cls.repo_server.stop() + cls.temp_dir.cleanup() + + @OETestDepends(['dnf.DnfBasicTest.test_dnf_help']) + @skipIfDataVar('PACKAGE_FEED_URIS', None, + 'Not suitable as PACKAGE_FEED_URIS is not set') + def test_verify_package_feeds(self): + """ + Summary: Check correct setting of PACKAGE_FEED_URIS var + Expected: 1. Feeds were correctly set for dnf + 2. Update recovers packages from host's repo + Author: Humberto Ibarra <humberto.ibarra.lopez@intel.com> + Author: Alexander Kanavin <alex.kanavin@gmail.com> + """ + # When we created an image, we had to supply fake ip and port + # for the feeds. Now we can patch the real ones into the config file. + temp_file = os.path.join(self.temp_dir.name, 'tmp.repo') + self.tc.target.copyFrom("/etc/yum.repos.d/oe-remote-repo.repo", temp_file) + fixed_config = open(temp_file, "r").read().replace("bogus_ip", self.tc.target.server_ip).replace("bogus_port", str(self.repo_server.port)) + with open(temp_file, "w") as f: + f.write(fixed_config) + self.tc.target.copyTo(temp_file, "/etc/yum.repos.d/oe-remote-repo.repo") + + import re + # Use '-y' for non-interactive mode: automatically import the feed signing key + output_makecache = self.dnf('-vy makecache') + self.assertTrue(re.match(r".*Failed to synchronize cache", output_makecache, re.DOTALL) is None, msg = "dnf makecache failed to synchronize repo: %s" %(output_makecache)) + self.assertTrue(re.match(r".*Metadata cache created", output_makecache, re.DOTALL) is not None, msg = "dnf makecache failed: %s" %(output_makecache)) + + output_repoinfo = self.dnf('-v repoinfo') + matchobj = re.match(r".*Repo-pkgs\s*:\s*(?P<n_pkgs>[0-9]+)", output_repoinfo, re.DOTALL) + self.assertTrue(matchobj is not None, msg = "Could not find the amount of packages in dnf repoinfo output: %s" %(output_repoinfo)) + self.assertTrue(int(matchobj.group('n_pkgs')) > 0, msg = "Amount of remote packages is not more than zero: %s\n" %(output_repoinfo)) diff --git a/meta-selftest/lib/oeqa/runtime/cases/selftest.json b/meta-selftest/lib/oeqa/runtime/cases/selftest.json new file mode 100644 index 0000000000..e5ae46ecd4 --- /dev/null +++ b/meta-selftest/lib/oeqa/runtime/cases/selftest.json @@ -0,0 +1,6 @@ +{ + "test_install_package": { + "pkg": "socat", + "rm": true + } +} diff --git a/meta-selftest/lib/oeqa/runtime/cases/selftest.py b/meta-selftest/lib/oeqa/runtime/cases/selftest.py new file mode 100644 index 0000000000..19de740623 --- /dev/null +++ b/meta-selftest/lib/oeqa/runtime/cases/selftest.py @@ -0,0 +1,31 @@ +from oeqa.runtime.case import OERuntimeTestCase +from oeqa.core.decorator.depends import OETestDepends + +class Selftest(OERuntimeTestCase): + + @OETestDepends(['ssh.SSHTest.test_ssh']) + def test_install_package(self): + """ + Summary: Check basic package installation functionality. + Expected: 1. Before the test socat must be installed using scp. + 2. After the test socat must be uninstalled using ssh. + This can't be checked in this test. + Product: oe-core + Author: Mariano Lopez <mariano.lopez@intel.com> + """ + + (status, output) = self.target.run("socat -V") + self.assertEqual(status, 0, msg="socat is not installed") + + @OETestDepends(['selftest.Selftest.test_install_package']) + def test_verify_uninstall(self): + """ + Summary: Check basic package installation functionality. + Expected: 1. test_install_package must uninstall socat. + This test is just to verify that. + Product: oe-core + Author: Mariano Lopez <mariano.lopez@intel.com> + """ + + (status, output) = self.target.run("socat -V") + self.assertNotEqual(status, 0, msg="socat is still installed") diff --git a/meta-selftest/lib/oeqa/runtime/cases/virgl.py b/meta-selftest/lib/oeqa/runtime/cases/virgl.py new file mode 100644 index 0000000000..144decdd6b --- /dev/null +++ b/meta-selftest/lib/oeqa/runtime/cases/virgl.py @@ -0,0 +1,18 @@ +from oeqa.runtime.case import OERuntimeTestCase +from oeqa.core.decorator.depends import OETestDepends +import subprocess +import oe.lsb + +class VirglTest(OERuntimeTestCase): + + @OETestDepends(['ssh.SSHTest.test_ssh']) + def test_kernel_driver(self): + status, output = self.target.run('dmesg|grep virgl') + self.assertEqual(status, 0, "Checking for virgl driver in dmesg returned non-zero: %d\n%s" % (status, output)) + self.assertIn("features: +virgl", output, "virgl acceleration seems to be disabled:\n%s" %(output)) + + @OETestDepends(['virgl.VirglTest.test_kernel_driver']) + def test_kmscube(self): + status, output = self.target.run('kmscube') + self.assertEqual(status, 0, "kmscube exited with non-zero status %d and output:\n%s" %(status, output)) + self.assertIn('renderer: "virgl"', output, "kmscube does not seem to use virgl:\n%s" %(output)) diff --git a/meta-selftest/lib/oeqa/selftest/cases/external-layer.py b/meta-selftest/lib/oeqa/selftest/cases/external-layer.py new file mode 100644 index 0000000000..59b1afab7d --- /dev/null +++ b/meta-selftest/lib/oeqa/selftest/cases/external-layer.py @@ -0,0 +1,16 @@ +#from oeqa.selftest.base import oeSelfTest +from oeqa.selftest.case import OESelftestTestCase +#from oeqa.utils.decorators import testcase + + +class ImportedTests(OESelftestTestCase): + + def test_unconditional_pass(self): + """ + Summary: Doesn't check anything, used to check import test from other layers. + Expected: 1. Pass unconditionally + Product: oe-core + Author: Mariano Lopez <mariano.lopez@intel.com + """ + + self.assertEqual(True, True, msg = "Impossible to fail this test") diff --git a/meta-selftest/lib/pseudo_pyc_test1.py b/meta-selftest/lib/pseudo_pyc_test1.py new file mode 100644 index 0000000000..b59abdd536 --- /dev/null +++ b/meta-selftest/lib/pseudo_pyc_test1.py @@ -0,0 +1 @@ +STRING = "pseudo_pyc_test1" diff --git a/meta-selftest/lib/pseudo_pyc_test2.py b/meta-selftest/lib/pseudo_pyc_test2.py new file mode 100644 index 0000000000..fb67a978e0 --- /dev/null +++ b/meta-selftest/lib/pseudo_pyc_test2.py @@ -0,0 +1 @@ +STRING = "pseudo_pyc_test2" diff --git a/meta-selftest/lib/recipetool/bbpath.py b/meta-selftest/lib/recipetool/bbpath.py new file mode 100644 index 0000000000..783b2dc769 --- /dev/null +++ b/meta-selftest/lib/recipetool/bbpath.py @@ -0,0 +1,41 @@ +import argparse + +already_loaded = False +register_count = 0 + +def plugin_name(filename): + return os.path.splitext(os.path.basename(filename))[0] + +def plugin_init(plugins): + global already_loaded + already_loaded = plugin_name(__file__) in (plugin_name(p.__name__) for p in plugins) + +def print_name(opts): + print (__file__) + +def print_bbdir(opts): + print (__file__.replace('/lib/recipetool/bbpath.py','')) + +def print_registered(opts): + #global kept_context + #print(kept_context.loaded) + print ("1") + +def multiloaded(opts): + global already_loaded + print("yes" if already_loaded else "no") + +def register_commands(subparsers): + global register_count + register_count += 1 + + def addparser(name, helptxt, func): + parser = subparsers.add_parser(name, help=helptxt, + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.set_defaults(func=func) + return parser + + addparser('pluginfile', 'Print the filename of this plugin', print_name) + addparser('bbdir', 'Print the BBPATH directory of this plugin', print_bbdir) + addparser('count', 'How many times have this plugin been registered.', print_registered) + addparser('multiloaded', 'How many times have this plugin been initialized', multiloaded) diff --git a/meta-selftest/recipes-devtools/python/python-async-test.inc b/meta-selftest/recipes-devtools/python/python-async-test.inc new file mode 100644 index 0000000000..6d7c7458b0 --- /dev/null +++ b/meta-selftest/recipes-devtools/python/python-async-test.inc @@ -0,0 +1,16 @@ +SUMMARY = "Python framework to process interdependent tasks in a pool of workers" +HOMEPAGE = "http://github.com/gitpython-developers/async" +SECTION = "devel/python" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=88df8e78b9edfd744953862179f2d14e" + +inherit pypi + +PYPI_PACKAGE = "async" + +SRC_URI[md5sum] = "9b06b5997de2154f3bc0273f80bcef6b" +SRC_URI[sha256sum] = "ac6894d876e45878faae493b0cf61d0e28ec417334448ac0a6ea2229d8343051" + +RDEPENDS:${PN} += "${PYTHON_PN}-threading" + +BBCLASSEXTEND = "nativesdk" diff --git a/meta-selftest/recipes-devtools/python/python3-async-test_0.6.2.bb b/meta-selftest/recipes-devtools/python/python3-async-test_0.6.2.bb new file mode 100644 index 0000000000..22e241afb3 --- /dev/null +++ b/meta-selftest/recipes-devtools/python/python3-async-test_0.6.2.bb @@ -0,0 +1,2 @@ +inherit setuptools3 +require python-async-test.inc 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 20a0ab7d39..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,27 +4,31 @@ 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" -PR = "r1" - SRC_URI = "${GNU_MIRROR}/aspell/aspell-${PV}.tar.gz" SRC_URI[md5sum] = "e66a9c9af6a60dc46134fdacf6ce97d7" SRC_URI[sha256sum] = "f52583a83a63633701c5f71db3dc40aab87b7f76b29723aeb27941eff42df6e1" +EXCLUDE_FROM_WORLD = "1" + PACKAGECONFIG ??= "" 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 = "arm" inherit autotools gettext diff --git a/meta-selftest/recipes-test/aspell/aspell_0.60.6.1.bbappend b/meta-selftest/recipes-test/aspell/aspell_0.60.8.bbappend index 205720982c..205720982c 100644 --- a/meta-selftest/recipes-test/aspell/aspell_0.60.6.1.bbappend +++ b/meta-selftest/recipes-test/aspell/aspell_0.60.8.bbappend diff --git a/meta-selftest/recipes-test/container-image/container-image-testpkg.bb b/meta-selftest/recipes-test/container-image/container-image-testpkg.bb new file mode 100644 index 0000000000..929bc29753 --- /dev/null +++ b/meta-selftest/recipes-test/container-image/container-image-testpkg.bb @@ -0,0 +1,8 @@ +LICENSE = "MIT" + +INHIBIT_DEFAULT_DEPS = "1" + +do_install:append() { + install -d ${D}${bindir} + touch ${D}${bindir}/theapp +} diff --git a/meta-selftest/recipes-test/container-image/container-test-image.bb b/meta-selftest/recipes-test/container-image/container-test-image.bb new file mode 100644 index 0000000000..d5f939c6e9 --- /dev/null +++ b/meta-selftest/recipes-test/container-image/container-test-image.bb @@ -0,0 +1,8 @@ +IMAGE_INSTALL += "container-image-testpkg" + +LICENSE = "MIT" + +IMAGE_FSTYPES = "container" +IMAGE_LINGUAS = "" + +inherit core-image diff --git a/meta-selftest/recipes-test/delay/delay.bb b/meta-selftest/recipes-test/delay/delay.bb new file mode 100644 index 0000000000..f92d3d99e2 --- /dev/null +++ b/meta-selftest/recipes-test/delay/delay.bb @@ -0,0 +1,12 @@ +SUMMARY = "Recipe with a fixed delay task" +DESCRIPTION = "Contains a delay task to be used to for testing." +LICENSE = "MIT" + +INHIBIT_DEFAULT_DEPS = "1" +EXCLUDE_FROM_WORLD = "1" + +do_delay() { + sleep 5 +} +do_delay[nostamp] = "1" +addtask delay
\ No newline at end of file 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..e33a2753f9 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-patch-overrides/qemuarm/arm.patch @@ -0,0 +1,5 @@ +--- 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..1a0a175fa8 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-patch-overrides/qemux86/x86.patch @@ -0,0 +1,5 @@ +--- 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..96ea0eb4e3 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-ignored/devtool-test-ignored.patch @@ -0,0 +1,7 @@ +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..68ec6d9875 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-ignored/devtool-test-ignored.patch.expected @@ -0,0 +1,16 @@ +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 + +--- + 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/file1 b/meta-selftest/recipes-test/devtool/devtool-test-local/file1 new file mode 100644 index 0000000000..f4bdcfc831 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-local/file1 @@ -0,0 +1 @@ +The first file diff --git a/meta-selftest/recipes-test/devtool/devtool-test-local/file2 b/meta-selftest/recipes-test/devtool/devtool-test-local/file2 new file mode 100644 index 0000000000..a7e2414bd5 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-local/file2 @@ -0,0 +1 @@ +The second 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 new file mode 100644 index 0000000000..463cfe0a7a --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb @@ -0,0 +1,15 @@ +LICENSE = "GPL-2.0-or-later" +LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" + +INHIBIT_DEFAULT_DEPS = "1" + +SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/syslinux-${PV}.tar.xz \ + file://file1 \ + file://file2" + +SRC_URI[md5sum] = "92a253df9211e9c20172796ecf388f13" +SRC_URI[sha256sum] = "26d3986d2bea109d5dc0e4f8c4822a459276cf021125e8c9f23c3cca5d8c850e" + +S = "${WORKDIR}/syslinux-${PV}" + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb b/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb new file mode 100644 index 0000000000..3f7123cda0 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb @@ -0,0 +1,7 @@ +LICENSE = "CLOSED" +INHIBIT_DEFAULT_DEPS = "1" + +SRC_URI = "file://file1 \ + file://file2" + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-selftest/recipes-test/devtool/devtool-test-localonly/file1 b/meta-selftest/recipes-test/devtool/devtool-test-localonly/file1 new file mode 100644 index 0000000000..f4bdcfc831 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-localonly/file1 @@ -0,0 +1 @@ +The first file diff --git a/meta-selftest/recipes-test/devtool/devtool-test-localonly/file2 b/meta-selftest/recipes-test/devtool/devtool-test-localonly/file2 new file mode 100644 index 0000000000..a7e2414bd5 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-localonly/file2 @@ -0,0 +1 @@ +The second 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..6aaf409ebc --- /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,7 @@ +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..1bf25a61d0 --- /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,16 @@ +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 + +--- + 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 new file mode 100644 index 0000000000..e25b3d9747 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb @@ -0,0 +1,18 @@ +LICENSE = "GPL-2.0-or-later" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" + +DEPENDS = "libxres libxext virtual/libx11 ncurses" + +SRC_URI = "http://downloads.yoctoproject.org/releases/xrestop/xrestop-0.4.tar.gz \ + file://readme.patch.gz \ + " +UPSTREAM_VERSION_UNKNOWN = "1" + +S = "${WORKDIR}/xrestop-0.4" + +SRC_URI[md5sum] = "d8a54596cbaf037e62b80c4585a3ca9b" +SRC_URI[sha256sum] = "67c2fc94a7ecedbaae0d1837e82e93d1d98f4a6d759828860e552119af3ce257" + +inherit autotools pkgconfig + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-selftest/recipes-test/devtool/devtool-test-patch-gz/readme.patch.gz b/meta-selftest/recipes-test/devtool/devtool-test-patch-gz/readme.patch.gz Binary files differnew file mode 100644 index 0000000000..4752492ccd --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-patch-gz/readme.patch.gz diff --git a/meta-selftest/recipes-test/devtool/devtool-test-subdir.bb b/meta-selftest/recipes-test/devtool/devtool-test-subdir.bb new file mode 100644 index 0000000000..3f6956524b --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-subdir.bb @@ -0,0 +1,9 @@ +LICENSE = "CLOSED" +INHIBIT_DEFAULT_DEPS = "1" + +SRC_URI = "file://devtool-test-subdir.tar.gz \ + file://testfile;subdir=${BPN}" + +S = "${WORKDIR}/${BPN}" + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz b/meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz Binary files differnew file mode 100644 index 0000000000..3d44f803cb --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz diff --git a/meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile b/meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile new file mode 100644 index 0000000000..12b519c0d6 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile @@ -0,0 +1 @@ +Modified version 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 new file mode 100644 index 0000000000..4ea3d74f0f --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test1-1.5.3/0001-Add-a-note-line-to-the-quick-reference.patch @@ -0,0 +1,25 @@ +From 1478846ebfac690684e9c48049d08e0065f97a36 Mon Sep 17 00:00:00 2001 +From: Paul Eggleton <paul.eggleton@linux.intel.com> +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. +--- + doc/quickref.1.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/doc/quickref.1.in b/doc/quickref.1.in +index 389008b..226615c 100644 +--- a/doc/quickref.1.in ++++ b/doc/quickref.1.in +@@ -560,6 +560,7 @@ you want, at runtime, to change the parameters of. + .P + If you find any other problems, please report them. + ++NOTE: this is an important note. + + .SH REPORTING BUGS + Report bugs in +-- +2.5.0 + 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 new file mode 100644 index 0000000000..c4f3f12666 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test1-1.5.3/backported.patch @@ -0,0 +1,37 @@ +commit ced2ec32b657a7f52604b2e16e5d5881041c517a +Author: OpenEmbedded <oe.patch@oe> +Date: Mon Nov 18 18:43:15 2019 +0100 + + Backport of the NEWS file from version 1.6.0 + +diff --git a/doc/NEWS b/doc/NEWS +index 69793fc..fd49b1c 100644 +--- a/doc/NEWS ++++ b/doc/NEWS +@@ -1,3 +1,26 @@ ++1.6.0 - 15 March 2015 ++ - fix lstat64 support when unavailable - separate patches supplied by ++ Ganael Laplanche and Peter Korsgaard ++ - (#1506) new option "-D" / "--delay-start" to only show bar after N ++ seconds (Damon Harper) ++ - new option "--fineta" / "-I" to show ETA as time of day rather than time ++ remaining - patch supplied by Erkki Seppälä (r147) ++ - (#1509) change ETA (--eta / -e) so that days are given if the hours ++ remaining are 24 or more (Jacek Wielemborek) ++ - (#1499) repeat read and write attempts on partial buffer fill/empty to ++ work around post-signal transfer rate drop reported by Ralf Ramsauer ++ - (#1507) do not try to calculate total size in line mode, due to bug ++ reported by Jacek Wielemborek and Michiel Van Herwegen ++ - cleanup: removed defunct RATS comments and unnecessary copyright notices ++ - clean up displayed lines when using --watchfd PID, when PID exits ++ - output errors on a new line to avoid overwriting transfer bar ++ ++1.5.7 - 26 August 2014 ++ - show KiB instead of incorrect kiB (Debian bug #706175) ++ - (#1284) do not gzip man page, for non-Linux OSes (Bob Friesenhahn) ++ - work around "awk" bug in tests/016-numeric-timer in decimal "," locales ++ - fix "make rpm" and "make srpm", extend "make release" to sign releases ++ + 1.5.3 - 4 May 2014 + - remove SPLICE_F_NONBLOCK to fix problem with slow splice() (Jan Seda) + diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb b/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb new file mode 100644 index 0000000000..fee5bee739 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_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 \ + file://0001-Add-a-note-line-to-the-quick-reference.patch \ + file://backported.patch \ + " +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[sha256sum] = "681bcca9784bf3cb2207e68236d1f68e2aa7b80f999b5750dc77dcd756e81fbc" + +PR = "r5" + +S = "${WORKDIR}/pv-${PV}" + +EXCLUDE_FROM_WORLD = "1" + +inherit autotools + 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 new file mode 100644 index 0000000000..d75df0c8c7 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_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 \ + file://0001-Add-a-note-line-to-the-quick-reference.patch \ + file://backported.patch \ + " +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[sha256sum] = "9dd45391806b0ed215abee4c5ac1597d018c386fe9c1f5afd2f6bc3b07fd82c3" + +S = "${WORKDIR}/pv-${PV}" + +EXCLUDE_FROM_WORLD = "1" + +inherit autotools + diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb b/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb new file mode 100644 index 0000000000..203f4b61c2 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb @@ -0,0 +1,22 @@ +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 = "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}" +PR = "r2" + +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" + +S = "${WORKDIR}/git" + +EXCLUDE_FROM_WORLD = "1" + +inherit autotools pkgconfig 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 new file mode 100644 index 0000000000..3d45fc4857 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded @@ -0,0 +1,21 @@ +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 = "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}" + +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" + +S = "${WORKDIR}/git" + +EXCLUDE_FROM_WORLD = "1" + +inherit autotools pkgconfig diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade_0.1.bb b/meta-selftest/recipes-test/devtool/devtool-upgrade_0.1.bb deleted file mode 100644 index 33ffc8803a..0000000000 --- a/meta-selftest/recipes-test/devtool/devtool-upgrade_0.1.bb +++ /dev/null @@ -1,25 +0,0 @@ -# -# This file was derived from the 'Hello World!' example recipe in the -# Yocto Project Development Manual. -# - -DESCRIPTION = "Simple helloworld application used to test the devtool upgrade feature" -SECTION = "devtool" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" -PR = "r0" - -SRC_URI = "file://${THISDIR}/files/${P}.tar.gz \ - file://0001-helloword.c-exit-with-EXIT_SUCCESS-instead-of-a-magi.patch \ - " - -S = "${WORKDIR}/${P}" - -do_compile() { - ${CC} helloworld.c -o helloworld -} - -do_install() { - install -d ${D}${bindir} - install -m 0755 helloworld ${D}${bindir} -} diff --git a/meta-selftest/recipes-test/devtool/files/0001-helloword.c-exit-with-EXIT_SUCCESS-instead-of-a-magi.patch b/meta-selftest/recipes-test/devtool/files/0001-helloword.c-exit-with-EXIT_SUCCESS-instead-of-a-magi.patch deleted file mode 100644 index 2294a094b2..0000000000 --- a/meta-selftest/recipes-test/devtool/files/0001-helloword.c-exit-with-EXIT_SUCCESS-instead-of-a-magi.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0f37affbc6e6c71687301d99d7259f1968e57c48 Mon Sep 17 00:00:00 2001 -From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> -Date: Wed, 26 Aug 2015 12:42:23 +0000 -Subject: [PATCH] helloword.c: exit with EXIT_SUCCESS instead of a magic number - ---- - helloworld.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/helloworld.c b/helloworld.c -index 71f2e46..54bf50b 100644 ---- a/helloworld.c -+++ b/helloworld.c -@@ -1,8 +1,9 @@ - #include <stdio.h> -+#include <stdlib.h> - - int main(int argc, char **argv) - { - printf("Hello World!\n"); - -- return 0; -+ return EXIT_SUCCESS; - } --- -1.8.4.5 - diff --git a/meta-selftest/recipes-test/devtool/files/devtool-upgrade-0.1.tar.gz b/meta-selftest/recipes-test/devtool/files/devtool-upgrade-0.1.tar.gz Binary files differdeleted file mode 100644 index 06a1c49cd9..0000000000 --- a/meta-selftest/recipes-test/devtool/files/devtool-upgrade-0.1.tar.gz +++ /dev/null diff --git a/meta-selftest/recipes-test/devtool/files/devtool-upgrade-0.2.tar.gz b/meta-selftest/recipes-test/devtool/files/devtool-upgrade-0.2.tar.gz Binary files differdeleted file mode 100644 index 9b0dcf4b6c..0000000000 --- a/meta-selftest/recipes-test/devtool/files/devtool-upgrade-0.2.tar.gz +++ /dev/null diff --git a/meta-selftest/recipes-test/emptytest/emptytest.bb b/meta-selftest/recipes-test/emptytest/emptytest.bb index e87f4d7543..905c6694f3 100644 --- a/meta-selftest/recipes-test/emptytest/emptytest.bb +++ b/meta-selftest/recipes-test/emptytest/emptytest.bb @@ -3,3 +3,5 @@ include test_recipe.inc # Set LICENSE to something so that bitbake -p that is ran at the beginning # is successful since test_recipe.inc has not yet been modified. LICENSE = "" + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-selftest/recipes-test/error/error.bb b/meta-selftest/recipes-test/error/error.bb index a7bdecf29d..65d00a46d9 100644 --- a/meta-selftest/recipes-test/error/error.bb +++ b/meta-selftest/recipes-test/error/error.bb @@ -1,9 +1,8 @@ SUMMARY = "Error Test case that fails on do_compile" DESCRIPTION = "This generates a compile time error to be used to for testing." LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" -INHIBIT_DEFAULT_DEPS = "1" +INHIBIT_DEFAULT_DEPS = "1" EXCLUDE_FROM_WORLD = "1" do_compile() { diff --git a/meta-selftest/recipes-test/fortran/files/hello.f95 b/meta-selftest/recipes-test/fortran/files/hello.f95 new file mode 100644 index 0000000000..a0745fc64d --- /dev/null +++ b/meta-selftest/recipes-test/fortran/files/hello.f95 @@ -0,0 +1,5 @@ +program helloworld + + print * , "Hello World!" + +end program helloworld diff --git a/meta-selftest/recipes-test/fortran/fortran-helloworld.bb b/meta-selftest/recipes-test/fortran/fortran-helloworld.bb new file mode 100644 index 0000000000..3a46404477 --- /dev/null +++ b/meta-selftest/recipes-test/fortran/fortran-helloworld.bb @@ -0,0 +1,24 @@ +SUMMARY = "Fortran Hello World" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +DEPENDS = "libgfortran" + +SRC_URI = "file://hello.f95" + +# These set flags that Fortran doesn't support +SECURITY_CFLAGS = "" +SECURITY_LDFLAGS = "" + +do_compile() { + ${FC} ${LDFLAGS} ${WORKDIR}/hello.f95 -o ${B}/fortran-hello +} + +do_install() { + install -D ${B}/fortran-hello ${D}${bindir}/fortran-hello +} + +python () { + if not d.getVar("FORTRAN"): + raise bb.parse.SkipRecipe("Fortran isn't enabled") +} 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..cc5d7eae5a --- /dev/null +++ b/meta-selftest/recipes-test/git-submodule-test/git-submodule-test.bb @@ -0,0 +1,9 @@ +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" + +SRC_URI = "gitsm://git.yoctoproject.org/git-submodule-test;branch=master" +SRCREV = "a2885dd7d25380d23627e7544b7bbb55014b16ee" 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..bccda17ee9 --- /dev/null +++ b/meta-selftest/recipes-test/gitrepotest/gitrepotest/0001-testpatch.patch @@ -0,0 +1,9 @@ +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..602e895199 --- /dev/null +++ b/meta-selftest/recipes-test/gitunpackoffline/gitunpackoffline-fail.bb @@ -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/gitunpackoffline/gitunpackoffline.bb b/meta-selftest/recipes-test/gitunpackoffline/gitunpackoffline.bb new file mode 100644 index 0000000000..597c89b199 --- /dev/null +++ b/meta-selftest/recipes-test/gitunpackoffline/gitunpackoffline.bb @@ -0,0 +1,5 @@ +require gitunpackoffline-fail.bb + +TAGVALUE = "2.11" + +PV = "0.0+git${SRCPV}" diff --git a/meta-selftest/recipes-test/images/oe-selftest-image.bb b/meta-selftest/recipes-test/images/oe-selftest-image.bb index f17094c5d0..e295943ae5 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 ${ROOTFS_PKGMANAGE_BOOTSTRAP} dropbear" +# libudev is needed for deploy mdadm via devtool +IMAGE_INSTALL = "packagegroup-core-boot dropbear libudev" IMAGE_FEATURES = "debug-tweaks" IMAGE_LINGUAS = " " diff --git a/meta-selftest/recipes-test/images/core-image-empty.bb b/meta-selftest/recipes-test/images/test-empty-image.bb index 550567c261..88d8d612e8 100644 --- a/meta-selftest/recipes-test/images/core-image-empty.bb +++ b/meta-selftest/recipes-test/images/test-empty-image.bb @@ -2,6 +2,5 @@ SUMMARY = "An empty image." IMAGE_INSTALL = "" IMAGE_LINGUAS = "" PACKAGE_INSTALL = "" -LICENSE = "MIT" inherit image diff --git a/meta-selftest/recipes-test/images/wic-image-minimal.bb b/meta-selftest/recipes-test/images/wic-image-minimal.bb index 89451bd200..84d3721885 100644 --- a/meta-selftest/recipes-test/images/wic-image-minimal.bb +++ b/meta-selftest/recipes-test/images/wic-image-minimal.bb @@ -2,16 +2,16 @@ SUMMARY = "An example of partitioned image." SRC_URI = "file://${FILE_DIRNAME}/${BPN}.wks" -IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP}" +IMAGE_INSTALL = "packagegroup-core-boot" -IMAGE_FSTYPES = "wic.bz2" -RM_OLD_IMAGE = "1" +IMAGE_FSTYPES = "wic" -DEPENDS = "syslinux syslinux-native parted-native dosfstools-native mtools-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" -# core-image-minimal is referenced in .wks, so we need its rootfs -# to be ready before our rootfs -do_rootfs[depends] += "core-image-minimal:do_rootfs" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" IMAGE_ROOTFS_EXTRA_SPACE = "2000" diff --git a/meta-selftest/recipes-test/images/wic-image-minimal.wks b/meta-selftest/recipes-test/images/wic-image-minimal.wks index 8f9be09a7e..ae69cb6e3c 100644 --- a/meta-selftest/recipes-test/images/wic-image-minimal.wks +++ b/meta-selftest/recipes-test/images/wic-image-minimal.wks @@ -3,8 +3,8 @@ # created from core-image-minimal and wic-image-minimal image recipes. part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024 -part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 -part /core --source rootfs --rootfs-dir=core-image-minimal --ondisk sda --fstype=ext4 --label core --align 1024 -part /backup --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda --fstype=ext4 --label backup --align 1024 +part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid +part /media --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda --fstype=ext4 --label uuid-test --align 1024 --use-uuid --fsuuid 2c71ef06-a81d-4735-9d3a-379b69c6bdba +part /mnt --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda --fstype=ext4 --label core --align 1024 -bootloader --timeout=0 --append="rootwait console=tty0" +bootloader --ptable gpt --timeout=0 --append="rootwait console=tty0" diff --git a/meta-selftest/recipes-test/license/incompatible-license-alias.bb b/meta-selftest/recipes-test/license/incompatible-license-alias.bb new file mode 100644 index 0000000000..e0b4e13c26 --- /dev/null +++ b/meta-selftest/recipes-test/license/incompatible-license-alias.bb @@ -0,0 +1,3 @@ +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" diff --git a/meta-selftest/recipes-test/license/incompatible-license.bb b/meta-selftest/recipes-test/license/incompatible-license.bb new file mode 100644 index 0000000000..282f5c2875 --- /dev/null +++ b/meta-selftest/recipes-test/license/incompatible-license.bb @@ -0,0 +1,3 @@ +SUMMARY = "Recipe with an SPDX license" +DESCRIPTION = "Is licensed with an SPDX license to be used for testing" +LICENSE = "GPL-3.0-only" 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..ab3b58d2c9 --- /dev/null +++ b/meta-selftest/recipes-test/license/incompatible-licenses.bb @@ -0,0 +1,3 @@ +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 & LGPL-3.0-only" diff --git a/meta-selftest/recipes-test/license/incompatible-nonspdx-license.bb b/meta-selftest/recipes-test/license/incompatible-nonspdx-license.bb new file mode 100644 index 0000000000..35af0966ef --- /dev/null +++ b/meta-selftest/recipes-test/license/incompatible-nonspdx-license.bb @@ -0,0 +1,3 @@ +SUMMARY = "Recipe with a non-SPDX license" +DESCRIPTION = "Is licensed with a non-SPDX license to be used for testing" +LICENSE = "FooLicense" 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/m4/m4_1.4.17.bbappend b/meta-selftest/recipes-test/m4/m4_%.bbappend index 205720982c..205720982c 100644 --- a/meta-selftest/recipes-test/m4/m4_1.4.17.bbappend +++ b/meta-selftest/recipes-test/m4/m4_%.bbappend 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 new file mode 100644 index 0000000000..b1d5eab2b8 --- /dev/null +++ b/meta-selftest/recipes-test/man-db/files/0001-Test-patch-here.patch @@ -0,0 +1,22 @@ +From efc8831f33106e6b48de8e612c2d816fe7d1ae68 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Fri, 9 Feb 2018 17:37:48 +0200 +Subject: [PATCH] Test patch here! + +This is an invalid patch used by oe-selftest +--- + README | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/README b/README +index 48fff57..26d1234 100644 +--- a/README ++++ b/README +@@ -1,3 +1,4 @@ ++This is a test patch for purposes of oe-selftest + THIS LINE MAKES THIS PATCH INVALID README for the man-db manual pager suite + ======================================== + +-- +2.15.1 + diff --git a/meta-selftest/recipes-test/man/man_1.6g.bbappend b/meta-selftest/recipes-test/man-db/man-db_%.bbappend index 205720982c..205720982c 100644 --- a/meta-selftest/recipes-test/man/man_1.6g.bbappend +++ b/meta-selftest/recipes-test/man-db/man-db_%.bbappend diff --git a/meta-selftest/recipes-test/man/man/man-1.5h1-make.patch b/meta-selftest/recipes-test/man/man/man-1.5h1-make.patch deleted file mode 100644 index a0d59b78ce..0000000000 --- a/meta-selftest/recipes-test/man/man/man-1.5h1-make.patch +++ /dev/null @@ -1,16 +0,0 @@ -Test patch here! -This is invalid patch used by tests in scripts/lib/selftests. - ---- man-1.5g/man/Makefile.in.mike Fri Apr 9 13:35:54 1999 -+++ man-1.5g/man/Makefile.in Fri Apr 9 13:36:45 1999 -@@ -1,8 +1,8 @@ - #MAKE THIS PATCH INVALID - MAN1 = man whatis apropos --MAN5 = man.conf -+MAN5 = man.config - MAN8 = makewhatis --ALL = man.1 whatis.1 apropos.1 man.conf.5 -+ALL = man.1 whatis.1 apropos.1 man.config.5 - MAYBE8 = makewhatis - - .SUFFIXES: .man .1 .5 .8 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 new file mode 100644 index 0000000000..daf2834958 --- /dev/null +++ b/meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb @@ -0,0 +1,28 @@ +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" + +MC_DEPLOY_DIR_IMAGE = "${TOPDIR}/tmp-mc-${MCNAME}/deploy/images/${MCMACHINE}" + +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}/bzImage ${D}/var/lib/machines/${MCNAME} +} + +python () { + mcname = d.getVar('MCNAME') + if not mcname: + raise bb.parse.SkipRecipe("Not a multiconfig target") + multiconfigs = d.getVar('BBMULTICONFIG') or "" + if mcname not in multiconfigs: + raise bb.parse.SkipRecipe("multiconfig target %s not enabled" % mcname) +} + +BBCLASSEXTEND = "mcextend:tiny mcextend:musl" diff --git a/meta-selftest/recipes-test/multiconfig/multiconfig-test-parse.bb b/meta-selftest/recipes-test/multiconfig/multiconfig-test-parse.bb new file mode 100644 index 0000000000..6236697453 --- /dev/null +++ b/meta-selftest/recipes-test/multiconfig/multiconfig-test-parse.bb @@ -0,0 +1,11 @@ +SUMMARY = "Test Multiconfig Parsing" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +INHIBIT_DEFAULT_DEPS = "1" + +do_showvar() { + bbplain "MCTESTVAR=${MCTESTVAR}" +} +addtask do_showvar + 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..913a4d1fdb --- /dev/null +++ b/meta-selftest/recipes-test/overlayfs-user/overlayfs-user.bb @@ -0,0 +1,17 @@ +SUMMARY = "Overlayfs class unit test" +DESCRIPTION = "Contains an overlayfs configuration" +LICENSE = "MIT" + +INHIBIT_DEFAULT_DEPS = "1" +EXCLUDE_FROM_WORLD = "1" + +inherit ${@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 +} + +FILES:${PN} += "/usr" diff --git a/meta-selftest/recipes-test/poison/poison.bb b/meta-selftest/recipes-test/poison/poison.bb new file mode 100644 index 0000000000..7ace901cc3 --- /dev/null +++ b/meta-selftest/recipes-test/poison/poison.bb @@ -0,0 +1,16 @@ +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() { + touch empty.c + ${CPP} ${CFLAGS} -I/usr/include empty.c +} + +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 new file mode 100644 index 0000000000..b936c4f44b --- /dev/null +++ b/meta-selftest/recipes-test/postinst/postinst_1.0.bb @@ -0,0 +1,72 @@ +SUMMARY = "Packages to exercise postinstall functions" +LICENSE = "MIT" + +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" + +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 () { + set -e + + if [ -z "$D" ]; then + echo "${PN}-rootfs should have finished at rootfs time" + exit 1 + fi + + if [ -e $D${TESTDIR}/rootfs ]; then + echo "$D${TESTDIR}/rootfs exists, but should not" + exit 1 + fi + + mkdir -p $D${TESTDIR} + touch $D${TESTDIR}/rootfs +} + +# Depends on rootfs, delays until first boot, verifies that the rootfs file was +# written. +pkg_postinst_ontarget:${PN}-delayed-a () { + set -e + + if [ ! -e ${TESTDIR}/rootfs ]; then + echo "${PN}-delayed-a: ${TESTDIR}/rootfs not found" + exit 1 + fi + + touch ${TESTDIR}/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 () { + set -e + + if [ ! -e ${TESTDIR}/delayed-a ]; then + echo "${PN}-delayed-b: ${TESTDIR}/delayed-a not found" + exit 1 + fi + + touch ${TESTDIR}/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 () { + mkdir -p $D${TESTDIR} + touch $D${TESTDIR}/rootfs-before-failure + run_a_really_broken_command + # Scriptlet execution should stop here; the following commands are NOT supposed to run. + # (oe-selftest checks for it). + touch $D${TESTDIR}/rootfs-after-failure +} 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/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 7d0a040beb..e127b48b15 100644 --- a/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb +++ b/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb @@ -10,11 +10,12 @@ 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" +EXCLUDE_FROM_WORLD = "1" + install_extrafunc() { install -m 0644 ${WORKDIR}/selftest-replaceme-inst-func ${D}${datadir}/selftest-replaceme-inst-func } @@ -25,7 +26,6 @@ do_install() { 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 -d ${D}${sysconfdir} @@ -34,9 +34,9 @@ do_install() { 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.inc b/meta-selftest/recipes-test/recipeutils/recipeutils-test.inc new file mode 100644 index 0000000000..8490b902d7 --- /dev/null +++ b/meta-selftest/recipes-test/recipeutils/recipeutils-test.inc @@ -0,0 +1,5 @@ +SRC_URI = "http://xorg.freedesktop.org/releases/individual/lib/libxshmfence-${PV}.tar.bz2" + +SRC_URI[md5sum] = "66662e76899112c0f99e22f2fc775a7e" +SRC_URI[sha256sum] = "d21b2d1fd78c1efbe1f2c16dae1cb23f8fd231dcf891465b8debe636a9054b0c" + diff --git a/meta-selftest/recipes-test/recipeutils/recipeutils-test/anotherfile b/meta-selftest/recipes-test/recipeutils/recipeutils-test/anotherfile new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/meta-selftest/recipes-test/recipeutils/recipeutils-test/anotherfile diff --git a/meta-selftest/recipes-test/recipeutils/recipeutils-test/somefile b/meta-selftest/recipes-test/recipeutils/recipeutils-test/somefile new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/meta-selftest/recipes-test/recipeutils/recipeutils-test/somefile diff --git a/meta-selftest/recipes-test/recipeutils/recipeutils-test_1.2.bb b/meta-selftest/recipes-test/recipeutils/recipeutils-test_1.2.bb new file mode 100644 index 0000000000..062d6a7a05 --- /dev/null +++ b/meta-selftest/recipes-test/recipeutils/recipeutils-test_1.2.bb @@ -0,0 +1,13 @@ +SUMMARY = "Test recipe for recipeutils.patch_recipe()" + +require recipeutils-test.inc + +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://${WORKDIR}/somefile;md5=d41d8cd98f00b204e9800998ecf8427e" +DEPENDS += "zlib" + +BBCLASSEXTEND = "native nativesdk" + +SRC_URI += "file://somefile" + +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..aa6ce0c2a0 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-chown/selftest-chown.bb @@ -0,0 +1,30 @@ +SUMMARY = "selftest chown" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +LICENSE = "MIT" + +DEPENDS += "coreutils-native" + +S = "${WORKDIR}" + +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 new file mode 100644 index 0000000000..4a9b94eceb --- /dev/null +++ b/meta-selftest/recipes-test/selftest-ed/selftest-ed_0.5.bb @@ -0,0 +1,24 @@ +SUMMARY = "Line-oriented text editor -- selftest GPLv2 version" +HOMEPAGE = "http://www.gnu.org/software/ed/" +SECTION = "base" +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" +SRC_URI[sha256sum] = "edef2bbde0fbf0d88232782a0eded323f483a0519d6fde9a3b1809056fd35f3e" + +inherit autotools texinfo + +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" + +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 new file mode 100644 index 0000000000..b92740de32 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb @@ -0,0 +1,38 @@ +SUMMARY = "Line-oriented text editor -- selftest variant" +HOMEPAGE = "http://www.gnu.org/software/ed/" + +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" + +SECTION = "base" + +# LSB states that ed should be in /bin/ +bindir = "${base_bindir}" + +SRC_URI = "${GNU_MIRROR}/ed/ed-${PV}.tar.lz" +RECIPE_NO_UPDATE_REASON = "This recipe is used in selftest and shouldn't be updated otherwise" + +SRC_URI[md5sum] = "7f4a54fa7f366479f03654b8af645fd0" +SRC_URI[sha256sum] = "ffb97eb8f2a2b5a71a9b97e3872adce953aa1b8958e04c5b7bf11d556f32552a" + +S = "${WORKDIR}/ed-${PV}" + +EXTRA_OEMAKE = "-e MAKEFLAGS=" + +inherit texinfo + +do_configure() { + ${S}/configure +} + +do_install() { + oe_runmake 'DESTDIR=${D}' install + # Info dir listing isn't interesting at this point so remove it if it exists. + if [ -e "${D}${infodir}/dir" ]; then + 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 new file mode 100644 index 0000000000..be346b8a0e --- /dev/null +++ b/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb @@ -0,0 +1,30 @@ +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +LICENSE = "MIT" + +SRC_URI = "file://hello.c \ + file://gdb.sh \ +" + +S = "${WORKDIR}" + +do_compile () { + ${CC} hello.c -o hello1 ${CFLAGS} ${LDFLAGS} +} + +do_install () { + install -d ${D}${bindir} + install -m 755 ${WORKDIR}/gdb.sh ${D}${bindir}/ + install -m 755 hello1 ${D}${bindir}/hello1 + ln ${D}${bindir}/hello1 ${D}${bindir}/hello2 + + install -d ${D}${libexecdir} + ln ${D}${bindir}/hello1 ${D}${libexecdir}/hello3 + ln ${D}${bindir}/hello1 ${D}${libexecdir}/hello4 + + dd if=/dev/zero of=${D}${bindir}/sparsetest bs=1 count=0 seek=1M +} + +RDEPENDS:${PN}-gdb += "gdb" +PACKAGES =+ "${PN}-gdb" +FILES:${PN}-gdb = "${bindir}/gdb.sh" diff --git a/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink/gdb.sh b/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink/gdb.sh new file mode 100755 index 0000000000..f6417d5458 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink/gdb.sh @@ -0,0 +1,8 @@ +#!/bin/sh +gdb -q $1 <<'EOF' +b main +r +c +q +EOF +echo "" diff --git a/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink/hello.c b/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink/hello.c new file mode 100644 index 0000000000..5c45dc60bd --- /dev/null +++ b/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink/hello.c @@ -0,0 +1,5 @@ +#include <stdio.h> + +int main() { + printf("Hello World!\n"); +}
\ No newline at end of file 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/xcursor-transparent-theme/xcursor-transparent-theme_0.1.1.bbappend b/meta-selftest/recipes-test/systemd-machine-units/systemd-machine-units_%.bbappend index 205720982c..205720982c 100644 --- a/meta-selftest/recipes-test/xcursor-transparent-theme/xcursor-transparent-theme_0.1.1.bbappend +++ b/meta-selftest/recipes-test/systemd-machine-units/systemd-machine-units_%.bbappend diff --git a/meta-selftest/recipes-test/xcursor-transparent-theme/xcursor-transparent-theme_%.bbappend b/meta-selftest/recipes-test/xcursor-transparent-theme/xcursor-transparent-theme_%.bbappend new file mode 100644 index 0000000000..205720982c --- /dev/null +++ b/meta-selftest/recipes-test/xcursor-transparent-theme/xcursor-transparent-theme_%.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/wic/overlayfs_etc.wks.in b/meta-selftest/wic/overlayfs_etc.wks.in new file mode 100644 index 0000000000..1e1e5836e7 --- /dev/null +++ b/meta-selftest/wic/overlayfs_etc.wks.in @@ -0,0 +1,4 @@ +part /boot --active --source bootimg-biosplusefi --ondisk sda --sourceparams="loader=grub-efi" --align 1024 +part / --source rootfs --ondisk sda --fstype=ext4 --use-uuid --align 1024 +part --ondisk sda --fstype=ext4 --size=5 --align 1024 +bootloader --ptable gpt --timeout=1 --append="rootfstype=ext4 console=ttyS0,115200 console=tty0 ${OVERLAYFS_INIT_OPTION}" diff --git a/meta-selftest/wic/test_biosplusefi_plugin.wks b/meta-selftest/wic/test_biosplusefi_plugin.wks new file mode 100644 index 0000000000..5a56c84518 --- /dev/null +++ b/meta-selftest/wic/test_biosplusefi_plugin.wks @@ -0,0 +1,6 @@ +# short-description: This file is used in oe-selftest wic module to test biosplusefi plugin + +part /boot --source bootimg-biosplusefi --sourceparams="loader=grub-efi" --active --align 1024 --use-uuid +part / --source rootfs --fstype=ext4 --align 1024 --use-uuid + +bootloader --timeout=0 --append="console=ttyS0,115200n8" diff --git a/meta-selftest/wic/test_efi_plugin.wks b/meta-selftest/wic/test_efi_plugin.wks new file mode 100644 index 0000000000..1603d6c4bb --- /dev/null +++ b/meta-selftest/wic/test_efi_plugin.wks @@ -0,0 +1,6 @@ +# short-description: This file is used in oe-selftest wic module to test efi plugin + +part /boot --source bootimg-efi --sourceparams="loader=systemd-boot,create-unified-kernel-image=true,initrd=${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES}" --active --align 1024 --use-uuid +part / --source rootfs --fstype=ext4 --align 1024 --use-uuid + +bootloader --timeout=0 --append="console=ttyS0,115200n8" diff --git a/meta-selftest/wic/test_empty_plugin.wks b/meta-selftest/wic/test_empty_plugin.wks new file mode 100644 index 0000000000..4e91e04e19 --- /dev/null +++ b/meta-selftest/wic/test_empty_plugin.wks @@ -0,0 +1,4 @@ +# short-description: image for checking empty partition creation + +part / --source rootfs --fstype=ext4 --align 1024 --use-uuid +part empty --source empty --ondisk sda --size 1024 --align 1024 diff --git a/meta-selftest/wic/test_rawcopy_plugin.wks.in b/meta-selftest/wic/test_rawcopy_plugin.wks.in new file mode 100644 index 0000000000..83be4be914 --- /dev/null +++ b/meta-selftest/wic/test_rawcopy_plugin.wks.in @@ -0,0 +1,6 @@ +# short-description: This file is used in oe-selftest wic module to test rawcopy plugin + +part /boot --active --source bootimg-pcbios +part / --source rawcopy --sourceparams="file=core-image-minimal-${MACHINE}.ext4" --use-uuid + +bootloader --timeout=0 --append="console=ttyS0,115200n8" diff --git a/meta-selftest/wic/wictestdisk.wks b/meta-selftest/wic/wictestdisk.wks new file mode 100644 index 0000000000..d4de24d830 --- /dev/null +++ b/meta-selftest/wic/wictestdisk.wks @@ -0,0 +1,7 @@ +# short-description: image for use in machine agnostic wic test cases + +# /boot is intentionally an empty partition +part /boot --ondisk sda --label boot --active --align 1024 --size 16 +part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid + +# bootloader is intentionally left out |