|
46 | 46 | #: that would also remove some package owned directories (not %ghost) |
47 | 47 | LOG_CLEAN: str = "rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}" |
48 | 48 |
|
| 49 | + |
49 | 50 | #: The string to use as a placeholder for the build source services to put in the release number |
50 | 51 | _RELEASE_PLACEHOLDER = "%RELEASE%" |
51 | 52 |
|
@@ -311,6 +312,10 @@ class BaseContainerImage(abc.ABC): |
311 | 312 | #: The registry implementation for which this container is being built. |
312 | 313 | _publish_registry: Registry | None = None |
313 | 314 |
|
| 315 | + #: A custom name for the test environment if it is not equal to the |
| 316 | + #: container image's name |
| 317 | + _custom_test_env: str = "" |
| 318 | + |
314 | 319 | @property |
315 | 320 | def publish_registry(self) -> Registry: |
316 | 321 | assert self._publish_registry |
@@ -377,6 +382,20 @@ def oci_version(self) -> str: |
377 | 382 | """ |
378 | 383 | pass |
379 | 384 |
|
| 385 | + @property |
| 386 | + @abc.abstractmethod |
| 387 | + def test_marker(self) -> str: |
| 388 | + """The marker used to identify this image in BCI-Tests""" |
| 389 | + pass |
| 390 | + |
| 391 | + @property |
| 392 | + def test_environment(self) -> str: |
| 393 | + """The test environment name in BCI-Tests corresponding to this |
| 394 | + container image |
| 395 | +
|
| 396 | + """ |
| 397 | + return self._custom_test_env or self.name |
| 398 | + |
380 | 399 | @property |
381 | 400 | def build_name(self) -> str | None: |
382 | 401 | if self.build_tags: |
@@ -1198,6 +1217,10 @@ def prepare_template(self) -> None: |
1198 | 1217 | def registry_prefix(self) -> str: |
1199 | 1218 | return self.publish_registry.registry_prefix(is_application=False) |
1200 | 1219 |
|
| 1220 | + @property |
| 1221 | + def test_marker(self) -> str: |
| 1222 | + return f"{self.name}_{self.stability_tag or self.version}" |
| 1223 | + |
1201 | 1224 | @property |
1202 | 1225 | def image_type(self) -> ImageType: |
1203 | 1226 | return ImageType.SLE_BCI |
@@ -1368,6 +1391,13 @@ def version_to_container_os_version(os_version: OsVersion) -> str: |
1368 | 1391 | return str(os_version) |
1369 | 1392 | return f"15.{os_version}" |
1370 | 1393 |
|
| 1394 | + @property |
| 1395 | + def test_marker(self) -> str: |
| 1396 | + return ( |
| 1397 | + f"bci-{self.name}_{OsContainer.version_to_container_os_version(self.os_version)}" |
| 1398 | + + ("-ltss" if self.os_version.is_ltss else "") |
| 1399 | + ) |
| 1400 | + |
1371 | 1401 | @property |
1372 | 1402 | def uid(self) -> str: |
1373 | 1403 | return self.name |
|
0 commit comments