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

tests: add malformed name to Get tests #484

Merged
merged 1 commit into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions pkg/backend/aio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,14 @@ func TestBackEnd_GetAioController(t *testing.T) {
fmt.Sprintf("unable to find key %v", "unknown-id"),
false,
},
"malformed name": {
"-ABC-DEF",
nil,
[]string{""},
codes.Unknown,
fmt.Sprintf("segment '%s': not a valid DNS name", "-ABC-DEF"),
false,
},
}

// run tests
Expand Down
8 changes: 8 additions & 0 deletions pkg/backend/null_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,14 @@ func TestBackEnd_GetNullDebug(t *testing.T) {
fmt.Sprintf("unable to find key %v", "unknown-id"),
false,
},
"malformed name": {
"-ABC-DEF",
nil,
[]string{""},
codes.Unknown,
fmt.Sprintf("segment '%s': not a valid DNS name", "-ABC-DEF"),
false,
},
}

// run tests
Expand Down
6 changes: 6 additions & 0 deletions pkg/backend/nvme_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,12 @@ func TestBackEnd_GetNVMfRemoteController(t *testing.T) {
codes.NotFound,
fmt.Sprintf("unable to find key %v", "unknown-id"),
},
"malformed name": {
"-ABC-DEF",
nil,
codes.Unknown,
fmt.Sprintf("segment '%s': not a valid DNS name", "-ABC-DEF"),
},
}

// run tests
Expand Down
8 changes: 8 additions & 0 deletions pkg/backend/nvme_path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,14 @@ func TestBackEnd_GetNVMfPath(t *testing.T) {
fmt.Sprintf("unable to find key %v", "unknown-id"),
false,
},
"malformed name": {
"-ABC-DEF",
nil,
[]string{""},
codes.Unknown,
fmt.Sprintf("segment '%s': not a valid DNS name", "-ABC-DEF"),
false,
},
}

// run tests
Expand Down
8 changes: 8 additions & 0 deletions pkg/frontend/blk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,14 @@ func TestFrontEnd_GetVirtioBlk(t *testing.T) {
fmt.Sprintf("unable to find key %v", "unknown-id"),
false,
},
"malformed name": {
"-ABC-DEF",
nil,
[]string{""},
codes.Unknown,
fmt.Sprintf("segment '%s': not a valid DNS name", "-ABC-DEF"),
false,
},
}

// run tests
Expand Down
8 changes: 8 additions & 0 deletions pkg/frontend/nvme_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,14 @@ func TestFrontEnd_GetNvmeController(t *testing.T) {
fmt.Sprintf("unable to find key %s", "unknown-controller-id"),
false,
},
"malformed name": {
"-ABC-DEF",
nil,
[]string{""},
codes.Unknown,
fmt.Sprintf("segment '%s': not a valid DNS name", "-ABC-DEF"),
false,
},
}

// run tests
Expand Down
8 changes: 8 additions & 0 deletions pkg/frontend/nvme_namespace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,14 @@ func TestFrontEnd_GetNvmeNamespace(t *testing.T) {
fmt.Sprintf("unable to find key %v", "unknown-namespace-id"),
false,
},
"malformed name": {
"-ABC-DEF",
nil,
[]string{""},
codes.Unknown,
fmt.Sprintf("segment '%s': not a valid DNS name", "-ABC-DEF"),
false,
},
}

// run tests
Expand Down
8 changes: 8 additions & 0 deletions pkg/frontend/nvme_subsystem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,14 @@ func TestFrontEnd_GetNvmeSubsystem(t *testing.T) {
fmt.Sprintf("unable to find key %v", "unknown-subsystem-id"),
false,
},
"malformed name": {
"-ABC-DEF",
nil,
[]string{""},
codes.Unknown,
fmt.Sprintf("segment '%s': not a valid DNS name", "-ABC-DEF"),
false,
},
}

// run tests
Expand Down
8 changes: 8 additions & 0 deletions pkg/middleend/encryption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,14 @@ func TestMiddleEnd_GetEncryptedVolume(t *testing.T) {
fmt.Sprintf("unable to find key %v", server.ResourceIDToVolumeName("unknown-id")),
false,
},
"malformed name": {
"-ABC-DEF",
nil,
[]string{""},
codes.Unknown,
fmt.Sprintf("segment '%s': not a valid DNS name", "-ABC-DEF"),
false,
},
}

// run tests
Expand Down