From f398e1880e290a7f41870b256f636d9747b23460 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Sun, 7 Feb 2016 13:15:22 -0800 Subject: [PATCH] Adds a test for node registration and tagged addresses. --- consul/state/state_store_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/consul/state/state_store_test.go b/consul/state/state_store_test.go index c60365168..114745ca9 100644 --- a/consul/state/state_store_test.go +++ b/consul/state/state_store_test.go @@ -397,6 +397,9 @@ func TestStateStore_EnsureRegistration(t *testing.T) { req := &structs.RegisterRequest{ Node: "node1", Address: "1.2.3.4", + TaggedAddresses: map[string]string{ + "hello": "world", + }, } if err := s.EnsureRegistration(1, req); err != nil { t.Fatalf("err: %s", err) @@ -409,6 +412,8 @@ func TestStateStore_EnsureRegistration(t *testing.T) { t.Fatalf("err: %s", err) } if out.Node != "node1" || out.Address != "1.2.3.4" || + len(out.TaggedAddresses) != 1 || + out.TaggedAddresses["hello"] != "world" || out.CreateIndex != created || out.ModifyIndex != modified { t.Fatalf("bad node returned: %#v", out) }