From 9cc9dce8481ad71ff205562acc9c0fe919641d7e Mon Sep 17 00:00:00 2001
From: Pierre Souchay
Date: Thu, 22 Mar 2018 12:41:06 +0100
Subject: [PATCH] More test cases
---
agent/consul/state/catalog_test.go | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/agent/consul/state/catalog_test.go b/agent/consul/state/catalog_test.go
index 818670908..4d4500d64 100644
--- a/agent/consul/state/catalog_test.go
+++ b/agent/consul/state/catalog_test.go
@@ -2137,8 +2137,11 @@ func TestStateStore_DeleteCheck(t *testing.T) {
if err := s.DeleteCheck(3, "node1", "check1"); err != nil {
t.Fatalf("err: %s", err)
}
+ if idx, check, err := s.NodeCheck("node1", "check1"); idx != 3 || err != nil || check != nil {
+ t.Fatalf("Node check should have been deleted idx=%d, node=%v, err=%s", idx, check, err)
+ }
if idx := s.maxIndex("checks"); idx != 3 {
- t.Fatalf("bad index: %d", idx)
+ t.Fatalf("bad index for checks: %d", idx)
}
if !watchFired(ws) {
t.Fatalf("bad")