diff options
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/classes/rootfs-postcommands.bbclass | 10 | ||||
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/overlayfs.py | 20 |
2 files changed, 27 insertions, 3 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index 7b92df69c5..9b6824043c 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass | |||
| @@ -398,6 +398,10 @@ python overlayfs_qa_check() { | |||
| 398 | 398 | ||
| 399 | allUnitExist = True; | 399 | allUnitExist = True; |
| 400 | for mountPoint in overlayMountPoints: | 400 | for mountPoint in overlayMountPoints: |
| 401 | qaSkip = (d.getVarFlag("OVERLAYFS_QA_SKIP", mountPoint) or "").split() | ||
| 402 | if "mount-configured" in qaSkip: | ||
| 403 | continue | ||
| 404 | |||
| 401 | mountPath = d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint) | 405 | mountPath = d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint) |
| 402 | if mountPath in fstabDevices: | 406 | if mountPath in fstabDevices: |
| 403 | continue | 407 | continue |
| @@ -407,8 +411,10 @@ python overlayfs_qa_check() { | |||
| 407 | for dirpath in searchpaths): | 411 | for dirpath in searchpaths): |
| 408 | continue | 412 | continue |
| 409 | 413 | ||
| 410 | bb.warn('Mount path %s not found in fstat and unit %s not found ' | 414 | bb.warn(f'Mount path {mountPath} not found in fstab and unit ' |
| 411 | 'in systemd unit directories' % (mountPath, mountUnit)) | 415 | f'{mountUnit} not found in systemd unit directories.') |
| 416 | bb.warn(f'Skip this check by setting OVERLAYFS_QA_SKIP[{mountPoint}] = ' | ||
| 417 | '"mount-configured"') | ||
| 412 | allUnitExist = False; | 418 | allUnitExist = False; |
| 413 | 419 | ||
| 414 | if not allUnitExist: | 420 | if not allUnitExist: |
diff --git a/meta/lib/oeqa/selftest/cases/overlayfs.py b/meta/lib/oeqa/selftest/cases/overlayfs.py index 472746a64f..ce1d2f1ec3 100644 --- a/meta/lib/oeqa/selftest/cases/overlayfs.py +++ b/meta/lib/oeqa/selftest/cases/overlayfs.py | |||
| @@ -62,11 +62,29 @@ DISTRO_FEATURES += "systemd overlayfs" | |||
| 62 | self.add_overlay_conf_to_machine() | 62 | self.add_overlay_conf_to_machine() |
| 63 | 63 | ||
| 64 | res = bitbake('core-image-minimal', ignore_status=True) | 64 | res = bitbake('core-image-minimal', ignore_status=True) |
| 65 | line = getline(res, " Mount path /mnt/overlay not found in fstat and unit mnt-overlay.mount not found in systemd unit directories") | 65 | line = getline(res, " Mount path /mnt/overlay not found in fstab and unit mnt-overlay.mount not found in systemd unit directories") |
| 66 | self.assertTrue(line and line.startswith("WARNING:"), msg=res.output) | 66 | self.assertTrue(line and line.startswith("WARNING:"), msg=res.output) |
| 67 | line = getline(res, "Not all mount paths and units are installed in the image") | 67 | line = getline(res, "Not all mount paths and units are installed in the image") |
| 68 | self.assertTrue(line and line.startswith("ERROR:"), msg=res.output) | 68 | self.assertTrue(line and line.startswith("ERROR:"), msg=res.output) |
| 69 | 69 | ||
| 70 | def test_not_all_units_installed_but_qa_skipped(self): | ||
| 71 | """ | ||
| 72 | Summary: Test skipping the QA check | ||
| 73 | Expected: Image is created successfully | ||
| 74 | Author: Claudius Heine <ch@denx.de> | ||
| 75 | """ | ||
| 76 | |||
| 77 | config = """ | ||
| 78 | IMAGE_INSTALL:append = " overlayfs-user" | ||
| 79 | DISTRO_FEATURES += "systemd overlayfs" | ||
| 80 | OVERLAYFS_QA_SKIP[mnt-overlay] = "mount-configured" | ||
| 81 | """ | ||
| 82 | |||
| 83 | self.write_config(config) | ||
| 84 | self.add_overlay_conf_to_machine() | ||
| 85 | |||
| 86 | bitbake('core-image-minimal') | ||
| 87 | |||
| 70 | def test_mount_unit_not_set(self): | 88 | def test_mount_unit_not_set(self): |
| 71 | """ | 89 | """ |
| 72 | Summary: Test whether mount unit was set properly | 90 | Summary: Test whether mount unit was set properly |
