Skip to content

Commit 98ca38a

Browse files
authored
Merge pull request #2334 from mikebonnet/konflux-e2e-fix-tmpdir
e2e: create TEMP_DIR when script is run on the VM
2 parents 2bfd40b + e1c580c commit 98ca38a

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.codespelldict

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ specicifed->specified
2020
unsuppored->unsupported
2121
neather->neither
2222
registires->registries
23-
behavior->behaviour

.tekton/integration/tasks/test-vm-cmd.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,14 @@ spec:
112112
fi
113113
podman pull $TEST_IMAGE
114114
115-
TEMP_DIR=$(mktemp -d -p /var/tmp e2e-test.XXXXXX)
116-
trap 'rm -rf "$TEMP_DIR"' EXIT
115+
TEMP_DIR=\$(mktemp -d -p \$PWD e2e-test.XXXXXX)
117116
118117
podman run \
119118
--userns=keep-id \
120119
--security-opt label=disable \
121120
--security-opt unmask=/proc/* \
122121
--device /dev/net/tun \
123-
-v "${TEMP_DIR}":/tmp \
122+
-v \$TEMP_DIR:/tmp \
124123
\${EXTRA_ARGS[*]} \
125124
${PODMAN_ENV[*]} \
126125
$TEST_IMAGE $TEST_CMD

test/e2e/test_serve.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,10 @@ def test_serve_api(caplog):
734734
@skip_if_gh_actions_darwin
735735
def test_serve_with_non_existing_images():
736736
with RamalamaExecWorkspace() as ctx:
737+
# If the requested model is missing, "ramalama serve --pull never" will exit with
738+
# "Error: <model> does not exist" and returncode 22. To test the behavior of a
739+
# non-existent image reference, the requested model must already be available locally.
740+
ctx.check_call(["ramalama", "pull", "tiny"])
737741
with pytest.raises(CalledProcessError) as exc_info:
738742
ctx.check_output(["ramalama", "serve", "--image", "bogus", "--pull", "never", "tiny"], stderr=STDOUT)
739743
assert exc_info.value.returncode == 125

0 commit comments

Comments
 (0)