srijeet0406 commented on code in PR #7023:
URL: https://github.com/apache/trafficcontrol/pull/7023#discussion_r952024342


##########
traffic_ops/testing/api/v4/servers_test.go:
##########
@@ -423,6 +400,31 @@ func TestServers(t *testing.T) {
        })
 }
 
+func setupCacheGroupWithASN(t *testing.T) {
+       // Add a new asn for one of the cachegroups
+       cgResp, _, err := 
TOSession.GetCacheGroups(client.RequestOptions{QueryParameters: 
url.Values{"name": {"topology-mid-cg-01"}}})
+       if err != nil {
+               t.Fatalf("couldn't get cachegroups: %v", err)
+       }
+       if len(cgResp.Response) != 1 {
+               t.Fatalf("expected 1 cachegroup, but got %d", 
len(cgResp.Response))
+       }
+       if cgResp.Response[0].ID == nil {
+               t.Fatalf("ID of cachegroup is nil")
+       }
+
+       asn := tc.ASN{
+               ASN:          1111,
+               Cachegroup:   "topology-mid-cg-01",
+               CachegroupID: *cgResp.Response[0].ID,
+       }
+
+       _, _, err = TOSession.CreateASN(asn, client.NewRequestOptions())
+       if err != nil {
+               t.Fatalf("couldn't create ASN: %v", err)
+       }
+}
+

Review Comment:
   @ericholguin here you go: 
https://github.com/apache/trafficcontrol/issues/7033



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to