Skip to content

Commit bc7ed44

Browse files
committed
[no-relnote] Allow local tests
Signed-off-by: Evan Lezar <[email protected]>
1 parent d29e856 commit bc7ed44

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

tests/e2e/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ GINKGO_BIN := $(CURDIR)/bin/ginkgo
2323
test: $(GINKGO_BIN)
2424
$(GINKGO_BIN) $(GINKGO_ARGS) -v --json-report ginkgo.json ./tests/e2e/...
2525

26+
# test-reinstalled runs the test cases against the version of the toolkit that
27+
# is already installed (and configured for docker) on the host.
28+
.PHONY: test-preinstalled
29+
test-preinstalled: test
30+
test-preinstalled: E2E_INSTALL_CTK = false
31+
test-preinstalled: E2E_SSH_HOST =
32+
33+
2634
$(GINKGO_BIN):
2735
mkdir -p $(CURDIR)/bin
2836
GOBIN=$(CURDIR)/bin go install github.com/onsi/ginkgo/v2/ginkgo@latest

tests/e2e/e2e_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,13 @@ func getTestEnv() {
6969

7070
}
7171

72-
sshKey = getRequiredEnvvar[string]("E2E_SSH_KEY")
73-
sshUser = getRequiredEnvvar[string]("E2E_SSH_USER")
74-
sshHost = getRequiredEnvvar[string]("E2E_SSH_HOST")
72+
sshHost = getEnvVarOrDefault("E2E_SSH_HOST", "")
73+
if sshHost != "" {
74+
sshKey = getRequiredEnvvar[string]("E2E_SSH_KEY")
75+
sshUser = getRequiredEnvvar[string]("E2E_SSH_USER")
76+
sshPort = getEnvVarOrDefault("E2E_SSH_PORT", "22")
77+
}
7578

76-
sshPort = getEnvVarOrDefault("E2E_SSH_PORT", "22")
7779
}
7880

7981
// getRequiredEnvvar returns the specified envvar if set or raises an error.

tests/e2e/nvidia-container-toolkit_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ var _ = Describe("docker", Ordered, ContinueOnFailure, func() {
399399
Expect(err).ToNot(HaveOccurred())
400400

401401
_, _, err = runner.Run(`docker build -t firmware-test \
402-
--build-arg RM_VERSION="$(basename $(ls -d /lib/firmware/nvidia/*.*))" \
402+
--build-arg RM_VERSION="` + hostDriverVersion + `" \
403403
--build-arg CURRENT_DIR="` + outputDir + `" \
404404
- <<EOF
405405
FROM ubuntu

0 commit comments

Comments
 (0)