shamrickus commented on a change in pull request #4644:
URL: https://github.com/apache/trafficcontrol/pull/4644#discussion_r437604610



##########
File path: lib/go-atscfg/remapdotconfig_test.go
##########
@@ -585,209 +578,6 @@ func TestMakeRemapDotConfigDuplicateOrigins(t *testing.T) 
{
        }
 }
 
-func TestMakeRemapDotConfigNilMidRewrite(t *testing.T) {

Review comment:
       I originally had removed this test because the Nil config returns 
nothing (ignoring comments), I've readded it and just asserted that only the 
comment is present

##########
File path: lib/go-atscfg/remapdotconfig_test.go
##########
@@ -585,209 +578,6 @@ func TestMakeRemapDotConfigDuplicateOrigins(t *testing.T) 
{
        }
 }
 
-func TestMakeRemapDotConfigNilMidRewrite(t *testing.T) {
-       serverName := tc.CacheName("server0")
-       toToolName := "to0"
-       toURL := "trafficops.example.net"
-       atsMajorVersion := 7
-
-       cacheURLConfigParams := map[string]string{
-               "not_location": "notinconfig",
-       }
-
-       dsProfilesCacheKeyConfigParams := map[int]map[string]string{
-               46: map[string]string{
-                       "cachekeykey": "cachekeyval",
-               },
-       }
-
-       serverPackageParamData := map[string]string{
-               "serverpkgval": "serverpkgval __HOSTNAME__ foo",
-       }
-
-       serverInfo := &ServerInfo{
-               CacheGroupID:                  42,
-               CDN:                           "mycdn",
-               CDNID:                         43,
-               DomainName:                    "mydomain",
-               HostName:                      "myhost",
-               HTTPSPort:                     12443,
-               ID:                            44,
-               IP:                            "192.168.2.4",
-               ParentCacheGroupID:            45,
-               ParentCacheGroupType:          "CGType4",
-               ProfileID:                     46,
-               ProfileName:                   "MyProfile",
-               Port:                          12080,
-               SecondaryParentCacheGroupID:   47,
-               SecondaryParentCacheGroupType: "MySecondaryParentCG",
-               Type:                          "MID",
-       }
-
-       remapDSData := []RemapConfigDSData{
-               RemapConfigDSData{
-                       ID:                       48,
-                       Type:                     "HTTP_LIVE_NATNL",
-                       OriginFQDN:               
util.StrPtr("origin.example.test"),
-                       MidHeaderRewrite:         nil,
-                       CacheURL:                 util.StrPtr("mycacheurl"),
-                       RangeRequestHandling:     util.IntPtr(0),
-                       CacheKeyConfigParams:     
map[string]string{"cachekeyparamname": "cachekeyparamval"},
-                       RemapText:                util.StrPtr("myremaptext"),
-                       EdgeHeaderRewrite:        
util.StrPtr("myedgeheaderrewrite"),
-                       SigningAlgorithm:         util.StrPtr("url_sig"),
-                       Name:                     "mydsname",
-                       QStringIgnore:            util.IntPtr(0),
-                       RegexRemap:               util.StrPtr("myregexremap"),
-                       FQPacingRate:             util.IntPtr(0),
-                       DSCP:                     0,
-                       RoutingName:              util.StrPtr("myroutingname"),
-                       MultiSiteOrigin:          util.StrPtr("mymso"),
-                       Pattern:                  util.StrPtr("myregexpattern"),
-                       RegexType:                
util.StrPtr(string(tc.DSMatchTypeHostRegex)),
-                       Domain:                   util.StrPtr("mydomain"),
-                       RegexSetNumber:           util.StrPtr("myregexsetnum"),
-                       OriginShield:             util.StrPtr("myoriginshield"),
-                       ProfileID:                util.IntPtr(49),
-                       Protocol:                 util.IntPtr(0),
-                       AnonymousBlockingEnabled: util.BoolPtr(false),
-                       Active:                   true,
-               },
-       }
-
-       txt := MakeRemapDotConfig(serverName, toToolName, toURL, 
atsMajorVersion, cacheURLConfigParams, dsProfilesCacheKeyConfigParams, 
serverPackageParamData, serverInfo, remapDSData)
-
-       txt = strings.TrimSpace(txt)
-
-       testComment(t, txt, string(serverName), toToolName, toURL)
-
-       txtLines := strings.Split(txt, "\n")
-
-       if len(txtLines) != 2 {
-               t.Errorf("expected one line for each remap plus a comment, 
actual: '%v' count %v", txt, len(txtLines))
-       }
-
-       remapLine := txtLines[1]
-
-       if !strings.HasPrefix(remapLine, "map") {
-               t.Errorf("expected to start with 'map', actual '%v'", txt)
-       }
-
-       if strings.Count(remapLine, "origin.example.test") != 2 {
-               t.Errorf("expected to contain origin FQDN twice (Mids remap 
origins to themselves, as a forward proxy), actual '%v'", txt)
-       }
-
-       if strings.Contains(remapLine, "hdr_rw_mid_") {
-               t.Errorf("expected no 'hdr_rw_mid_' for nil mid header rewrite 
on DS, actual '%v'", txt)
-       }
-
-       if strings.Contains(remapLine, "myedgeheaderrewrite") {
-               t.Errorf("expected no edge header rewrite text for mid server, 
actual '%v'", txt)
-       }
-
-       if strings.Contains(remapLine, "hdr_rw_") {
-               t.Errorf("expected no edge header rewrite for mid server, 
actual '%v'", txt)
-       }
-
-}
-
-func TestMakeRemapDotConfigMidHasNoEdgeRewrite(t *testing.T) {

Review comment:
       See above




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to