You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2018/04/11 19:05:28 UTC

[incubator-trafficcontrol] branch master updated: updated to execute remote calls for the data setup

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 2d1f967  updated to execute remote calls for the data setup
2d1f967 is described below

commit 2d1f967147dc7a57ed84d74895b0f4ce5ec18350
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Wed Apr 11 10:23:28 2018 -0600

    updated to execute remote calls for the data setup
---
 .../v13/deliveryservice_request_comments_test.go   |  4 ++++
 .../api/v13/deliveryservice_requests_test.go       | 26 ++++++++++++++++++++--
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/traffic_ops/testing/api/v13/deliveryservice_request_comments_test.go b/traffic_ops/testing/api/v13/deliveryservice_request_comments_test.go
index 40fda20..55968e0 100644
--- a/traffic_ops/testing/api/v13/deliveryservice_request_comments_test.go
+++ b/traffic_ops/testing/api/v13/deliveryservice_request_comments_test.go
@@ -24,12 +24,16 @@ import (
 
 func TestDeliveryServiceRequestComments(t *testing.T) {
 
+	CreateTestCDNs(t)
+	CreateTestTypes(t)
 	CreateTestDeliveryServiceRequests(t)
 	CreateTestDeliveryServiceRequestComments(t)
 	UpdateTestDeliveryServiceRequestComments(t)
 	GetTestDeliveryServiceRequestComments(t)
 	DeleteTestDeliveryServiceRequestComments(t)
 	DeleteTestDeliveryServiceRequests(t)
+	DeleteTestTypes(t)
+	DeleteTestCDNs(t)
 
 }
 
diff --git a/traffic_ops/testing/api/v13/deliveryservice_requests_test.go b/traffic_ops/testing/api/v13/deliveryservice_requests_test.go
index ac8e97a..4d9c572 100644
--- a/traffic_ops/testing/api/v13/deliveryservice_requests_test.go
+++ b/traffic_ops/testing/api/v13/deliveryservice_requests_test.go
@@ -33,19 +33,41 @@ const (
 
 func TestDeliveryServiceRequests(t *testing.T) {
 
+	CreateTestCDNs(t)
+	CreateTestTypes(t)
 	CreateTestDeliveryServiceRequests(t)
 	GetTestDeliveryServiceRequests(t)
 	UpdateTestDeliveryServiceRequests(t)
 	DeleteTestDeliveryServiceRequests(t)
+	DeleteTestTypes(t)
+	DeleteTestCDNs(t)
 
 }
 
 func CreateTestDeliveryServiceRequests(t *testing.T) {
 	log.Debugln("CreateTestDeliveryServiceRequests")
 
+	// Attach CDNs
+	cdn := testData.CDNs[0]
+	resp, _, err := TOSession.GetCDNByName(cdn.Name)
+	if err != nil {
+		t.Errorf("cannot GET CDN by name: %v - %v\n", cdn.Name, err)
+	}
+	respCDN := resp[0]
+
+	// Attach Type
+	typ := testData.Types[19]
+	respTypes, _, err := TOSession.GetTypeByName(typ.Name)
+	if err != nil {
+		t.Errorf("cannot GET Type by name: %v - %v\n", typ.Name, err)
+	}
+	respTyp := respTypes[0]
+
 	dsr := testData.DeliveryServiceRequests[dsrGood]
-	resp, _, err := TOSession.CreateDeliveryServiceRequest(dsr)
-	log.Debugln("Response: ", resp)
+	dsr.DeliveryService.CDNID = respCDN.ID
+	dsr.DeliveryService.TypeID = respTyp.ID
+	respDSR, _, err := TOSession.CreateDeliveryServiceRequest(dsr)
+	log.Debugln("Response: ", respDSR)
 	if err != nil {
 		t.Errorf("could not CREATE DeliveryServiceRequests: %v\n", err)
 	}

-- 
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.