aboutsummaryrefslogtreecommitdiff
path: root/plugin/federation/setup_test.go
diff options
context:
space:
mode:
authorGravatar Yong Tang <yong.tang.github@outlook.com> 2019-08-18 14:41:51 -0700
committerGravatar GitHub <noreply@github.com> 2019-08-18 14:41:51 -0700
commit6402cef3371b6a5716dd032e2484d865cf25338a (patch)
tree3d53847a82db477f9e2e8dea16b0015d5695703e /plugin/federation/setup_test.go
parentbbf148360b2bd35b9a1e358fdf7984a33b15a8d5 (diff)
downloadcoredns-6402cef3371b6a5716dd032e2484d865cf25338a.tar.gz
coredns-6402cef3371b6a5716dd032e2484d865cf25338a.tar.zst
coredns-6402cef3371b6a5716dd032e2484d865cf25338a.zip
Move federation plugin to github.com/coredns/federation (#3139)
* Remove federation Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Rebuild and point to github.com/coredns/federation Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Export `localNodeName` => `LocalNodeName`, to be used by federation (until deprecation) Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Remove plugin/kubernetes/federation.go (=> kubernetes/federation repo) Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Update github.com/coredns/federation Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * sticker-ci fix Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Diffstat (limited to 'plugin/federation/setup_test.go')
-rw-r--r--plugin/federation/setup_test.go65
1 files changed, 0 insertions, 65 deletions
diff --git a/plugin/federation/setup_test.go b/plugin/federation/setup_test.go
deleted file mode 100644
index 6aed5cce7..000000000
--- a/plugin/federation/setup_test.go
+++ /dev/null
@@ -1,65 +0,0 @@
-package federation
-
-import (
- "testing"
-
- "github.com/caddyserver/caddy"
-)
-
-func TestSetup(t *testing.T) {
- tests := []struct {
- input string
- shouldErr bool
- expectedLen int
- expectedNameZone []string // contains only entry for now
- }{
- // ok
- {`federation {
- prod prod.example.org
- }`, false, 1, []string{"prod", "prod.example.org."}},
-
- {`federation {
- staging staging.example.org
- prod prod.example.org
- }`, false, 2, []string{"prod", "prod.example.org."}},
- {`federation {
- staging staging.example.org
- prod prod.example.org
- }`, false, 2, []string{"staging", "staging.example.org."}},
- {`federation example.com {
- staging staging.example.org
- prod prod.example.org
- }`, false, 2, []string{"staging", "staging.example.org."}},
- // errors
- {`federation {
- }`, true, 0, []string{}},
- {`federation {
- staging
- }`, true, 0, []string{}},
- }
- for i, test := range tests {
- c := caddy.NewTestController("dns", test.input)
- fed, err := federationParse(c)
- if test.shouldErr && err == nil {
- t.Errorf("Test %v: Expected error but found nil", i)
- continue
- } else if !test.shouldErr && err != nil {
- t.Errorf("Test %v: Expected no error but found error: %v", i, err)
- continue
- }
- if test.shouldErr && err != nil {
- continue
- }
-
- if x := len(fed.f); x != test.expectedLen {
- t.Errorf("Test %v: Expected map length of %d, got: %d", i, test.expectedLen, x)
- }
- if x, ok := fed.f[test.expectedNameZone[0]]; !ok {
- t.Errorf("Test %v: Expected name for %s, got nothing", i, test.expectedNameZone[0])
- } else {
- if x != test.expectedNameZone[1] {
- t.Errorf("Test %v: Expected zone: %s, got %s", i, test.expectedNameZone[1], x)
- }
- }
- }
-}