Cleanup tests
diff --git a/cloudstack/CertificateService_test.go b/cloudstack/CertificateService_test.go index 3c781ec..7402a06 100644 --- a/cloudstack/CertificateService_test.go +++ b/cloudstack/CertificateService_test.go
@@ -50,7 +50,7 @@ } if resp.Jobstatus == 1 { - fmt.Println("Successfully uploaded certificate") + t.Log("Successfully uploaded certificate") } }
diff --git a/cloudstack/ClusterService_test.go b/cloudstack/ClusterService_test.go index 914a5fc..68feed2 100644 --- a/cloudstack/ClusterService_test.go +++ b/cloudstack/ClusterService_test.go
@@ -255,7 +255,6 @@ t.Errorf("Failed to updated cluster details - name, due to: %v", err) } - fmt.Println(resp) if resp.Name != "TestClusterUpdated" { t.Errorf("Failed to updated cluster name") }
diff --git a/cloudstack/ConfigurationService_test.go b/cloudstack/ConfigurationService_test.go index 50099df..70518ed 100644 --- a/cloudstack/ConfigurationService_test.go +++ b/cloudstack/ConfigurationService_test.go
@@ -86,7 +86,7 @@ if err != nil { t.Errorf("Failed to update configuration due to: %v", err) } - fmt.Println(resp) + if resp.Value != "false" { t.Errorf("Failed to update configuration") }
diff --git a/cloudstack/DomainService_test.go b/cloudstack/DomainService_test.go index 8bbd178..0c34364 100644 --- a/cloudstack/DomainService_test.go +++ b/cloudstack/DomainService_test.go
@@ -43,7 +43,7 @@ if err != nil { t.Errorf("Failed to create domain due to: %v", err) } - fmt.Println(resp) + if resp.Name != "testDomain" { t.Errorf("Failed to create domain") } @@ -67,7 +67,6 @@ t.Errorf("Failed to update domain name due to: %v", err) } - fmt.Println(resp) if resp.Name != "testDomainUpdated" { t.Errorf("Failed to update domain name") }
diff --git a/cloudstack/ImageStoreService_test.go b/cloudstack/ImageStoreService_test.go index 2f6102f..3c82e5f 100644 --- a/cloudstack/ImageStoreService_test.go +++ b/cloudstack/ImageStoreService_test.go
@@ -43,7 +43,7 @@ t.Errorf("Failed to add image store due to: %v", err) return } - fmt.Println(resp) + if resp == nil || resp.Providername != "NFS" { t.Errorf(" Failed to add image store") }
diff --git a/cloudstack/NetworkOfferingService_test.go b/cloudstack/NetworkOfferingService_test.go index b80611b..18ddf4e 100644 --- a/cloudstack/NetworkOfferingService_test.go +++ b/cloudstack/NetworkOfferingService_test.go
@@ -64,7 +64,7 @@ if err != nil { t.Errorf("Failed to update network offering state due to: %v", err) } - fmt.Println(resp) + if resp.State != "Enabled" { t.Errorf("Failed to enable network offering") }
diff --git a/cloudstack/NetworkService_test.go b/cloudstack/NetworkService_test.go index edf4b48..faf21f1 100644 --- a/cloudstack/NetworkService_test.go +++ b/cloudstack/NetworkService_test.go
@@ -79,7 +79,7 @@ if err != nil { t.Errorf("Failed to parse response, due to: %v", err) } - fmt.Println(response) + fmt.Fprintf(writer, response) })) defer server.Close()
diff --git a/cloudstack/PoolService_test.go b/cloudstack/PoolService_test.go index 8636e8d..c0f8993 100644 --- a/cloudstack/PoolService_test.go +++ b/cloudstack/PoolService_test.go
@@ -43,7 +43,7 @@ t.Errorf("Failed to create storage pool due to %v", err) return } - fmt.Println(resp) + if resp == nil || resp.Name != "testPrimary1" { t.Errorf("Failed to create storage pool") }
diff --git a/cloudstack/ServiceOfferingService_test.go b/cloudstack/ServiceOfferingService_test.go index 448b336..0fa4a48 100644 --- a/cloudstack/ServiceOfferingService_test.go +++ b/cloudstack/ServiceOfferingService_test.go
@@ -68,7 +68,7 @@ t.Errorf("Failed to update service offering due to %v", err) return } - fmt.Println(resp) + if resp == nil || resp.Name != "testServiceOfferingUpdated" { t.Errorf("Failed to create service offering name") }
diff --git a/cloudstack/UserService_test.go b/cloudstack/UserService_test.go index 919eab8..79a5df1 100644 --- a/cloudstack/UserService_test.go +++ b/cloudstack/UserService_test.go
@@ -66,7 +66,7 @@ t.Errorf("Failed to enable user due to %v", err) return } - fmt.Println(resp) + if resp == nil || resp.State != "enabled" { t.Errorf("Failed to enable user") } @@ -136,7 +136,7 @@ t.Errorf("Failed to lock user due to %v", err) return } - fmt.Println(resp) + if resp == nil || resp.State != "locked" { t.Errorf("Failed to lock user") }
diff --git a/cloudstack/VLANService_test.go b/cloudstack/VLANService_test.go index 22ea41f..82711a3 100644 --- a/cloudstack/VLANService_test.go +++ b/cloudstack/VLANService_test.go
@@ -45,7 +45,7 @@ t.Errorf("Failed to dedicate guest VLAN range for physical network due to: %v", err) return } - fmt.Println(resp) + if resp == nil || resp.Guestvlanrange != "100-110" { t.Errorf("Failed to dedicate guest VLAN range for physical network") }
diff --git a/cloudstack/cloudstack_test.go b/cloudstack/cloudstack_test.go index c32dc8f..8f0b246 100644 --- a/cloudstack/cloudstack_test.go +++ b/cloudstack/cloudstack_test.go
@@ -47,7 +47,6 @@ jsonBytes, err := json.Marshal(data.(map[string]interface{})[apiName]) if err != nil { - // fmt.Println(err) return nil, err } response := make(map[string]string)