mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 19:05:42 +03:00
test: assert HostVolumes included in ListNodes
This commit is contained in:
committed by
Michael Lange
parent
21b8986139
commit
624625e83a
@@ -2663,6 +2663,13 @@ func TestClientEndpoint_ListNodes(t *testing.T) {
|
||||
|
||||
// Create the register request
|
||||
node := mock.Node()
|
||||
node.HostVolumes = map[string]*structs.ClientHostVolumeConfig{
|
||||
"foo": {
|
||||
Name: "foo",
|
||||
Path: "/",
|
||||
ReadOnly: true,
|
||||
},
|
||||
}
|
||||
reg := &structs.NodeRegisterRequest{
|
||||
Node: node,
|
||||
WriteRequest: structs.WriteRequest{Region: "global"},
|
||||
@@ -2688,12 +2695,11 @@ func TestClientEndpoint_ListNodes(t *testing.T) {
|
||||
t.Fatalf("Bad index: %d %d", resp2.Index, resp.Index)
|
||||
}
|
||||
|
||||
if len(resp2.Nodes) != 1 {
|
||||
t.Fatalf("bad: %#v", resp2.Nodes)
|
||||
}
|
||||
if resp2.Nodes[0].ID != node.ID {
|
||||
t.Fatalf("bad: %#v", resp2.Nodes[0])
|
||||
}
|
||||
require.Len(t, resp2.Nodes, 1)
|
||||
require.Equal(t, node.ID, resp2.Nodes[0].ID)
|
||||
|
||||
// #7344 - Assert HostVolumes are included in stub
|
||||
require.Equal(t, node.HostVolumes, resp2.Nodes[0].HostVolumes)
|
||||
|
||||
// Lookup the node with prefix
|
||||
get = &structs.NodeListRequest{
|
||||
|
||||
Reference in New Issue
Block a user