v1.8.1
This commit is contained in:
@@ -50,13 +50,16 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
t.Fatalf("Cannot get client: %v", err)
|
||||
}
|
||||
|
||||
const logFileName = "test_get_list_cloudAPI.log"
|
||||
var testLogs []string
|
||||
// Account
|
||||
// List
|
||||
bytes, err = client.CloudAPI().Account().ListRaw(context.Background(), account.ListRequest{})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Account list", bytes, account.ListAccounts{}, t)
|
||||
|
||||
testLogs = append(testLogs, getResult("Account list", bytes, account.ListAccounts{}, t))
|
||||
// Get
|
||||
listAcc, _ := client.CloudAPI().Account().List(context.Background(), account.ListRequest{})
|
||||
if len(listAcc.Data) > 0 {
|
||||
@@ -65,7 +68,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Account get", bytes, account.RecordAccount{}, t)
|
||||
testLogs = append(testLogs, getResult("Account get", bytes, account.RecordAccount{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test Account get because account list is empty")
|
||||
}
|
||||
@@ -76,7 +79,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Bservice list", bytes, bservice.ListBasicServices{}, t)
|
||||
testLogs = append(testLogs, getResult("Bservice list", bytes, bservice.ListBasicServices{}, t))
|
||||
// Get
|
||||
listBServ, _ := client.CloudAPI().BService().List(context.Background(), bservice.ListRequest{})
|
||||
if len(listBServ.Data) > 0 {
|
||||
@@ -85,7 +88,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Bservice get", bytes, bservice.RecordBasicService{}, t)
|
||||
testLogs = append(testLogs, getResult("Bservice get", bytes, bservice.RecordBasicService{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test Bservice get because bservice list is empty")
|
||||
}
|
||||
@@ -96,7 +99,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Compute list", bytes, compute.ListComputes{}, t)
|
||||
testLogs = append(testLogs, getResult("Compute list", bytes, compute.ListComputes{}, t))
|
||||
// Get
|
||||
listComp, _ := client.CloudAPI().Compute().List(context.Background(), compute.ListRequest{})
|
||||
if len(listComp.Data) > 0 {
|
||||
@@ -105,7 +108,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Compute get", bytes, compute.RecordCompute{}, t)
|
||||
testLogs = append(testLogs, getResult("Compute get", bytes, compute.RecordCompute{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test Compute get because compute list is empty")
|
||||
}
|
||||
@@ -116,7 +119,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Disk list", bytes, disks.ListDisks{}, t)
|
||||
testLogs = append(testLogs, getResult("Disk list", bytes, disks.ListDisks{}, t))
|
||||
// Get
|
||||
listDisk, _ := client.CloudAPI().Disks().List(context.Background(), disks.ListRequest{})
|
||||
if len(listDisk.Data) > 0 {
|
||||
@@ -125,7 +128,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Disk get", bytes, disks.RecordDisk{}, t)
|
||||
testLogs = append(testLogs, getResult("Disk get", bytes, disks.RecordDisk{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test Disk get because disk list is empty")
|
||||
}
|
||||
@@ -136,7 +139,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("ExtNet list", bytes, extnet.ListExtNets{}, t)
|
||||
testLogs = append(testLogs, getResult("ExtNet list", bytes, extnet.ListExtNets{}, t))
|
||||
// Get
|
||||
listExtNet, _ := client.CloudAPI().ExtNet().List(context.Background(), extnet.ListRequest{})
|
||||
if len(listExtNet.Data) > 0 {
|
||||
@@ -145,7 +148,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("ExtNet get", bytes, extnet.RecordExtNet{}, t)
|
||||
testLogs = append(testLogs, getResult("ExtNet get", bytes, extnet.RecordExtNet{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test ExtNet get because listExtNet list is empty")
|
||||
}
|
||||
@@ -156,7 +159,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("FLIPGroup list", bytes, flipgroup.ListFLIPGroups{}, t)
|
||||
testLogs = append(testLogs, getResult("FLIPGroup list", bytes, flipgroup.ListFLIPGroups{}, t))
|
||||
// Get
|
||||
listFG, _ := client.CloudAPI().FLIPGroup().List(context.Background(), flipgroup.ListRequest{})
|
||||
if len(listFG.Data) > 0 {
|
||||
@@ -165,7 +168,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("FLIPGroup get", bytes, flipgroup.RecordFLIPGroup{}, t)
|
||||
testLogs = append(testLogs, getResult("FLIPGroup get", bytes, flipgroup.RecordFLIPGroup{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test FLIPGroup get because flipgroup list is empty")
|
||||
}
|
||||
@@ -176,7 +179,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Image list", bytes, image.ListImages{}, t)
|
||||
testLogs = append(testLogs, getResult("Image list", bytes, image.ListImages{}, t))
|
||||
// Get
|
||||
listImg, _ := client.CloudAPI().Image().List(context.Background(), image.ListRequest{})
|
||||
if len(listImg.Data) > 0 {
|
||||
@@ -185,7 +188,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Image get", bytes, image.RecordImage{}, t)
|
||||
testLogs = append(testLogs, getResult("Image get", bytes, image.RecordImage{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test Image get because Image list is empty")
|
||||
}
|
||||
@@ -196,7 +199,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("K8CI list", bytes, k8ci.ListK8CI{}, t)
|
||||
testLogs = append(testLogs, getResult("K8CI list", bytes, k8ci.ListK8CI{}, t))
|
||||
// Get
|
||||
listk8ci, _ := client.CloudAPI().K8CI().List(context.Background(), k8ci.ListRequest{})
|
||||
if len(listk8ci.Data) > 0 {
|
||||
@@ -205,7 +208,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("K8CI get", bytes, k8ci.RecordK8CI{}, t)
|
||||
testLogs = append(testLogs, getResult("K8CI get", bytes, k8ci.RecordK8CI{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test K8CI get because K8CI list is empty")
|
||||
}
|
||||
@@ -216,7 +219,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("K8S list", bytes, k8s.ListK8SClusters{}, t)
|
||||
testLogs = append(testLogs, getResult("K8S list", bytes, k8s.ListK8SClusters{}, t))
|
||||
// Get
|
||||
listk8s, _ := client.CloudAPI().K8S().List(context.Background(), k8s.ListRequest{})
|
||||
if len(listk8s.Data) > 0 {
|
||||
@@ -225,7 +228,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("K8S get", bytes, k8s.RecordK8S{}, t)
|
||||
testLogs = append(testLogs, getResult("K8S get", bytes, k8s.RecordK8S{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test K8S get because K8S list is empty")
|
||||
}
|
||||
@@ -236,7 +239,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("LB list", bytes, lb.ListLB{}, t)
|
||||
testLogs = append(testLogs, getResult("LB list", bytes, lb.ListLB{}, t))
|
||||
// Get
|
||||
listLB, _ := client.CloudAPI().LB().List(context.Background(), lb.ListRequest{})
|
||||
if len(listLB.Data) > 0 {
|
||||
@@ -245,7 +248,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("LB get", bytes, lb.RecordLB{}, t)
|
||||
testLogs = append(testLogs, getResult("LB get", bytes, lb.RecordLB{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test LB get because LB list is empty")
|
||||
}
|
||||
@@ -256,7 +259,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Locations list", bytes, locations.ListLocations{}, t)
|
||||
testLogs = append(testLogs, getResult("Locations list", bytes, locations.ListLocations{}, t))
|
||||
|
||||
// RG
|
||||
// List
|
||||
@@ -264,7 +267,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("RG list", bytes, rg.ListResourceGroups{}, t)
|
||||
testLogs = append(testLogs, getResult("RG list", bytes, rg.ListResourceGroups{}, t))
|
||||
// Get
|
||||
listRG, _ := client.CloudAPI().RG().List(context.Background(), rg.ListRequest{})
|
||||
if len(listRG.Data) > 0 {
|
||||
@@ -273,7 +276,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("RG get", bytes, rg.RecordResourceGroup{}, t)
|
||||
testLogs = append(testLogs, getResult("RG get", bytes, rg.RecordResourceGroup{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test RG get because RG list is empty")
|
||||
}
|
||||
@@ -284,7 +287,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Sizes list", bytes, sizes.ListSizes{}, t)
|
||||
testLogs = append(testLogs, getResult("Sizes list", bytes, sizes.ListSizes{}, t))
|
||||
|
||||
// Stack
|
||||
// List
|
||||
@@ -292,7 +295,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Stack list", bytes, stack.ListStacks{}, t)
|
||||
testLogs = append(testLogs, getResult("Stack list", bytes, stack.ListStacks{}, t))
|
||||
|
||||
// Tasks
|
||||
// List
|
||||
@@ -300,7 +303,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Tasks list", bytes, tasks.ListTasks{}, t)
|
||||
testLogs = append(testLogs, getResult("Tasks list", bytes, tasks.ListTasks{}, t))
|
||||
// Get
|
||||
listTasks, _ := client.CloudAPI().Tasks().List(context.Background(), tasks.ListRequest{})
|
||||
if len(listTasks.Data) > 0 {
|
||||
@@ -309,7 +312,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Tasks get", bytes, tasks.RecordAsyncTask{}, t)
|
||||
testLogs = append(testLogs, getResult("Tasks get", bytes, tasks.RecordAsyncTask{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test Tasks get because Tasks list is empty")
|
||||
}
|
||||
@@ -320,7 +323,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("VINS list", bytes, vins.ListVINS{}, t)
|
||||
testLogs = append(testLogs, getResult("VINS list", bytes, vins.ListVINS{}, t))
|
||||
// Get
|
||||
listVINS, _ := client.CloudAPI().VINS().List(context.Background(), vins.ListRequest{})
|
||||
if len(listVINS.Data) > 0 {
|
||||
@@ -329,10 +332,12 @@ func TestGetListCloudAPI(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("VINS get", bytes, vins.RecordVINS{}, t)
|
||||
testLogs = append(testLogs, getResult("VINS get", bytes, vins.RecordVINS{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test VINS get because VINS list is empty")
|
||||
}
|
||||
|
||||
compareLogs(logFileName, testLogs, t, "get")
|
||||
}
|
||||
|
||||
// WARNING: not working correctly due to inclusions of tagless structures in cloudbroker
|
||||
@@ -345,13 +350,15 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
t.Fatalf("Cannot get client: %v", err)
|
||||
}
|
||||
|
||||
const logFileName = "test_get_list_cloudbroker.log"
|
||||
var testLogs = make([]string, 0)
|
||||
// Account
|
||||
// List
|
||||
bytes, err = client.CloudBroker().Account().ListRaw(context.Background(), account_cb.ListRequest{})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Account list", bytes, account_cb.ListAccounts{}, t)
|
||||
testLogs = append(testLogs, getResult("Account list", bytes, account_cb.ListAccounts{}, t))
|
||||
// Get
|
||||
listAcc, _ := client.CloudBroker().Account().List(context.Background(), account_cb.ListRequest{})
|
||||
if len(listAcc.Data) > 0 {
|
||||
@@ -360,7 +367,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Account get", bytes, account_cb.RecordAccount{}, t)
|
||||
testLogs = append(testLogs, getResult("Account get", bytes, account_cb.RecordAccount{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test Account get because account list is empty")
|
||||
}
|
||||
@@ -371,7 +378,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Audit list", bytes, audit_cb.ListAudits{}, t)
|
||||
testLogs = append(testLogs, getResult("Audit list", bytes, audit_cb.ListAudits{}, t))
|
||||
// Get
|
||||
listAudits, _ := client.CloudBroker().Audit().List(context.Background(), audit_cb.ListRequest{})
|
||||
if len(listAudits.Data) > 0 {
|
||||
@@ -380,7 +387,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Audit get", bytes, audit_cb.RecordAudit{}, t)
|
||||
testLogs = append(testLogs, getResult("Audit get", bytes, audit_cb.RecordAudit{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test Audit get because Audit list is empty")
|
||||
}
|
||||
@@ -391,7 +398,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Compute list", bytes, compute_cb.ListComputes{}, t)
|
||||
testLogs = append(testLogs, getResult("Compute list", bytes, compute_cb.ListComputes{}, t))
|
||||
// Get
|
||||
listComp, _ := client.CloudBroker().Compute().List(context.Background(), compute_cb.ListRequest{})
|
||||
if len(listComp.Data) > 0 {
|
||||
@@ -400,7 +407,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Compute get", bytes, compute_cb.RecordCompute{}, t)
|
||||
testLogs = append(testLogs, getResult("Compute get", bytes, compute_cb.RecordCompute{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test Compute get because compute list is empty")
|
||||
}
|
||||
@@ -411,7 +418,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Disk list", bytes, disks_cb.ListDisks{}, t)
|
||||
testLogs = append(testLogs, getResult("Disk list", bytes, disks_cb.ListDisks{}, t))
|
||||
// Get
|
||||
listDisk, _ := client.CloudBroker().Disks().List(context.Background(), disks_cb.ListRequest{})
|
||||
if len(listDisk.Data) > 0 {
|
||||
@@ -420,7 +427,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Disk get", bytes, disks_cb.RecordDisk{}, t)
|
||||
testLogs = append(testLogs, getResult("Disk get", bytes, disks_cb.RecordDisk{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test Disk get because disk list is empty")
|
||||
}
|
||||
@@ -431,7 +438,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("ExtNet list", bytes, extnet_cb.ListExtNet{}, t)
|
||||
testLogs = append(testLogs, getResult("ExtNet list", bytes, extnet_cb.ListExtNet{}, t))
|
||||
// Get
|
||||
listExtNet, _ := client.CloudBroker().ExtNet().List(context.Background(), extnet_cb.ListRequest{})
|
||||
if len(listExtNet.Data) > 0 {
|
||||
@@ -440,7 +447,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("ExtNet get", bytes, extnet_cb.RecordExtNet{}, t)
|
||||
testLogs = append(testLogs, getResult("ExtNet get", bytes, extnet_cb.RecordExtNet{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test ExtNet get because listExtNet list is empty")
|
||||
}
|
||||
@@ -451,7 +458,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("FLIPGroup list", bytes, flipgroup_cb.ListFLIPGroups{}, t)
|
||||
testLogs = append(testLogs, getResult("FLIPGroup list", bytes, flipgroup_cb.ListFLIPGroups{}, t))
|
||||
// Get
|
||||
listFG, _ := client.CloudBroker().FLIPGroup().List(context.Background(), flipgroup_cb.ListRequest{})
|
||||
if len(listFG.Data) > 0 {
|
||||
@@ -460,7 +467,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("FLIPGroup get", bytes, flipgroup_cb.RecordFLIPGroup{}, t)
|
||||
testLogs = append(testLogs, getResult("FLIPGroup get", bytes, flipgroup_cb.RecordFLIPGroup{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test FLIPGroup get because flipgroup list is empty")
|
||||
}
|
||||
@@ -471,7 +478,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Grid list", bytes, grid_cb.ListGrids{}, t)
|
||||
testLogs = append(testLogs, getResult("Grid list", bytes, grid_cb.ListGrids{}, t))
|
||||
// Get
|
||||
listGrid, _ := client.CloudBroker().Grid().List(context.Background(), grid_cb.ListRequest{})
|
||||
if len(listGrid.Data) > 0 {
|
||||
@@ -480,7 +487,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Grid get", bytes, grid_cb.RecordGrid{}, t)
|
||||
testLogs = append(testLogs, getResult("Grid get", bytes, grid_cb.RecordGrid{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test Grid get because Grid list is empty")
|
||||
}
|
||||
@@ -491,7 +498,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Image list", bytes, image_cb.ListImages{}, t)
|
||||
testLogs = append(testLogs, getResult("Image list", bytes, image_cb.ListImages{}, t))
|
||||
// Get
|
||||
listImg, _ := client.CloudBroker().Image().List(context.Background(), image_cb.ListRequest{})
|
||||
if len(listImg.Data) > 0 {
|
||||
@@ -500,7 +507,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Image get", bytes, image_cb.RecordImage{}, t)
|
||||
testLogs = append(testLogs, getResult("Image get", bytes, image_cb.RecordImage{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test Image get because Image list is empty")
|
||||
}
|
||||
@@ -511,7 +518,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("K8CI list", bytes, k8ci_cb.ListK8CI{}, t)
|
||||
testLogs = append(testLogs, getResult("K8CI list", bytes, k8ci_cb.ListK8CI{}, t))
|
||||
// Get
|
||||
listk8ci, _ := client.CloudBroker().K8CI().List(context.Background(), k8ci_cb.ListRequest{})
|
||||
if len(listk8ci.Data) > 0 {
|
||||
@@ -520,7 +527,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("K8CI get", bytes, k8ci_cb.RecordK8CI{}, t)
|
||||
testLogs = append(testLogs, getResult("K8CI get", bytes, k8ci_cb.RecordK8CI{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test K8CI get because K8CI list is empty")
|
||||
}
|
||||
@@ -531,7 +538,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("K8S list", bytes, k8s_cb.ListK8S{}, t)
|
||||
testLogs = append(testLogs, getResult("K8S list", bytes, k8s_cb.ListK8S{}, t))
|
||||
// Get
|
||||
listk8s, _ := client.CloudBroker().K8S().List(context.Background(), k8s_cb.ListRequest{})
|
||||
if len(listk8s.Data) > 0 {
|
||||
@@ -540,7 +547,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("K8S get", bytes, k8s_cb.RecordK8S{}, t)
|
||||
testLogs = append(testLogs, getResult("K8S get", bytes, k8s_cb.RecordK8S{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test K8S get because K8S list is empty")
|
||||
}
|
||||
@@ -551,7 +558,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("LB list", bytes, lb_cb.ListLB{}, t)
|
||||
testLogs = append(testLogs, getResult("LB list", bytes, lb_cb.ListLB{}, t))
|
||||
// Get
|
||||
listLB, _ := client.CloudBroker().LB().List(context.Background(), lb_cb.ListRequest{})
|
||||
if len(listLB.Data) > 0 {
|
||||
@@ -560,7 +567,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("LB get", bytes, lb_cb.RecordLB{}, t)
|
||||
testLogs = append(testLogs, getResult("LB get", bytes, lb_cb.RecordLB{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test LB get because LB list is empty")
|
||||
}
|
||||
@@ -571,7 +578,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Pcidevice list", bytes, pcidevice_cb.ListPCIDevices{}, t)
|
||||
testLogs = append(testLogs, getResult("Pcidevice list", bytes, pcidevice_cb.ListPCIDevices{}, t))
|
||||
|
||||
// RG
|
||||
// List
|
||||
@@ -579,7 +586,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("RG list", bytes, rg_cb.ListRG{}, t)
|
||||
testLogs = append(testLogs, getResult("RG list", bytes, rg_cb.ListRG{}, t))
|
||||
// Get
|
||||
listRG, _ := client.CloudBroker().RG().List(context.Background(), rg_cb.ListRequest{})
|
||||
if len(listRG.Data) > 0 {
|
||||
@@ -588,7 +595,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("RG get", bytes, rg_cb.RecordRG{}, t)
|
||||
testLogs = append(testLogs, getResult("RG get", bytes, rg_cb.RecordRG{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test RG get because RG list is empty")
|
||||
}
|
||||
@@ -599,7 +606,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("SEP list", bytes, sep_cb.ListSEP{}, t)
|
||||
testLogs = append(testLogs, getResult("SEP list", bytes, sep_cb.ListSEP{}, t))
|
||||
// Get
|
||||
listSEP, _ := client.CloudBroker().SEP().List(context.Background(), sep_cb.ListRequest{})
|
||||
if len(listSEP.Data) > 0 {
|
||||
@@ -608,7 +615,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("SEP get", bytes, sep_cb.RecordSEP{}, t)
|
||||
testLogs = append(testLogs, getResult("SEP get", bytes, sep_cb.RecordSEP{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test SEP get because SEP list is empty")
|
||||
}
|
||||
@@ -619,7 +626,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Stack list", bytes, stack_cb.ListStacks{}, t)
|
||||
testLogs = append(testLogs, getResult("Stack list", bytes, stack_cb.ListStacks{}, t))
|
||||
// Get
|
||||
listStack, _ := client.CloudBroker().Stack().List(context.Background(), stack_cb.ListRequest{})
|
||||
if len(listStack.Data) > 0 {
|
||||
@@ -628,7 +635,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Stack get", bytes, stack_cb.InfoStack{}, t)
|
||||
testLogs = append(testLogs, getResult("Stack get", bytes, stack_cb.InfoStack{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test Stack get because Stack list is empty")
|
||||
}
|
||||
@@ -639,7 +646,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("Tasks list", bytes, tasks_cb.ListTasks{}, t)
|
||||
testLogs = append(testLogs, getResult("Tasks list", bytes, tasks_cb.ListTasks{}, t))
|
||||
|
||||
// VINS
|
||||
// List
|
||||
@@ -647,7 +654,7 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("VINS list", bytes, vins_cb.ListVINS{}, t)
|
||||
testLogs = append(testLogs, getResult("VINS list", bytes, vins_cb.ListVINS{}, t))
|
||||
// Get
|
||||
listVINS, _ := client.CloudBroker().VINS().List(context.Background(), vins_cb.ListRequest{})
|
||||
if len(listVINS.Data) > 0 {
|
||||
@@ -656,10 +663,11 @@ func TestGetListCloudbroker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
getResult("VINS get", bytes, vins_cb.RecordVINS{}, t)
|
||||
testLogs = append(testLogs, getResult("VINS get", bytes, vins_cb.RecordVINS{}, t))
|
||||
} else {
|
||||
t.Errorf("Can not test VINS get because VINS list is empty")
|
||||
}
|
||||
compareLogs(logFileName, testLogs, t, "get")
|
||||
}
|
||||
|
||||
// TestRequestsCloudAPI tests platform requests vs. golang request structures in sdk for cloudapi requests
|
||||
|
||||
Reference in New Issue
Block a user