From 30039014474275a2146d2049f5a55468b5e80d81 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Thu, 3 Aug 2017 21:37:06 -0700 Subject: [PATCH] integration: test Put with PrevKey=true Was missing in proxy. --- integration/v3_grpc_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/integration/v3_grpc_test.go b/integration/v3_grpc_test.go index 53a27d091..30de93cd2 100644 --- a/integration/v3_grpc_test.go +++ b/integration/v3_grpc_test.go @@ -45,7 +45,7 @@ func TestV3PutOverwrite(t *testing.T) { kvc := toGRPC(clus.RandClient()).KV key := []byte("foo") - reqput := &pb.PutRequest{Key: key, Value: []byte("bar")} + reqput := &pb.PutRequest{Key: key, Value: []byte("bar"), PrevKv: true} respput, err := kvc.Put(context.TODO(), reqput) if err != nil { @@ -62,6 +62,9 @@ func TestV3PutOverwrite(t *testing.T) { t.Fatalf("expected newer revision on overwrite, got %v <= %v", respput2.Header.Revision, respput.Header.Revision) } + if pkv := respput2.PrevKv; pkv == nil || string(pkv.Value) != "bar" { + t.Fatalf("expected PrevKv=bar, got response %+v", respput2) + } reqrange := &pb.RangeRequest{Key: key} resprange, err := kvc.Range(context.TODO(), reqrange)