mirror of https://github.com/status-im/consul.git
Fixes snapshot endpoint after merge.
This commit is contained in:
parent
fe2bd89563
commit
dc1572d82b
|
@ -43,7 +43,7 @@ func verifySnapshot(t *testing.T, s *Server, dc, token string) {
|
||||||
Op: structs.SnapshotSave,
|
Op: structs.SnapshotSave,
|
||||||
}
|
}
|
||||||
var reply structs.SnapshotResponse
|
var reply structs.SnapshotResponse
|
||||||
snap, err := SnapshotRPC(s.connPool, s.config.Datacenter, s.config.RPCAddr,
|
snap, err := SnapshotRPC(s.connPool, s.config.Datacenter, s.config.RPCAddr.String(),
|
||||||
&args, bytes.NewReader([]byte("")), &reply)
|
&args, bytes.NewReader([]byte("")), &reply)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
|
@ -115,7 +115,7 @@ func verifySnapshot(t *testing.T, s *Server, dc, token string) {
|
||||||
|
|
||||||
// Restore the snapshot.
|
// Restore the snapshot.
|
||||||
args.Op = structs.SnapshotRestore
|
args.Op = structs.SnapshotRestore
|
||||||
restore, err := SnapshotRPC(s.connPool, s.config.Datacenter, s.config.RPCAddr,
|
restore, err := SnapshotRPC(s.connPool, s.config.Datacenter, s.config.RPCAddr.String(),
|
||||||
&args, snap, &reply)
|
&args, snap, &reply)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
|
@ -186,7 +186,7 @@ func TestSnapshot_LeaderState(t *testing.T) {
|
||||||
Op: structs.SnapshotSave,
|
Op: structs.SnapshotSave,
|
||||||
}
|
}
|
||||||
var reply structs.SnapshotResponse
|
var reply structs.SnapshotResponse
|
||||||
snap, err := SnapshotRPC(s1.connPool, s1.config.Datacenter, s1.config.RPCAddr,
|
snap, err := SnapshotRPC(s1.connPool, s1.config.Datacenter, s1.config.RPCAddr.String(),
|
||||||
&args, bytes.NewReader([]byte("")), &reply)
|
&args, bytes.NewReader([]byte("")), &reply)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
|
@ -219,7 +219,7 @@ func TestSnapshot_LeaderState(t *testing.T) {
|
||||||
|
|
||||||
// Restore the snapshot.
|
// Restore the snapshot.
|
||||||
args.Op = structs.SnapshotRestore
|
args.Op = structs.SnapshotRestore
|
||||||
restore, err := SnapshotRPC(s1.connPool, s1.config.Datacenter, s1.config.RPCAddr,
|
restore, err := SnapshotRPC(s1.connPool, s1.config.Datacenter, s1.config.RPCAddr.String(),
|
||||||
&args, snap, &reply)
|
&args, snap, &reply)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
|
@ -256,7 +256,7 @@ func TestSnapshot_ACLDeny(t *testing.T) {
|
||||||
Op: structs.SnapshotSave,
|
Op: structs.SnapshotSave,
|
||||||
}
|
}
|
||||||
var reply structs.SnapshotResponse
|
var reply structs.SnapshotResponse
|
||||||
_, err := SnapshotRPC(s1.connPool, s1.config.Datacenter, s1.config.RPCAddr,
|
_, err := SnapshotRPC(s1.connPool, s1.config.Datacenter, s1.config.RPCAddr.String(),
|
||||||
&args, bytes.NewReader([]byte("")), &reply)
|
&args, bytes.NewReader([]byte("")), &reply)
|
||||||
if err == nil || !strings.Contains(err.Error(), permissionDenied) {
|
if err == nil || !strings.Contains(err.Error(), permissionDenied) {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
|
@ -270,7 +270,7 @@ func TestSnapshot_ACLDeny(t *testing.T) {
|
||||||
Op: structs.SnapshotRestore,
|
Op: structs.SnapshotRestore,
|
||||||
}
|
}
|
||||||
var reply structs.SnapshotResponse
|
var reply structs.SnapshotResponse
|
||||||
_, err := SnapshotRPC(s1.connPool, s1.config.Datacenter, s1.config.RPCAddr,
|
_, err := SnapshotRPC(s1.connPool, s1.config.Datacenter, s1.config.RPCAddr.String(),
|
||||||
&args, bytes.NewReader([]byte("")), &reply)
|
&args, bytes.NewReader([]byte("")), &reply)
|
||||||
if err == nil || !strings.Contains(err.Error(), permissionDenied) {
|
if err == nil || !strings.Contains(err.Error(), permissionDenied) {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
|
@ -367,7 +367,7 @@ func TestSnapshot_AllowStale(t *testing.T) {
|
||||||
Op: structs.SnapshotSave,
|
Op: structs.SnapshotSave,
|
||||||
}
|
}
|
||||||
var reply structs.SnapshotResponse
|
var reply structs.SnapshotResponse
|
||||||
_, err := SnapshotRPC(s.connPool, s.config.Datacenter, s.config.RPCAddr,
|
_, err := SnapshotRPC(s.connPool, s.config.Datacenter, s.config.RPCAddr.String(),
|
||||||
&args, bytes.NewReader([]byte("")), &reply)
|
&args, bytes.NewReader([]byte("")), &reply)
|
||||||
if err == nil || !strings.Contains(err.Error(), structs.ErrNoLeader.Error()) {
|
if err == nil || !strings.Contains(err.Error(), structs.ErrNoLeader.Error()) {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
|
@ -384,7 +384,7 @@ func TestSnapshot_AllowStale(t *testing.T) {
|
||||||
Op: structs.SnapshotSave,
|
Op: structs.SnapshotSave,
|
||||||
}
|
}
|
||||||
var reply structs.SnapshotResponse
|
var reply structs.SnapshotResponse
|
||||||
_, err := SnapshotRPC(s.connPool, s.config.Datacenter, s.config.RPCAddr,
|
_, err := SnapshotRPC(s.connPool, s.config.Datacenter, s.config.RPCAddr.String(),
|
||||||
&args, bytes.NewReader([]byte("")), &reply)
|
&args, bytes.NewReader([]byte("")), &reply)
|
||||||
if err == nil || !strings.Contains(err.Error(), "Raft error when taking snapshot") {
|
if err == nil || !strings.Contains(err.Error(), "Raft error when taking snapshot") {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
|
|
Loading…
Reference in New Issue