feat: search multiple NetBox instances with isolated host identities
Release / release (push) Successful in 5m16s
Release / release (push) Successful in 5m16s
This commit is contained in:
1 parent
a2a6dd7591
commit
7f53b90266
26 files changed
+1299
-115
No files matched your search
@@ -227,3 +227,18 @@ func TestCommandAliasGenerationAndCollision(t *testing.T) {
|
||||
t.Fatal(got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAliasesIncludeInstanceName(t *testing.T) {
|
||||
cfg := config.Config{Shortcuts: config.ShortcutsConfig{Domains: []string{".example.com"}}}
|
||||
entries := hook.BuildAliasEntries([]cache.Entry{{Name: "office/web01.example.com"}, {Name: "lab/web01.example.com"}}, cfg)
|
||||
if len(entries) != 2 {
|
||||
t.Fatalf("missing qualified aliases: %+v", entries)
|
||||
}
|
||||
got := map[string]string{}
|
||||
for _, entry := range entries {
|
||||
got[entry.Name] = entry.Host
|
||||
}
|
||||
if got["office_web01"] != "office/web01.example.com" || got["lab_web01"] != "lab/web01.example.com" {
|
||||
t.Fatalf("alias lost source: %+v", entries)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user