Move argument structs back in original position

This commit is contained in:
William Tisäter 2014-05-07 23:51:15 +02:00
parent 93c7103bb5
commit 05243b35cd
2 changed files with 11 additions and 16 deletions

View File

@ -20,16 +20,14 @@ func TestCatalogRegister(t *testing.T) {
testutil.WaitForLeader(t, srv.agent.RPC) testutil.WaitForLeader(t, srv.agent.RPC)
// Register node // Register node
args := &structs.RegisterRequest{
Datacenter: "dc1",
Node: "foo",
Address: "127.0.0.1",
}
req, err := http.NewRequest("GET", "/v1/catalog/register", nil) req, err := http.NewRequest("GET", "/v1/catalog/register", nil)
if err != nil { if err != nil {
t.Fatalf("err: %v", err) t.Fatalf("err: %v", err)
} }
args := &structs.RegisterRequest{
Node: "foo",
Address: "127.0.0.1",
}
req.Body = encodeReq(args) req.Body = encodeReq(args)
obj, err := srv.CatalogRegister(nil, req) obj, err := srv.CatalogRegister(nil, req)
@ -52,15 +50,13 @@ func TestCatalogDeregister(t *testing.T) {
testutil.WaitForLeader(t, srv.agent.RPC) testutil.WaitForLeader(t, srv.agent.RPC)
// Register node // Register node
args := &structs.DeregisterRequest{
Datacenter: "dc1",
Node: "foo",
}
req, err := http.NewRequest("GET", "/v1/catalog/deregister", nil) req, err := http.NewRequest("GET", "/v1/catalog/deregister", nil)
if err != nil { if err != nil {
t.Fatalf("err: %v", err) t.Fatalf("err: %v", err)
} }
args := &structs.DeregisterRequest{
Node: "foo",
}
req.Body = encodeReq(args) req.Body = encodeReq(args)
obj, err := srv.CatalogDeregister(nil, req) obj, err := srv.CatalogDeregister(nil, req)

View File

@ -257,11 +257,6 @@ func TestCatalogListNodes_StaleRaad(t *testing.T) {
testutil.WaitForLeader(t, client1.Call) testutil.WaitForLeader(t, client1.Call)
testutil.WaitForLeader(t, client2.Call) testutil.WaitForLeader(t, client2.Call)
args := structs.DCSpecificRequest{
Datacenter: "dc1",
QueryOptions: structs.QueryOptions{AllowStale: true},
}
// Use the follower as the client // Use the follower as the client
var client *rpc.Client var client *rpc.Client
if !s1.IsLeader() { if !s1.IsLeader() {
@ -276,6 +271,10 @@ func TestCatalogListNodes_StaleRaad(t *testing.T) {
s2.fsm.State().EnsureNode(1, structs.Node{"foo", "127.0.0.1"}) s2.fsm.State().EnsureNode(1, structs.Node{"foo", "127.0.0.1"})
} }
args := structs.DCSpecificRequest{
Datacenter: "dc1",
QueryOptions: structs.QueryOptions{AllowStale: true},
}
var out structs.IndexedNodes var out structs.IndexedNodes
if err := client.Call("Catalog.ListNodes", &args, &out); err != nil { if err := client.Call("Catalog.ListNodes", &args, &out); err != nil {
t.Fatalf("err: %v", err) t.Fatalf("err: %v", err)