|
1 | 1 | import json
|
2 | 2 | import os
|
3 |
| -import platform |
4 | 3 | import random
|
5 | 4 | import shutil
|
6 | 5 | import subprocess
|
|
29 | 28 | # for these tests we use manylinux2014 images, because they're available on
|
30 | 29 | # multi architectures and include python3.8
|
31 | 30 | DEFAULT_IMAGE = "quay.io/pypa/manylinux2014:2025.03.08-1"
|
32 |
| -pm = platform.machine() |
33 |
| -DEFAULT_OCI_PLATFORM = { |
34 |
| - "AMD64": OCIPlatform.AMD64, |
35 |
| - "x86_64": OCIPlatform.AMD64, |
36 |
| - "ppc64le": OCIPlatform.PPC64LE, |
37 |
| - "s390x": OCIPlatform.S390X, |
38 |
| - "aarch64": OCIPlatform.ARM64, |
39 |
| - "arm64": OCIPlatform.ARM64, |
40 |
| - "ARM64": OCIPlatform.ARM64, |
41 |
| -}[pm] |
| 31 | +DEFAULT_OCI_PLATFORM = OCIPlatform.native() |
42 | 32 |
|
43 | 33 | PODMAN = OCIContainerEngineConfig(name="podman")
|
44 | 34 |
|
@@ -494,7 +484,7 @@ def test_parse_engine_config(config, name, create_args, capsys):
|
494 | 484 | )
|
495 | 485 |
|
496 | 486 |
|
497 |
| -@pytest.mark.skipif(pm != "x86_64", reason="Only runs on x86_64") |
| 487 | +@pytest.mark.skipif(DEFAULT_OCI_PLATFORM != OCIPlatform.AMD64, reason="Only runs on x86_64") |
498 | 488 | def test_enforce_32_bit(container_engine):
|
499 | 489 | with OCIContainer(
|
500 | 490 | engine=container_engine, image=DEFAULT_IMAGE, oci_platform=OCIPlatform.i386
|
@@ -551,7 +541,7 @@ def test_local_image(
|
551 | 541 | ) -> None:
|
552 | 542 | if (
|
553 | 543 | detect_ci_provider() == CIProvider.travis_ci
|
554 |
| - and pm != "x86_64" |
| 544 | + and DEFAULT_OCI_PLATFORM != OCIPlatform.AMD64 |
555 | 545 | and platform != DEFAULT_OCI_PLATFORM
|
556 | 546 | ):
|
557 | 547 | pytest.skip("Skipping test because docker on this platform does not support QEMU")
|
@@ -581,7 +571,7 @@ def test_local_image(
|
581 | 571 | def test_multiarch_image(container_engine, platform):
|
582 | 572 | if (
|
583 | 573 | detect_ci_provider() == CIProvider.travis_ci
|
584 |
| - and pm != "x86_64" |
| 574 | + and DEFAULT_OCI_PLATFORM != OCIPlatform.AMD64 |
585 | 575 | and platform != DEFAULT_OCI_PLATFORM
|
586 | 576 | ):
|
587 | 577 | pytest.skip("Skipping test because docker on this platform does not support QEMU")
|
|
0 commit comments