Rename test folder to tests

Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Carlos Eduardo Arango Gutierrez 2025-01-21 11:00:25 +01:00 committed by Evan Lezar
parent 7ae5c2901f
commit bf9d618ff2
No known key found for this signature in database
705 changed files with 18 additions and 15 deletions

View File

@ -9,6 +9,7 @@ updates:
directories: directories:
- "/" - "/"
- "deployments/devel" - "deployments/devel"
- "tests"
schedule: schedule:
interval: "daily" interval: "daily"
labels: labels:

2
.gitignore vendored
View File

@ -3,7 +3,7 @@
*.swp *.swp
*.swo *.swo
/coverage.out* /coverage.out*
/test/output/ /tests/output/
/nvidia-container-runtime /nvidia-container-runtime
/nvidia-container-runtime.* /nvidia-container-runtime.*
/nvidia-container-runtime-hook /nvidia-container-runtime-hook

View File

@ -34,7 +34,7 @@ environment variables.
## Testing packages locally ## Testing packages locally
The [test/release](./test/release/) folder contains documentation on how the installation of local or staged packages can be tested. The [tests/release](./tests/release/) folder contains documentation on how the installation of local or staged packages can be tested.
## Releasing ## Releasing

View File

@ -22,9 +22,9 @@ import (
const ( const (
nvidiaRuntime = "nvidia-container-runtime" nvidiaRuntime = "nvidia-container-runtime"
nvidiaHook = "nvidia-container-runtime-hook" nvidiaHook = "nvidia-container-runtime-hook"
bundlePathSuffix = "test/output/bundle/" bundlePathSuffix = "tests/output/bundle/"
specFile = "config.json" specFile = "config.json"
unmodifiedSpecFileSuffix = "test/input/test_spec.json" unmodifiedSpecFileSuffix = "tests/input/test_spec.json"
) )
const ( const (
@ -46,8 +46,8 @@ func TestMain(m *testing.M) {
if err != nil { if err != nil {
log.Fatalf("error in test setup: could not get module root: %v", err) log.Fatalf("error in test setup: could not get module root: %v", err)
} }
testBinPath := filepath.Join(moduleRoot, "test", "bin") testBinPath := filepath.Join(moduleRoot, "tests", "bin")
testInputPath := filepath.Join(moduleRoot, "test", "input") testInputPath := filepath.Join(moduleRoot, "tests", "input")
// Set the environment variables for the test // Set the environment variables for the test
os.Setenv("PATH", test.PrependToPath(testBinPath, moduleRoot)) os.Setenv("PATH", test.PrependToPath(testBinPath, moduleRoot))

View File

@ -19,14 +19,14 @@ func TestMaintainSpec(t *testing.T) {
} }
for _, f := range files { for _, f := range files {
inputSpecPath := filepath.Join(moduleRoot, "test/input", f) inputSpecPath := filepath.Join(moduleRoot, "tests/input", f)
spec := NewFileSpec(inputSpecPath).(*fileSpec) spec := NewFileSpec(inputSpecPath).(*fileSpec)
_, err := spec.Load() _, err := spec.Load()
require.NoError(t, err) require.NoError(t, err)
outputSpecPath := filepath.Join(moduleRoot, "test/output", f) outputSpecPath := filepath.Join(moduleRoot, "tests/output", f)
spec.path = outputSpecPath spec.path = outputSpecPath
spec.Flush() spec.Flush()

View File

@ -36,7 +36,7 @@ func TestGetFileList(t *testing.T) {
}{ }{
{ {
description: "returns list of CSV files", description: "returns list of CSV files",
root: "test/input/csv_samples/", root: "tests/input/csv_samples/",
files: []string{ files: []string{
"jetson.csv", "jetson.csv",
"simple_wrong.csv", "simple_wrong.csv",
@ -46,15 +46,15 @@ func TestGetFileList(t *testing.T) {
}, },
{ {
description: "handles empty folder", description: "handles empty folder",
root: "test/input/csv_samples/empty", root: "tests/input/csv_samples/empty",
}, },
{ {
description: "handles non-existent folder", description: "handles non-existent folder",
root: "test/input/csv_samples/NONEXISTENT", root: "tests/input/csv_samples/NONEXISTENT",
}, },
{ {
description: "handles non-existent folder root", description: "handles non-existent folder root",
root: "/NONEXISTENT/test/input/csv_samples/", root: "/NONEXISTENT/tests/input/csv_samples/",
}, },
} }

View File

@ -45,7 +45,7 @@ func TestMain(m *testing.M) {
if err != nil { if err != nil {
log.Fatalf("error in test setup: could not get module root: %v", err) log.Fatalf("error in test setup: could not get module root: %v", err)
} }
testBinPath := filepath.Join(moduleRoot, "test", "bin") testBinPath := filepath.Join(moduleRoot, "tests", "bin")
// Set the environment variables for the test // Set the environment variables for the test
os.Setenv("PATH", test.PrependToPath(testBinPath, moduleRoot)) os.Setenv("PATH", test.PrependToPath(testBinPath, moduleRoot))

View File

@ -20,7 +20,7 @@ E2E_RUNTIME ?= docker
.PHONY: test .PHONY: test
test: test:
cd $(CURDIR)/test/e2e && $(GO_CMD) test -v . -args \ cd $(CURDIR)/tests/e2e && $(GO_CMD) test -v . -args \
-ginkgo.focus="$(E2E_RUNTIME)" \ -ginkgo.focus="$(E2E_RUNTIME)" \
-test.timeout=1h \ -test.timeout=1h \
-ginkgo.v -ginkgo.v

View File

@ -1,4 +1,4 @@
module github.com/NVIDIA/nvidia-container-toolkit/test module github.com/NVIDIA/nvidia-container-toolkit/tests
go 1.23.2 go 1.23.2

View File

@ -0,0 +1 @@
{"ociVersion":"1.0.1-dev","process":{"terminal":true,"user":{"uid":0,"gid":0},"args":["sh"],"env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","TERM=xterm"],"cwd":"/","capabilities":{"bounding":["CAP_AUDIT_WRITE","CAP_KILL","CAP_NET_BIND_SERVICE"],"effective":["CAP_AUDIT_WRITE","CAP_KILL","CAP_NET_BIND_SERVICE"],"inheritable":["CAP_AUDIT_WRITE","CAP_KILL","CAP_NET_BIND_SERVICE"],"permitted":["CAP_AUDIT_WRITE","CAP_KILL","CAP_NET_BIND_SERVICE"],"ambient":["CAP_AUDIT_WRITE","CAP_KILL","CAP_NET_BIND_SERVICE"]},"rlimits":[{"type":"RLIMIT_NOFILE","hard":1024,"soft":1024}],"noNewPrivileges":true},"root":{"path":"rootfs","readonly":true},"hostname":"runc","mounts":[{"destination":"/proc","type":"proc","source":"proc"},{"destination":"/dev","type":"tmpfs","source":"tmpfs","options":["nosuid","strictatime","mode=755","size=65536k"]},{"destination":"/dev/pts","type":"devpts","source":"devpts","options":["nosuid","noexec","newinstance","ptmxmode=0666","mode=0620","gid=5"]},{"destination":"/dev/shm","type":"tmpfs","source":"shm","options":["nosuid","noexec","nodev","mode=1777","size=65536k"]},{"destination":"/dev/mqueue","type":"mqueue","source":"mqueue","options":["nosuid","noexec","nodev"]},{"destination":"/sys","type":"sysfs","source":"sysfs","options":["nosuid","noexec","nodev","ro"]},{"destination":"/sys/fs/cgroup","type":"cgroup","source":"cgroup","options":["nosuid","noexec","nodev","relatime","ro"]}],"hooks":{"prestart":[{"path":"nvidia-container-runtime-hook","args":["nvidia-container-runtime-hook","prestart"]}]},"linux":{"resources":{"devices":[{"allow":false,"access":"rwm"}]},"namespaces":[{"type":"pid"},{"type":"network"},{"type":"ipc"},{"type":"uts"},{"type":"mount"}],"maskedPaths":["/proc/kcore","/proc/latency_stats","/proc/timer_list","/proc/timer_stats","/proc/sched_debug","/sys/firmware","/proc/scsi"],"readonlyPaths":["/proc/asound","/proc/bus","/proc/fs","/proc/irq","/proc/sys","/proc/sysrq-trigger"]}}

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More