diff options
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/spdx.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/spdx.py b/meta/lib/oeqa/selftest/cases/spdx.py index be595babb3..8384070219 100644 --- a/meta/lib/oeqa/selftest/cases/spdx.py +++ b/meta/lib/oeqa/selftest/cases/spdx.py | |||
| @@ -110,6 +110,7 @@ class SPDX3CheckBase(object): | |||
| 110 | "SDKMACHINE", | 110 | "SDKMACHINE", |
| 111 | "SDK_DEPLOY", | 111 | "SDK_DEPLOY", |
| 112 | "SPDX_VERSION", | 112 | "SPDX_VERSION", |
| 113 | "SSTATE_PKGARCH", | ||
| 113 | "TOOLCHAIN_OUTPUTNAME", | 114 | "TOOLCHAIN_OUTPUTNAME", |
| 114 | ], | 115 | ], |
| 115 | target_name, | 116 | target_name, |
| @@ -136,6 +137,34 @@ class SPDX30Check(SPDX3CheckBase, OESelftestTestCase): | |||
| 136 | "{DEPLOY_DIR_SPDX}/{MACHINE_ARCH}/packages/base-files.spdx.json", | 137 | "{DEPLOY_DIR_SPDX}/{MACHINE_ARCH}/packages/base-files.spdx.json", |
| 137 | ) | 138 | ) |
| 138 | 139 | ||
| 140 | |||
| 141 | def test_gcc_include_source(self): | ||
| 142 | import oe.spdx30 | ||
| 143 | |||
| 144 | objset = self.check_recipe_spdx( | ||
| 145 | "gcc", | ||
| 146 | "{DEPLOY_DIR_SPDX}/{SSTATE_PKGARCH}/recipes/gcc.spdx.json", | ||
| 147 | extraconf=textwrap.dedent( | ||
| 148 | """\ | ||
| 149 | SPDX_INCLUDE_SOURCES = "1" | ||
| 150 | """ | ||
| 151 | ), | ||
| 152 | ) | ||
| 153 | |||
| 154 | gcc_pv = get_bb_var("PV", "gcc") | ||
| 155 | filename = f'gcc-{gcc_pv}/README' | ||
| 156 | found = False | ||
| 157 | for software_file in objset.foreach_type(oe.spdx30.software_File): | ||
| 158 | if software_file.name == filename: | ||
| 159 | found = True | ||
| 160 | self.logger.info(f"The spdxId of {filename} in gcc.spdx.json is {software_file.spdxId}") | ||
| 161 | break | ||
| 162 | |||
| 163 | self.assertTrue( | ||
| 164 | found, | ||
| 165 | f"Not found source file {filename} in gcc.spdx.json\n" | ||
| 166 | ) | ||
| 167 | |||
| 139 | def test_core_image_minimal(self): | 168 | def test_core_image_minimal(self): |
| 140 | objset = self.check_recipe_spdx( | 169 | objset = self.check_recipe_spdx( |
| 141 | "core-image-minimal", | 170 | "core-image-minimal", |
