Skip to content

Commit

Permalink
added check id to grpc server tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kqdeng committed Jul 13, 2020
1 parent a20123f commit 6362b95
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions grpc_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ func TestGetByIPTinkerbell(t *testing.T) {
t.Error("Error in unmarshalling hardware:", err)
}

if hw.ID != test.id {
t.Errorf("handler returned unexpected id: got %v want %v",
hw.ID, test.id)
}

if hw.Metadata == nil {
return
}
Expand Down Expand Up @@ -143,6 +148,7 @@ func TestGetByIPTinkerbell(t *testing.T) {
}

var cacherGrpcTests = map[string]struct {
id string
remote string
state string
facility string
Expand Down Expand Up @@ -249,6 +255,7 @@ var cacherGrpcTests = map[string]struct {
}

var tinkerbellGrpcTests = map[string]struct {
id string
remote string
state string
bondingMode int64
Expand All @@ -263,6 +270,7 @@ var tinkerbellGrpcTests = map[string]struct {
error string
}{
"tinkerbell": {
id: "fde7c87c-d154-447e-9fce-7eb7bdec90c0",
remote: "192.168.1.5",
bondingMode: 5,
diskDevice: "/dev/sda",
Expand All @@ -275,6 +283,7 @@ var tinkerbellGrpcTests = map[string]struct {
json: tinkerbellDataModel,
},
"tinkerbell no metadata": {
id: "363115b0-f03d-4ce5-9a15-5514193d131a",
remote: "192.168.1.5",
json: tinkerbellNoMetadata,
},
Expand Down

0 comments on commit 6362b95

Please sign in to comment.