mitchell852 commented on a change in pull request #5128:
URL: https://github.com/apache/trafficcontrol/pull/5128#discussion_r505110840
##########
File path: traffic_ops/testing/api/v3/deliveryserviceservers_test.go
##########
@@ -87,6 +89,51 @@ func AssignServersToTopologyBasedDeliveryService(t
*testing.T) {
t.Fatalf("creating deliveryserviceserver assignment for
topology-based delivery service - expected: 400-level status code, actual: %d",
reqInf.StatusCode)
}
}
+func AssignServersToNonTopologyBasedDeliveryServiceThatUsesMidTier(t
*testing.T) {
+ params := url.Values{}
+ params.Set("xmlId", "ds1")
+ dsWithMid, _, err := TOSession.GetDeliveryServicesV30WithHdr(nil,
params)
+ if err != nil {
+ t.Fatalf("cannot GET delivery service 'ds1': %s", err.Error())
+ }
+ if len(dsWithMid) != 1 {
+ t.Fatalf("expected one delivery service: 'ds1', actual: %v",
len(dsWithMid))
+ }
+ if dsWithMid[0].Topology != nil {
+ t.Fatal("expected delivery service: 'ds1' to have a nil
Topology, actual: non-nil")
+ }
+ serversResp, _, err := TOSession.GetServersWithHdr(nil, nil)
+ serversIds := []int{}
+ for _, s := range serversResp.Response {
+ if s.CDNID != nil && *s.CDNID == *dsWithMid[0].CDNID && s.Type
== tc.CacheTypeEdge.String() {
+ serversIds = append(serversIds, *s.ID)
+ }
+ }
+ if len(serversIds) < 1 {
+ t.Fatalf("expected: at least one EDGE in cdn %s, actual: 0",
*dsWithMid[0].CDNName)
+ }
+
+ _, _, err = TOSession.CreateDeliveryServiceServers(*dsWithMid[0].ID,
serversIds, true)
+ if err != nil {
+ t.Errorf("POST delivery service servers: %v", err)
Review comment:
good question
----------------------------------------------------------------
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]