From 6da7af8dfa90177e958c4ab8741c015a01f59fef Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Wed, 5 Feb 2025 11:11:22 +0100 Subject: [PATCH] [no-relnote] Remove duplicate test case Signed-off-by: Evan Lezar --- internal/modifier/csv_test.go | 64 ----------------------------------- 1 file changed, 64 deletions(-) diff --git a/internal/modifier/csv_test.go b/internal/modifier/csv_test.go index 8e5f60b0..cdd41ce7 100644 --- a/internal/modifier/csv_test.go +++ b/internal/modifier/csv_test.go @@ -19,7 +19,6 @@ package modifier import ( "testing" - "github.com/opencontainers/runtime-spec/specs-go" testlog "github.com/sirupsen/logrus/hooks/test" "github.com/stretchr/testify/require" @@ -74,66 +73,3 @@ func TestNewCSVModifier(t *testing.T) { }) } } - -func TestCSVModifierRemovesHook(t *testing.T) { - logger, _ := testlog.NewNullLogger() - - testCases := []struct { - description string - spec *specs.Spec - expectedError error - expectedSpec *specs.Spec - }{ - { - description: "modification removes existing nvidia-container-runtime-hook", - spec: &specs.Spec{ - Hooks: &specs.Hooks{ - Prestart: []specs.Hook{ - { - Path: "/path/to/nvidia-container-runtime-hook", - Args: []string{"/path/to/nvidia-container-runtime-hook", "prestart"}, - }, - }, - }, - }, - expectedSpec: &specs.Spec{ - Hooks: &specs.Hooks{ - Prestart: []specs.Hook{}, - }, - }, - }, - { - description: "modification removes existing nvidia-container-toolkit", - spec: &specs.Spec{ - Hooks: &specs.Hooks{ - Prestart: []specs.Hook{ - { - Path: "/path/to/nvidia-container-toolkit", - Args: []string{"/path/to/nvidia-container-toolkit", "prestart"}, - }, - }, - }, - }, - expectedSpec: &specs.Spec{ - Hooks: &specs.Hooks{ - Prestart: []specs.Hook{}, - }, - }, - }, - } - - for _, tc := range testCases { - t.Run(tc.description, func(t *testing.T) { - m := nvidiaContainerRuntimeHookRemover{logger: logger} - - err := m.Modify(tc.spec) - if tc.expectedError != nil { - require.Error(t, err) - } else { - require.NoError(t, err) - } - - require.Empty(t, tc.spec.Hooks.Prestart) - }) - } -}