This is an automated email from the ASF dual-hosted git repository.

zrhoffman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 6fc31a6  Fix TO API test for CheckOriginServerInCacheGroupTopology 
(#5381)
6fc31a6 is described below

commit 6fc31a6d320de36d359cafc0f26d7ee7a54c0a20
Author: Rawlin Peters <[email protected]>
AuthorDate: Wed Dec 16 14:57:24 2020 -0700

    Fix TO API test for CheckOriginServerInCacheGroupTopology (#5381)
    
    * Fix test for CheckOriginServerInCacheGroupTopology
    
    The test was giving us a false positive because the validation was still
    prohibiting the DS update for a different reason than the expected
    reason.
    
    * Address review comments
---
 traffic_ops/testing/api/v3/deliveryservices_test.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/traffic_ops/testing/api/v3/deliveryservices_test.go 
b/traffic_ops/testing/api/v3/deliveryservices_test.go
index b6097e9..a84fe74 100644
--- a/traffic_ops/testing/api/v3/deliveryservices_test.go
+++ b/traffic_ops/testing/api/v3/deliveryservices_test.go
@@ -900,10 +900,12 @@ func UpdateValidateORGServerCacheGroup(t *testing.T) {
 
        //Update DS's Topology to a non-ORG server's cachegroup
        origTopo := *remoteDS[0].Topology
-       *remoteDS[0].Topology = "4-tiers"
+       remoteDS[0].Topology = util.StrPtr("another-topology")
        ds, reqInf, err := 
TOSession.UpdateDeliveryServiceV30WithHdr(*remoteDS[0].ID, remoteDS[0], nil)
        if err == nil {
                t.Errorf("shouldnot UPDATE DeliveryService by ID: %v, but 
update was successful", ds.XMLID)
+       } else if !strings.Contains(err.Error(), "the following ORG server 
cachegroups are not in the delivery service's topology") {
+               t.Errorf("expected: error containing \"the following ORG server 
cachegroups are not in the delivery service's topology\", actual: %s", 
err.Error())
        }
        if reqInf.StatusCode != http.StatusBadRequest {
                t.Fatalf("expected to fail since ORG server's topology not part 
of DS. Expected:%v, Got: :%v", http.StatusBadRequest, reqInf.StatusCode)

Reply via email to