Rename IP specific function, add missing test case

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2023-01-30 09:39:27 +01:00 committed by Kristoffer Dalby
parent cffa040474
commit 83a538cc95
2 changed files with 24 additions and 4 deletions

View file

@ -1041,7 +1041,7 @@ func Test_expandAlias(t *testing.T) {
wantErr: false,
},
{
name: "simple host",
name: "simple host by ip",
args: args{
alias: "10.0.0.1",
machines: []Machine{},
@ -1051,6 +1051,21 @@ func Test_expandAlias(t *testing.T) {
want: []string{"10.0.0.1"},
wantErr: false,
},
{
name: "simple host by hostname alias",
args: args{
alias: "testy",
machines: []Machine{},
aclPolicy: ACLPolicy{
Hosts: Hosts{
"testy": netip.MustParsePrefix("10.0.0.132/32"),
},
},
stripEmailDomain: true,
},
want: []string{"10.0.0.132/32"},
wantErr: false,
},
{
name: "simple CIDR",
args: args{