From 980b0fc4fdbefa34f8190699992366e8d8c8c8e6 Mon Sep 17 00:00:00 2001 From: Bella Khizgiyaev Date: Mon, 13 Nov 2023 18:18:19 +0200 Subject: [PATCH] Add negative test for ovf wrong depth Signed-off-by: Bella Khizgiyaev --- cmd/ova-provider-server/nfs_test.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmd/ova-provider-server/nfs_test.go b/cmd/ova-provider-server/nfs_test.go index f7792475d..1166a2317 100644 --- a/cmd/ova-provider-server/nfs_test.go +++ b/cmd/ova-provider-server/nfs_test.go @@ -10,6 +10,7 @@ import ( ) func TestFindOVAFiles(t *testing.T) { + //nolint:all g := NewGomegaWithT(t) tests := []struct { @@ -52,7 +53,7 @@ func TestFindOVAFiles(t *testing.T) { expectError: false, }, { - name: "incorrect depth", + name: "incorrect depth ova", setup: func(directory string) { os.MkdirAll(filepath.Join(directory, "subdir1", "subdir2"), 0755) ioutil.WriteFile(filepath.Join(directory, "subdir1", "subdir2", "test3.ova"), []byte{}, 0644) @@ -61,6 +62,16 @@ func TestFindOVAFiles(t *testing.T) { expectedOVFs: nil, expectError: false, }, + { + name: "incorrect depth ovf", + setup: func(directory string) { + os.MkdirAll(filepath.Join(directory, "subdir1", "subdir2", "subdir3"), 0755) + ioutil.WriteFile(filepath.Join(directory, "subdir1", "subdir2", "subdir3", "test3.ovf"), []byte{}, 0644) + }, + expectedOVAs: nil, + expectedOVFs: nil, + expectError: false, + }, { name: "folder with extension", setup: func(directory string) {