Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add negative test for ovf wrong depth #653

Merged
merged 1 commit into from
Nov 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion cmd/ova-provider-server/nfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,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)
Expand All @@ -61,6 +61,18 @@ func TestFindOVAFiles(t *testing.T) {
expectedOVFs: nil,
expectError: false,
},
{
name: "incorrect depth ovf",
setup: func(directory string) {
//nolint:errcheck
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since its a test and the error checked automatically it makes no sense to add error handle here, excluded from lint.

os.MkdirAll(filepath.Join(directory, "subdir1", "subdir2", "subdir3"), 0755)
//nolint:errcheck
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) {
Expand Down
Loading