diff options
Diffstat (limited to 'meta/lib')
| -rw-r--r-- | meta/lib/bbconfigbuild/configfragments.py | 18 | ||||
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/fitimage.py | 80 | ||||
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/rust.py | 3 | ||||
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/wic.py | 36 | 
4 files changed, 110 insertions, 27 deletions
diff --git a/meta/lib/bbconfigbuild/configfragments.py b/meta/lib/bbconfigbuild/configfragments.py index 21baedc9a4..6fdac33a5d 100644 --- a/meta/lib/bbconfigbuild/configfragments.py +++ b/meta/lib/bbconfigbuild/configfragments.py  | |||
| @@ -97,12 +97,12 @@ class ConfigFragmentsPlugin(LayerPlugin): | |||
| 97 | print_fragment(f, args.verbose, is_enabled=False) | 97 | print_fragment(f, args.verbose, is_enabled=False) | 
| 98 | print('') | 98 | print('') | 
| 99 | 99 | ||
| 100 | def fragment_exists(self, fragmentname): | 100 | def get_fragment(self, fragmentname, fragments): | 
| 101 | for layername, layerdata in self.discover_fragments().items(): | 101 | for layername, layerdata in fragments.items(): | 
| 102 | for f in layerdata['fragments']: | 102 | for f in layerdata['fragments']: | 
| 103 | if f['name'] == fragmentname: | 103 | if f['name'] == fragmentname: | 
| 104 | return True | 104 | return f | 
| 105 | return False | 105 | return None | 
| 106 | 106 | ||
| 107 | def fragment_prefix(self, fragmentname): | 107 | def fragment_prefix(self, fragmentname): | 
| 108 | return fragmentname.split("/",1)[0] | 108 | return fragmentname.split("/",1)[0] | 
| @@ -136,14 +136,19 @@ class ConfigFragmentsPlugin(LayerPlugin): | |||
| 136 | enabled_fragments.append(f) | 136 | enabled_fragments.append(f) | 
| 137 | return " ".join(enabled_fragments), None, 0, True | 137 | return " ".join(enabled_fragments), None, 0, True | 
| 138 | 138 | ||
| 139 | fragments = self.discover_fragments() | ||
| 139 | for f in args.fragmentname: | 140 | for f in args.fragmentname: | 
| 140 | if not self.fragment_exists(f) and not self.builtin_fragment_exists(f): | 141 | if not self.get_fragment(f, fragments) and not self.builtin_fragment_exists(f): | 
| 141 | raise Exception("Fragment {} does not exist; use 'list-fragments' to see the full list.".format(f)) | 142 | raise Exception("Fragment {} does not exist; use 'list-fragments' to see the full list.".format(f)) | 
| 142 | 143 | ||
| 143 | self.create_conf(args.confpath) | 144 | self.create_conf(args.confpath) | 
| 144 | modified = bb.utils.edit_metadata_file(args.confpath, ["OE_FRAGMENTS"], enable_helper) | 145 | modified = bb.utils.edit_metadata_file(args.confpath, ["OE_FRAGMENTS"], enable_helper) | 
| 145 | if modified: | 146 | if modified: | 
| 146 | print("Fragment {} added to {}.".format(", ".join(args.fragmentname), args.confpath)) | 147 | for f in args.fragmentname: | 
| 148 | print("Fragment {} added to {}.".format(f, args.confpath)) | ||
| 149 | f_info = self.get_fragment(f, fragments) | ||
| 150 | if f_info and not args.quiet: | ||
| 151 | print('\nFragment summary: {}\n\nFragment description:\n{}\n'.format(f_info['summary'],f_info['description'])) | ||
| 147 | 152 | ||
| 148 | def do_disable_fragment(self, args): | 153 | def do_disable_fragment(self, args): | 
| 149 | """ Disable a fragment in the local build configuration """ | 154 | """ Disable a fragment in the local build configuration """ | 
| @@ -192,6 +197,7 @@ class ConfigFragmentsPlugin(LayerPlugin): | |||
| 192 | 197 | ||
| 193 | parser_enable_fragment = self.add_command(sp, 'enable-fragment', self.do_enable_fragment, parserecipes=False) | 198 | parser_enable_fragment = self.add_command(sp, 'enable-fragment', self.do_enable_fragment, parserecipes=False) | 
| 194 | parser_enable_fragment.add_argument("--confpath", default=default_confpath, help='Configuration file which contains a list of enabled fragments (default is {}).'.format(default_confpath)) | 199 | parser_enable_fragment.add_argument("--confpath", default=default_confpath, help='Configuration file which contains a list of enabled fragments (default is {}).'.format(default_confpath)) | 
| 200 | parser_list_fragments.add_argument('--quiet', '-q', action='store_true', help='Do not print descriptions of the newly enabled fragments') | ||
| 195 | parser_enable_fragment.add_argument('fragmentname', help='The name of the fragment (use list-fragments to see them)', nargs='+') | 201 | parser_enable_fragment.add_argument('fragmentname', help='The name of the fragment (use list-fragments to see them)', nargs='+') | 
| 196 | 202 | ||
| 197 | parser_disable_fragment = self.add_command(sp, 'disable-fragment', self.do_disable_fragment, parserecipes=False) | 203 | parser_disable_fragment = self.add_command(sp, 'disable-fragment', self.do_disable_fragment, parserecipes=False) | 
diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py index 9c2e10dd2b..8df5e92a34 100644 --- a/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/meta/lib/oeqa/selftest/cases/fitimage.py  | |||
| @@ -9,7 +9,6 @@ import re | |||
| 9 | import shlex | 9 | import shlex | 
| 10 | import logging | 10 | import logging | 
| 11 | import pprint | 11 | import pprint | 
| 12 | import tempfile | ||
| 13 | 12 | ||
| 14 | import oe.fitimage | 13 | import oe.fitimage | 
| 15 | 14 | ||
| @@ -47,10 +46,11 @@ class FitImageTestCase(OESelftestTestCase): | |||
| 47 | # Check if the its file contains the expected paths and attributes. | 46 | # Check if the its file contains the expected paths and attributes. | 
| 48 | # The _get_req_* functions are implemented by more specific chield classes. | 47 | # The _get_req_* functions are implemented by more specific chield classes. | 
| 49 | self._check_its_file() | 48 | self._check_its_file() | 
| 50 | req_its_paths = self._get_req_its_paths() | 49 | req_its_paths, not_req_its_paths = self._get_req_its_paths() | 
| 51 | req_sigvalues_config = self._get_req_sigvalues_config() | 50 | req_sigvalues_config = self._get_req_sigvalues_config() | 
| 52 | req_sigvalues_image = self._get_req_sigvalues_image() | 51 | req_sigvalues_image = self._get_req_sigvalues_image() | 
| 53 | # Compare the its file against req_its_paths, req_sigvalues_config, req_sigvalues_image | 52 | # Compare the its file against req_its_paths, not_req_its_paths, | 
| 53 | # req_sigvalues_config, req_sigvalues_image | ||
| 54 | 54 | ||
| 55 | # Call the dumpimage utiliy and check that it prints all the expected paths and attributes | 55 | # Call the dumpimage utiliy and check that it prints all the expected paths and attributes | 
| 56 | # The _get_req_* functions are implemented by more specific chield classes. | 56 | # The _get_req_* functions are implemented by more specific chield classes. | 
| @@ -198,7 +198,7 @@ class FitImageTestCase(OESelftestTestCase): | |||
| 198 | # Support only the test recipe which provides 1 devicetree and 1 devicetree overlay | 198 | # Support only the test recipe which provides 1 devicetree and 1 devicetree overlay | 
| 199 | pref_prov_dtb = bb_vars.get('PREFERRED_PROVIDER_virtual/dtb') | 199 | pref_prov_dtb = bb_vars.get('PREFERRED_PROVIDER_virtual/dtb') | 
| 200 | if pref_prov_dtb == "bbb-dtbs-as-ext": | 200 | if pref_prov_dtb == "bbb-dtbs-as-ext": | 
| 201 | all_dtbs += ["am335x-bonegreen-ext.dtb", "BBORG_RELAY-00A2.dtbo"] | 201 | all_dtbs += ["BBORG_RELAY-00A2.dtbo", "am335x-bonegreen-ext.dtb"] | 
| 202 | dtb_symlinks.append("am335x-bonegreen-ext-alias.dtb") | 202 | dtb_symlinks.append("am335x-bonegreen-ext-alias.dtb") | 
| 203 | return (all_dtbs, dtb_symlinks) | 203 | return (all_dtbs, dtb_symlinks) | 
| 204 | 204 | ||
| @@ -234,8 +234,9 @@ class FitImageTestCase(OESelftestTestCase): | |||
| 234 | self.logger.debug("its file: %s" % its_file.read()) | 234 | self.logger.debug("its file: %s" % its_file.read()) | 
| 235 | 235 | ||
| 236 | # Generate a list of expected paths in the its file | 236 | # Generate a list of expected paths in the its file | 
| 237 | req_its_paths = self._get_req_its_paths(bb_vars) | 237 | req_its_paths, not_req_its_paths = self._get_req_its_paths(bb_vars) | 
| 238 | self.logger.debug("req_its_paths:\n%s\n" % pprint.pformat(req_its_paths, indent=4)) | 238 | self.logger.debug("req_its_paths:\n%s\n" % pprint.pformat(req_its_paths, indent=4)) | 
| 239 | self.logger.debug("not_req_its_paths:\n%s\n" % pprint.pformat(not_req_its_paths, indent=4)) | ||
| 239 | 240 | ||
| 240 | # Generate a dict of expected configuration signature nodes | 241 | # Generate a dict of expected configuration signature nodes | 
| 241 | req_sigvalues_config = self._get_req_sigvalues_config(bb_vars) | 242 | req_sigvalues_config = self._get_req_sigvalues_config(bb_vars) | 
| @@ -275,6 +276,11 @@ class FitImageTestCase(OESelftestTestCase): | |||
| 275 | if not req_path in its_paths: | 276 | if not req_path in its_paths: | 
| 276 | self.fail('Missing path in its file: %s (%s)' % (req_path, its_file_path)) | 277 | self.fail('Missing path in its file: %s (%s)' % (req_path, its_file_path)) | 
| 277 | 278 | ||
| 279 | # check if all not expected paths are absent in the its file | ||
| 280 | for not_req_path in not_req_its_paths: | ||
| 281 | if not_req_path in its_paths: | ||
| 282 | self.fail('Unexpected path found in its file: %s (%s)' % (not_req_path, its_file_path)) | ||
| 283 | |||
| 278 | # Check if all the expected singnature nodes (images and configurations) are found | 284 | # Check if all the expected singnature nodes (images and configurations) are found | 
| 279 | self.logger.debug("sigs:\n%s\n" % pprint.pformat(sigs, indent=4)) | 285 | self.logger.debug("sigs:\n%s\n" % pprint.pformat(sigs, indent=4)) | 
| 280 | if req_sigvalues_config or req_sigvalues_image: | 286 | if req_sigvalues_config or req_sigvalues_image: | 
| @@ -353,7 +359,7 @@ class FitImageTestCase(OESelftestTestCase): | |||
| 353 | 359 | ||
| 354 | def _get_req_its_paths(self, bb_vars): | 360 | def _get_req_its_paths(self, bb_vars): | 
| 355 | self.logger.error("This function needs to be implemented") | 361 | self.logger.error("This function needs to be implemented") | 
| 356 | return [] | 362 | return ([], []) | 
| 357 | 363 | ||
| 358 | def _get_req_its_fields(self, bb_vars): | 364 | def _get_req_its_fields(self, bb_vars): | 
| 359 | self.logger.error("This function needs to be implemented") | 365 | self.logger.error("This function needs to be implemented") | 
| @@ -499,7 +505,7 @@ class KernelFitImageBase(FitImageTestCase): | |||
| 499 | return (fitimage_its_path, fitimage_path) | 505 | return (fitimage_its_path, fitimage_path) | 
| 500 | 506 | ||
| 501 | def _get_req_its_paths(self, bb_vars): | 507 | def _get_req_its_paths(self, bb_vars): | 
| 502 | """Generate a list of expected paths in the its file | 508 | """Generate a list of expected and a list of not expected paths in the its file | 
| 503 | 509 | ||
| 504 | Example: | 510 | Example: | 
| 505 | [ | 511 | [ | 
| @@ -515,15 +521,26 @@ class KernelFitImageBase(FitImageTestCase): | |||
| 515 | uboot_sign_enable = bb_vars.get('UBOOT_SIGN_ENABLE') | 521 | uboot_sign_enable = bb_vars.get('UBOOT_SIGN_ENABLE') | 
| 516 | 522 | ||
| 517 | # image nodes | 523 | # image nodes | 
| 518 | images = [ 'kernel-1' ] | 524 | images = ['kernel-1'] | 
| 525 | not_images = [] | ||
| 526 | |||
| 519 | if dtb_files: | 527 | if dtb_files: | 
| 520 | images += [ 'fdt-' + dtb for dtb in dtb_files ] | 528 | images += [ 'fdt-' + dtb for dtb in dtb_files ] | 
| 529 | |||
| 521 | if fit_uboot_env: | 530 | if fit_uboot_env: | 
| 522 | images.append('bootscr-' + fit_uboot_env) | 531 | images.append('bootscr-' + fit_uboot_env) | 
| 532 | else: | ||
| 533 | not_images.append('bootscr-boot.cmd') | ||
| 534 | |||
| 523 | if bb_vars['MACHINE'] == "qemux86-64": # Not really the right if | 535 | if bb_vars['MACHINE'] == "qemux86-64": # Not really the right if | 
| 524 | images.append('setup-1') | 536 | images.append('setup-1') | 
| 537 | else: | ||
| 538 | not_images.append('setup-1') | ||
| 539 | |||
| 525 | if initramfs_image and initramfs_image_bundle != "1": | 540 | if initramfs_image and initramfs_image_bundle != "1": | 
| 526 | images.append('ramdisk-1') | 541 | images.append('ramdisk-1') | 
| 542 | else: | ||
| 543 | not_images.append('ramdisk-1') | ||
| 527 | 544 | ||
| 528 | # configuration nodes (one per DTB and also one per symlink) | 545 | # configuration nodes (one per DTB and also one per symlink) | 
| 529 | if dtb_files: | 546 | if dtb_files: | 
| @@ -541,7 +558,12 @@ class KernelFitImageBase(FitImageTestCase): | |||
| 541 | req_its_paths.append(['/', 'configurations', configuration, 'hash-1']) | 558 | req_its_paths.append(['/', 'configurations', configuration, 'hash-1']) | 
| 542 | if uboot_sign_enable == "1": | 559 | if uboot_sign_enable == "1": | 
| 543 | req_its_paths.append(['/', 'configurations', configuration, 'signature-1']) | 560 | req_its_paths.append(['/', 'configurations', configuration, 'signature-1']) | 
| 544 | return req_its_paths | 561 | |
| 562 | not_req_its_paths = [] | ||
| 563 | for image in not_images: | ||
| 564 | not_req_its_paths.append(['/', 'images', image]) | ||
| 565 | |||
| 566 | return (req_its_paths, not_req_its_paths) | ||
| 545 | 567 | ||
| 546 | def _get_req_its_fields(self, bb_vars): | 568 | def _get_req_its_fields(self, bb_vars): | 
| 547 | initramfs_image = bb_vars['INITRAMFS_IMAGE'] | 569 | initramfs_image = bb_vars['INITRAMFS_IMAGE'] | 
| @@ -572,10 +594,23 @@ class KernelFitImageBase(FitImageTestCase): | |||
| 572 | fit_conf_prefix = bb_vars.get('FIT_CONF_PREFIX', "conf-") | 594 | fit_conf_prefix = bb_vars.get('FIT_CONF_PREFIX', "conf-") | 
| 573 | its_field_check.append('default = "' + fit_conf_prefix + fit_conf_default_dtb + '";') | 595 | its_field_check.append('default = "' + fit_conf_prefix + fit_conf_default_dtb + '";') | 
| 574 | 596 | ||
| 575 | its_field_check.append('kernel = "kernel-1";') | 597 | # configuration nodes (one per DTB and also one per symlink) | 
| 598 | dtb_files, dtb_symlinks = FitImageTestCase._get_dtb_files(bb_vars) | ||
| 599 | if dtb_files: | ||
| 600 | for dtb in dtb_files: | ||
| 601 | its_field_check.append('kernel = "kernel-1";') | ||
| 602 | its_field_check.append('fdt = "fdt-%s";' % dtb) | ||
| 603 | for dtb in dtb_symlinks: | ||
| 604 | its_field_check.append('kernel = "kernel-1";') | ||
| 605 | # Works only for tests were the symlink is with -alias suffix | ||
| 606 | its_field_check.append('fdt = "fdt-%s";' % dtb.replace('-alias', '')) | ||
| 576 | 607 | ||
| 577 | if initramfs_image and initramfs_image_bundle != "1": | 608 | if initramfs_image and initramfs_image_bundle != "1": | 
| 578 | its_field_check.append('ramdisk = "ramdisk-1";') | 609 | its_field_check.append('ramdisk = "ramdisk-1";') | 
| 610 | else: | ||
| 611 | its_field_check.append('kernel = "kernel-1";') | ||
| 612 | if initramfs_image and initramfs_image_bundle != "1": | ||
| 613 | its_field_check.append('ramdisk = "ramdisk-1";') | ||
| 579 | 614 | ||
| 580 | return its_field_check | 615 | return its_field_check | 
| 581 | 616 | ||
| @@ -1032,20 +1067,21 @@ class FitImagePyTests(KernelFitImageBase): | |||
| 1032 | # Provide variables without calling bitbake | 1067 | # Provide variables without calling bitbake | 
| 1033 | bb_vars = { | 1068 | bb_vars = { | 
| 1034 | # image-fitimage.conf | 1069 | # image-fitimage.conf | 
| 1070 | 'FIT_ADDRESS_CELLS': "1", | ||
| 1071 | 'FIT_CONF_DEFAULT_DTB': "", | ||
| 1072 | 'FIT_CONF_PREFIX': "conf-", | ||
| 1035 | 'FIT_DESC': "Kernel fitImage for a dummy distro", | 1073 | 'FIT_DESC': "Kernel fitImage for a dummy distro", | 
| 1036 | 'FIT_HASH_ALG': "sha256", | ||
| 1037 | 'FIT_SIGN_ALG': "rsa2048", | ||
| 1038 | 'FIT_PAD_ALG': "pkcs-1.5", | ||
| 1039 | 'FIT_GENERATE_KEYS': "0", | 1074 | 'FIT_GENERATE_KEYS': "0", | 
| 1040 | 'FIT_SIGN_NUMBITS': "2048", | 1075 | 'FIT_HASH_ALG': "sha256", | 
| 1041 | 'FIT_KEY_GENRSA_ARGS': "-F4", | 1076 | 'FIT_KEY_GENRSA_ARGS': "-F4", | 
| 1042 | 'FIT_KEY_REQ_ARGS': "-batch -new", | 1077 | 'FIT_KEY_REQ_ARGS': "-batch -new", | 
| 1043 | 'FIT_KEY_SIGN_PKCS': "-x509", | 1078 | 'FIT_KEY_SIGN_PKCS': "-x509", | 
| 1079 | 'FIT_LINUX_BIN': "linux.bin", | ||
| 1080 | 'FIT_PAD_ALG': "pkcs-1.5", | ||
| 1081 | 'FIT_SIGN_ALG': "rsa2048", | ||
| 1044 | 'FIT_SIGN_INDIVIDUAL': "0", | 1082 | 'FIT_SIGN_INDIVIDUAL': "0", | 
| 1045 | 'FIT_CONF_PREFIX': "conf-", | 1083 | 'FIT_SIGN_NUMBITS': "2048", | 
| 1046 | 'FIT_SUPPORTED_INITRAMFS_FSTYPES': "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio", | 1084 | 'FIT_SUPPORTED_INITRAMFS_FSTYPES': "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio", | 
| 1047 | 'FIT_CONF_DEFAULT_DTB': "", | ||
| 1048 | 'FIT_ADDRESS_CELLS': "1", | ||
| 1049 | 'FIT_UBOOT_ENV': "", | 1085 | 'FIT_UBOOT_ENV': "", | 
| 1050 | # kernel.bbclass | 1086 | # kernel.bbclass | 
| 1051 | 'UBOOT_ENTRYPOINT': "0x20008000", | 1087 | 'UBOOT_ENTRYPOINT': "0x20008000", | 
| @@ -1072,6 +1108,9 @@ class FitImagePyTests(KernelFitImageBase): | |||
| 1072 | } | 1108 | } | 
| 1073 | if bb_vars_overrides: | 1109 | if bb_vars_overrides: | 
| 1074 | bb_vars.update(bb_vars_overrides) | 1110 | bb_vars.update(bb_vars_overrides) | 
| 1111 | if logging.DEBUG >= self.logger.level: | ||
| 1112 | debug_output = "\n".join([f"{key} = {value}" for key, value in bb_vars_overrides.items()]) | ||
| 1113 | self.logger.debug("bb_vars overrides:\n%s" % debug_output) | ||
| 1075 | 1114 | ||
| 1076 | root_node = oe.fitimage.ItsNodeRootKernel( | 1115 | root_node = oe.fitimage.ItsNodeRootKernel( | 
| 1077 | bb_vars["FIT_DESC"], bb_vars["FIT_ADDRESS_CELLS"], | 1116 | bb_vars["FIT_DESC"], bb_vars["FIT_ADDRESS_CELLS"], | 
| @@ -1204,7 +1243,7 @@ class UBootFitImageTests(FitImageTestCase): | |||
| 1204 | req_its_paths.append(['/', 'images', image, 'signature']) | 1243 | req_its_paths.append(['/', 'images', image, 'signature']) | 
| 1205 | for configuration in configurations: | 1244 | for configuration in configurations: | 
| 1206 | req_its_paths.append(['/', 'configurations', configuration]) | 1245 | req_its_paths.append(['/', 'configurations', configuration]) | 
| 1207 | return req_its_paths | 1246 | return (req_its_paths, []) | 
| 1208 | 1247 | ||
| 1209 | def _get_req_its_fields(self, bb_vars): | 1248 | def _get_req_its_fields(self, bb_vars): | 
| 1210 | loadables = ["uboot"] | 1249 | loadables = ["uboot"] | 
| @@ -1730,4 +1769,3 @@ UBOOT_FIT_GENERATE_KEYS = "1" | |||
| 1730 | self.write_config(config) | 1769 | self.write_config(config) | 
| 1731 | bb_vars = self._fit_get_bb_vars() | 1770 | bb_vars = self._fit_get_bb_vars() | 
| 1732 | self._test_fitimage(bb_vars) | 1771 | self._test_fitimage(bb_vars) | 
| 1733 | |||
diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py index 06acf53e9a..31222e2456 100644 --- a/meta/lib/oeqa/selftest/cases/rust.py +++ b/meta/lib/oeqa/selftest/cases/rust.py  | |||
| @@ -122,6 +122,9 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): | |||
| 122 | cmd = "export TARGET_VENDOR=\"-poky\";" | 122 | cmd = "export TARGET_VENDOR=\"-poky\";" | 
| 123 | cmd = cmd + " export PATH=%s/recipe-sysroot-native/usr/bin/python3-native:%s/recipe-sysroot-native/usr/bin:%s/recipe-sysroot-native/usr/bin/%s:%s/hosttools:$PATH;" % (rustlibpath, rustlibpath, rustlibpath, tcpath, tmpdir) | 123 | cmd = cmd + " export PATH=%s/recipe-sysroot-native/usr/bin/python3-native:%s/recipe-sysroot-native/usr/bin:%s/recipe-sysroot-native/usr/bin/%s:%s/hosttools:$PATH;" % (rustlibpath, rustlibpath, rustlibpath, tcpath, tmpdir) | 
| 124 | cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath | 124 | cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath | 
| 125 | # Strip debug symbols from test binaries to reduce size (300+ MB -> ~140 MB) | ||
| 126 | # PowerPC mac99 QEMU has 768MB RAM limit, so we need to minimize test binary sizes | ||
| 127 | cmd = cmd + " export RUSTFLAGS='-C strip=debuginfo';" | ||
| 125 | # Trigger testing. | 128 | # Trigger testing. | 
| 126 | cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip | 129 | cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip | 
| 127 | cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py test %s --target %s" % (builddir, testargs, targetsys) | 130 | cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py test %s --target %s" % (builddir, testargs, targetsys) | 
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index bb4ac23ebf..d7a9b14658 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py  | |||
| @@ -1905,6 +1905,42 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot" | |||
| 1905 | self.assertIn("Source parameter 'fill' only works with the '--fixed-size' option, exiting.", result.output) | 1905 | self.assertIn("Source parameter 'fill' only works with the '--fixed-size' option, exiting.", result.output) | 
| 1906 | self.assertNotEqual(0, result.status) | 1906 | self.assertNotEqual(0, result.status) | 
| 1907 | 1907 | ||
| 1908 | def test_diskid_on_msdos_partition(self): | ||
| 1909 | """Test diksid on msdos partions""" | ||
| 1910 | img = 'core-image-minimal' | ||
| 1911 | diskid = "0xdeadbbef" | ||
| 1912 | with NamedTemporaryFile("w", suffix=".wks") as wks: | ||
| 1913 | wks.writelines(['bootloader --ptable msdos --diskid %s\n' % diskid, | ||
| 1914 | 'part /boot --size=100M --active --fstype=ext4 --label boot\n' | ||
| 1915 | 'part / --source rootfs --fstype=ext4 --label root\n']) | ||
| 1916 | wks.flush() | ||
| 1917 | cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir) | ||
| 1918 | runCmd(cmd) | ||
| 1919 | wksname = os.path.splitext(os.path.basename(wks.name))[0] | ||
| 1920 | out = glob(os.path.join(self.resultdir, "%s-*direct" % wksname)) | ||
| 1921 | self.assertEqual(1, len(out)) | ||
| 1922 | sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools') | ||
| 1923 | result = runCmd("%s/usr/sbin/sfdisk -l %s | grep 'Disk identifier:'" % (sysroot, out[0])) | ||
| 1924 | self.assertEqual("Disk identifier: %s" % diskid.lower(), result.output) | ||
| 1925 | |||
| 1926 | def test_diskid_on_gpt_partition(self): | ||
| 1927 | """Test diksid on gpt partions""" | ||
| 1928 | img = 'core-image-minimal' | ||
| 1929 | diskid = "deadbeef-cafe-babe-f00d-cec2ea4eface" | ||
| 1930 | with NamedTemporaryFile("w", suffix=".wks") as wks: | ||
| 1931 | wks.writelines(['bootloader --ptable gpt --diskid %s\n' % diskid, | ||
| 1932 | 'part /boot --size=100M --active --fstype=ext4 --label boot\n' | ||
| 1933 | 'part / --source rootfs --fstype=ext4 --label root\n']) | ||
| 1934 | wks.flush() | ||
| 1935 | cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir) | ||
| 1936 | runCmd(cmd) | ||
| 1937 | wksname = os.path.splitext(os.path.basename(wks.name))[0] | ||
| 1938 | out = glob(os.path.join(self.resultdir, "%s-*direct" % wksname)) | ||
| 1939 | self.assertEqual(1, len(out)) | ||
| 1940 | sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools') | ||
| 1941 | result = runCmd("%s/usr/sbin/sfdisk -l %s | grep 'Disk identifier:'" % (sysroot, out[0])) | ||
| 1942 | self.assertEqual("Disk identifier: %s" % diskid.upper(), result.output) | ||
| 1943 | |||
| 1908 | class ModifyTests(WicTestCase): | 1944 | class ModifyTests(WicTestCase): | 
| 1909 | def test_wic_ls(self): | 1945 | def test_wic_ls(self): | 
| 1910 | """Test listing image content using 'wic ls'""" | 1946 | """Test listing image content using 'wic ls'""" | 
