dmohan001c commented on a change in pull request #5717:
URL: https://github.com/apache/trafficcontrol/pull/5717#discussion_r610508987
##########
File path: traffic_ops/testing/api/v4/deliveryservices_test.go
##########
@@ -1238,6 +1254,272 @@ func VerifyPaginationSupportDS(t *testing.T) {
}
}
+func GetDeliveryServiceByCdn(t *testing.T) {
+
+ if len(testData.DeliveryServices) > 0 {
+ firstDS := testData.DeliveryServices[0]
+
+ if firstDS.CDNID == nil && firstDS.CDNName != nil {
+ cdns, _, err :=
TOSession.GetCDNByNameWithHdr(*firstDS.CDNName, nil)
+ if err != nil {
+ t.Fatalf("Error in Getting CDN by Name: %v",
err)
+ }
+ if len(cdns) == 0 {
+ t.Fatalf("no CDN named %v" + *firstDS.CDNName)
+ }
+ firstDS.CDNID = &cdns[0].ID
+ }
+ resp, _, err :=
TOSession.GetDeliveryServicesByCDNIDWithHdr(*firstDS.CDNID, nil)
Review comment:
updated the code as per your suggestion and fixed the segfault.
--
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]