From 8fc788bf434e3f18f3a869c99c2a2b411fb22df6 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 6 Nov 2024 17:25:10 -0500 Subject: [PATCH] tests: Drop python tests It's not useful to have two frameworks here, let's just use nushell. ref https://github.com/containers/bootc/issues/868 Signed-off-by: Colin Walters --- plans/test-01-readonly.fmf | 7 ++----- tests/booted/readonly/basic.py | 20 -------------------- 2 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 tests/booted/readonly/basic.py diff --git a/plans/test-01-readonly.fmf b/plans/test-01-readonly.fmf index 3611a96e..c6114b20 100644 --- a/plans/test-01-readonly.fmf +++ b/plans/test-01-readonly.fmf @@ -8,15 +8,12 @@ provision: summary: Execute booted readonly/nondestructive tests execute: how: tmt - # There's currently two dynamic test frameworks; python and nushell. - # python is well known and understood. nushell is less well known, but - # is quite nice for running subprocesses and the like while making - # it easy to parse JSON etc. + # We currently write tests in nushell. It is is quite nice for running subprocesses + # and the like while making it easy to parse JSON etc. # All of these tests should generally be read-only - avoid any kind # of persistent changes. # If you need to do that, unfortunately right now that needs to be # a separate plan. script: | set -xeu - pytest tests/booted/readonly/*.py ls tests/booted/readonly/*-test-*.nu |sort -n | while read t; do nu $t; done diff --git a/tests/booted/readonly/basic.py b/tests/booted/readonly/basic.py deleted file mode 100644 index 985e9b47..00000000 --- a/tests/booted/readonly/basic.py +++ /dev/null @@ -1,20 +0,0 @@ -# Tests which are read-only/nondestructive - -import json -import subprocess - -def run(*args): - subprocess.check_call(*args) - -def test_bootc_status(): - o = subprocess.check_output(["bootc", "status", "--json"]) - st = json.loads(o) - assert st['apiVersion'] == 'org.containers.bootc/v1' - for v in [0, 1]: - o = subprocess.check_output(["bootc", "status", "--json", f"--format-version={v}"]) - st = json.loads(o) - assert st['apiVersion'] == 'org.containers.bootc/v1' - -def test_bootc_status_invalid_version(): - o = subprocess.call(["bootc", "status", "--json", "--format-version=42"]) - assert o != 0