Skip to content

Commit

Permalink
cleanup test descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronhurt authored and magiconair committed Feb 18, 2018
1 parent 8169a40 commit c7b06ff
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions route/access_rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ func TestAccessRules_parseAccessRule(t *testing.T) {
fail bool
}{
{
desc: "parseAccessRuleGood",
desc: "valid rule",
allowDeny: "ip:10.0.0.0/8,ip:192.168.0.0/24,ip:1.2.3.4/32",
},
{
desc: "parseAccessRuleBadType",
allowDeny: "x:10.0.0.0/8",
desc: "invalid rule type",
allowDeny: "xxx:10.0.0.0/8",
fail: true,
},
{
desc: "parseAccessRuleIncompleteIP",
desc: "ip rule with incomplete address",
allowDeny: "ip:10/8",
fail: true,
},
{
desc: "parseAccessRuleBadCIDR",
desc: "ip rule with bad cidr mask",
allowDeny: "ip:10.0.0.0/255",
fail: true,
},
Expand Down Expand Up @@ -57,31 +57,31 @@ func TestAccessRules_denyByIP(t *testing.T) {
denied bool
}{
{
desc: "denyByIPAllowAllowed",
desc: "allow rule with included ip",
target: &Target{
Opts: map[string]string{"allow": "ip:10.0.0.0/8,ip:192.168.0.0/24"},
},
remote: net.ParseIP("10.10.0.1"),
denied: false,
},
{
desc: "denyByIPAllowDenied",
desc: "allow rule with exluded ip",
target: &Target{
Opts: map[string]string{"allow": "ip:10.0.0.0/8,ip:192.168.0.0/24"},
},
remote: net.ParseIP("1.2.3.4"),
denied: true,
},
{
desc: "denyByIPDenyDenied",
desc: "deny rule with included ip",
target: &Target{
Opts: map[string]string{"deny": "ip:10.0.0.0/8,ip:192.168.0.0/24"},
},
remote: net.ParseIP("10.10.0.1"),
denied: true,
},
{
desc: "denyByIPDenyAllow",
desc: "deny rule with excluded ip",
target: &Target{
Opts: map[string]string{"deny": "ip:10.0.0.0/8,ip:192.168.0.0/24"},
},
Expand Down Expand Up @@ -117,7 +117,7 @@ func TestAccessRules_AccessDeniedHTTP(t *testing.T) {
denied bool
}{
{
desc: "AccessDeniedHTTPwithDeniedXFFandAllowedRemote",
desc: "denied xff and allowed remote addr",
target: &Target{
Opts: map[string]string{"allow": "ip:10.0.0.0/8,ip:192.168.0.0/24"},
},
Expand All @@ -126,7 +126,7 @@ func TestAccessRules_AccessDeniedHTTP(t *testing.T) {
denied: true,
},
{
desc: "AccessDeniedHTTPwithAllowedXFFandDeniedRemote",
desc: "allowed xff and denied remote addr",
target: &Target{
Opts: map[string]string{"allow": "ip:10.0.0.0/8,ip:192.168.0.0/24"},
},
Expand All @@ -135,7 +135,7 @@ func TestAccessRules_AccessDeniedHTTP(t *testing.T) {
denied: true,
},
{
desc: "AccessDeniedHTTPwitAllowedXFFandAllowedRemote",
desc: "allowed xff and allowed remote addr",
target: &Target{
Opts: map[string]string{"allow": "ip:10.0.0.0/8,ip:192.168.0.0/24"},
},
Expand All @@ -144,7 +144,7 @@ func TestAccessRules_AccessDeniedHTTP(t *testing.T) {
denied: false,
},
{
desc: "AccessDeniedHTTPwithDeniedXFFandDeniedRemote",
desc: "denied xff and denied remote addr",
target: &Target{
Opts: map[string]string{"allow": "ip:10.0.0.0/8,ip:192.168.0.0/24"},
},
Expand Down

0 comments on commit c7b06ff

Please sign in to comment.