The tests can dynamically select test images based on the system's architecture.
By default, the architecture is extracted from the cluster nodes' arch label.
For CI, or to run --collect-only without cluster access, this is controlled by the environment variable OPENSHIFT_VIRTUALIZATION_TEST_IMAGES_ARCH.
Note: to run on the default architecture amd64, there's no need to set the environment variable.
Supported architectures include (names aligned with Kubernetes/KubeVirt):
amd64(default, also refered to as x86_64)arm64s390x(currently work in progress)
See Multi-Architecture Clusters.
To run tests on a specific architecture, add -m <architecture> to the pytest command.
For example:
pytest -m arm64 ...
pytest -m s390x ...Note: to run on the default architecture amd64, there's no need to set any architecture-specific markers.
Images for different architectures are managed under constants.py - ArchImages
The data structures are defined under images.py
To add a new image:
- Add the image name under the relevant dataclass under images.py
- Add the image name to the
ArchImagesunder the relevant architecture and OS under constants.py - Add the image to the image mapping under os_utils.py; refer to existing images for the format
To add a new architecture:
- Add the architecture name to the
ARCHITECTURE_SUPPORTlist under ARCHITECTURE_SUPPORT.md - Add a new pytest marker for the architecture
- Add a new pytest global config file for the architecture under tests/global_config_.py
- The file should contain the relevant OS matrix(es); see global_config_amd64.py for an example
- Add the architecture name as a constant under constants.py
- Add the architecture name to the list of supported architectures under get_test_images_arch_class
- Add the architecture name to the
ArchImagesunder the relevant architecture and OS under constants.py