mhoppa commented on a change in pull request #4528: Deprecate 
users/{userId}/deliveryServices
URL: https://github.com/apache/trafficcontrol/pull/4528#discussion_r398095346
 
 

 ##########
 File path: traffic_ops/testing/api/v2/deliveryservices_test.go
 ##########
 @@ -296,6 +298,53 @@ func UpdateDeliveryServiceWithInvalidSliceRangeRequest(t 
*testing.T) {
 
 }
 
+func GetAccessibleToTest(t *testing.T) {
+       //Every delivery service is associated with the root tenant
+       err := getByTenants(1, len(testData.DeliveryServices))
+       if err != nil {
+               t.Fatal(err.Error())
+       }
+
+       tenant := &tc.Tenant{
+               Active:     true,
+               Name:       "the strongest",
+               ParentID:   1,
+               ParentName: "root",
+       }
+
+       resp, err := TOSession.CreateTenant(tenant)
+       if err != nil {
+               t.Fatal(err.Error())
+       }
+       if resp == nil {
+               t.Fatal("unexpected null response when creating tenant")
+       }
+       tenant = &resp.Response
+
+       //No delivery services are associated with this new tenant
+       err = getByTenants(tenant.ID, 0)
+       if err != nil {
+               t.Fatal(err.Error())
+       }
+
+       //First and only child tenant, no access to root
+       err = getByTenants(3, len(testData.DeliveryServices) - 1)
 
 Review comment:
   I wonder if we will ever run into issues hardcoding this ID in? 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to