From 7fb79b41e98710b4583fd7255f99f39fee15da43 Mon Sep 17 00:00:00 2001 From: Fraser Tweedale Date: Mon, 18 May 2026 17:00:14 +1000 Subject: [PATCH] convert to tmt/fmf --- .fmf/version | 1 + plans/tests.fmf | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/tests.yml | 70 ------------------------------------------------ 3 files changed, 72 insertions(+), 70 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/tests.fmf delete mode 100644 tests/tests.yml diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/tests.fmf b/plans/tests.fmf new file mode 100644 index 0000000..1245706 --- /dev/null +++ b/plans/tests.fmf @@ -0,0 +1,71 @@ +summary: python-cryptography test suite + +provision: + hardware: + memory: ">= 8 GB" + +environment: + OPENSSL_ENABLE_SHA1_SIGNATURES: "yes" + CRYPTOGRAPHY_SRCDIR: /var/tmp/cryptography-source + +prepare: + - how: install + package: + - python3-cryptography + - python3-pytest + - python3-pytest-subtests + + - how: shell + script: | + VERSION=$(rpm -q --qf '%{VERSION}' python3-cryptography) + curl -sLo /var/tmp/cryptography-${VERSION}.tar.gz \ + "https://github.com/pyca/cryptography/archive/${VERSION}/cryptography-${VERSION}.tar.gz" + tar xf /var/tmp/cryptography-${VERSION}.tar.gz -C /var/tmp/ + ln -sfn /var/tmp/cryptography-${VERSION} $CRYPTOGRAPHY_SRCDIR + + cd $CRYPTOGRAPHY_SRCDIR + sed -i 's/--benchmark-disable//' pyproject.toml + # remove tests that depend on python3-hypothesis package + rm -rf tests/hypothesis/ + # remove tests that depend on python3-iso8601 package + rm -f tests/test_fernet.py + cat ${TMT_TREE}/conftest-skipper.py >> tests/conftest.py + +discover: + how: shell + tests: + - name: unittests-basic + test: cd $CRYPTOGRAPHY_SRCDIR && PYTHONPATH=vectors pytest-3 tests/test_*.py + duration: 30m + - name: unittests-x509 + test: cd $CRYPTOGRAPHY_SRCDIR && PYTHONPATH=vectors pytest-3 tests/x509/ + duration: 30m + - name: unittests-hazmat + test: cd $CRYPTOGRAPHY_SRCDIR && PYTHONPATH=vectors pytest-3 -k 'not test_openssl_memleak' tests/hazmat/backends/ tests/hazmat/bindings/ + duration: 30m + - name: unittests-primitives-aead + test: cd $CRYPTOGRAPHY_SRCDIR && PYTHONPATH=vectors pytest-3 tests/hazmat/primitives/test_aead.py + duration: 30m + - name: unittests-primitives-aes + test: >- + cd $CRYPTOGRAPHY_SRCDIR && PYTHONPATH=vectors pytest-3 + tests/hazmat/primitives/test_aes.py::TestAESModeCBC + tests/hazmat/primitives/test_aes.py::TestAESModeCTR + tests/hazmat/primitives/test_aes_gcm.py::TestAESModeGCM + duration: 30m + - name: unittests-primitives-a-e + test: >- + cd $CRYPTOGRAPHY_SRCDIR && PYTHONPATH=vectors pytest-3 + tests/hazmat/primitives/decrepit/test_arc4.py + tests/hazmat/primitives/test_asym_utils.py + tests/hazmat/primitives/test_[b-e]*.py + duration: 30m + - name: unittests-primitives-f-z + test: >- + cd $CRYPTOGRAPHY_SRCDIR && PYTHONPATH=vectors pytest-3 + tests/hazmat/primitives/test_[f-z]*.py + tests/hazmat/primitives/twofactor + duration: 30m + +execute: + how: tmt diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index e29b469..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,70 +0,0 @@ ---- -# -# 1minutetip --buildroot rhel10 -# - -- hosts: localhost - tags: - - classic - roles: - - role: standard-test-source - required_packages: - - rust-toolset - - - role: standard-test-basic - required_packages: - - python3-cryptography - - python3-pytest - - python3-pytest-subtests - environment: - PYTHONPATH: "{{ srcdir }}/vectors" - OPENSSL_ENABLE_SHA1_SIGNATURES: "yes" - tests: - - remove_hypothesis: - # remove tests that depend on python3-hypothesis package - dir: "source" - run: rm -rf tests/hypothesis/ - - remove_iso8601: - # remove tests that depend on python3-iso8601 package - dir: "source" - run: rm -rf tests/test_fernet.py - - remove_scrypt: - # scrypt tests require more memory than available - dir: "source" - run: rm -f tests/hazmat/primitives/test_scrypt.py - - patch_conftest: - dir: "source" - run: "cat ../conftest-skipper.py >> tests/conftest.py" - # tests take some time, split up to avoid CI timeouts. - - unittests-basic: - dir: "source" - run: pytest-3 tests/test_*.py - - unittests-x509: - dir: "source" - run: pytest-3 tests/x509/ - - unittests-hazmat: - dir: "source" - run: pytest-3 -k 'not test_openssl_memleak' tests/hazmat/backends/ tests/hazmat/bindings/ - - unittests-primitives-aead: - dir: "source" - run: pytest-3 tests/hazmat/primitives/test_aead.py - - unittests-primitives-aes: - dir: "source" - run: >- - pytest-3 - tests/hazmat/primitives/test_aes.py::TestAESModeCBC - tests/hazmat/primitives/test_aes.py::TestAESModeCTR - tests/hazmat/primitives/test_aes_gcm.py::TestAESModeGCM - - unittests-primitives-a-e: - dir: "source" - run: >- - pytest-3 - tests/hazmat/primitives/decrepit/test_arc4.py - tests/hazmat/primitives/test_asym_utils.py - tests/hazmat/primitives/test_[b-e]*.py - - unittests-primitives-f-z: - dir: "source" - run: >- - pytest-3 - tests/hazmat/primitives/test_[f-z]*.py - tests/hazmat/primitives/twofactor