This commit is contained in:
2024-12-27 11:35:22 +03:00
parent 88eb9e8898
commit e04dc42d2b
37 changed files with 516 additions and 274 deletions

View File

@@ -20,6 +20,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/stack"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/tasks"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/vins"
node_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/node"
account_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/account"
audit_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/audit"
@@ -563,6 +564,26 @@ func TestGetListCloudbroker(t *testing.T) {
t.Errorf("Can not test LB get because LB list is empty")
}
// Node
// List
bytes, err = client.CloudBroker().Node().ListRaw(context.Background(), node_cb.ListRequest{})
if err != nil {
t.Error(err)
}
testLogs = append(testLogs, getResult("Node list", bytes, node_cb.ListNodes{}, t))
// Get
listNode, _ := client.CloudBroker().Node().List(context.Background(), node_cb.ListRequest{})
if len(listLB.Data) > 0 {
id := listNode.Data[0].ID
bytes, err = client.CloudBroker().Node().GetRaw(context.Background(), node_cb.GetRequest{NID: id})
if err != nil {
t.Error(err)
}
testLogs = append(testLogs, getResult("Node get", bytes, node_cb.RecordNode{}, t))
} else {
t.Errorf("Can not test Node get because LB list is empty")
}
// Pcidevice
// List
bytes, err = client.CloudBroker().PCIDevice().ListRaw(context.Background(), pcidevice_cb.ListRequest{})
@@ -684,10 +705,19 @@ func TestGetAllPaths(t *testing.T) {
decortUrls := readUrlFromDir("../../pkg", len(jsonUrls))
result := getMissingDecortUrls(jsonUrls, decortUrls)
if len(result) > 0 {
errorText := fmt.Sprintf("Below API handlers (%d in total) need to be added to decort-sdk:\n", len(result))
for _, r := range result {
missingUrls := getMissingDecortUrls(jsonUrls, decortUrls)
if len(missingUrls) > 0 {
errorText := fmt.Sprintf("Below API handlers (%d in total) need to be added to decort-sdk:\n", len(missingUrls))
for _, r := range missingUrls {
errorText += fmt.Sprintln(r)
}
t.Errorf(errorText)
}
deprecatedUrls := getDeprecatedDecortUrls(jsonUrls, decortUrls)
if len(deprecatedUrls) > 0 {
errorText := fmt.Sprintf("Below API handlers (%d in total) need to be delete to decort-sdk:\n", len(deprecatedUrls))
for _, r := range deprecatedUrls {
errorText += fmt.Sprintln(r)
}
t.Errorf(errorText)