Merge pull request #4542 from hashicorp/f-azure-instance-acc-tests

provider/azure: Fix acceptance tests
This commit is contained in:
James Nugent 2016-01-07 07:01:16 -08:00
commit 26e0a3423b
3 changed files with 11 additions and 1 deletions

View File

@ -622,7 +622,7 @@ func resourceAzureInstanceDelete(d *schema.ResourceData, meta interface{}) error
return err return err
} }
err = resource.Retry(5*time.Minute, func() error { err = resource.Retry(15*time.Minute, func() error {
exists, err := blobClient.BlobExists( exists, err := blobClient.BlobExists(
storageContainterName, fmt.Sprintf(osDiskBlobNameFormat, name), storageContainterName, fmt.Sprintf(osDiskBlobNameFormat, name),
) )

View File

@ -2,6 +2,7 @@ package azure
import ( import (
"fmt" "fmt"
"strings"
"testing" "testing"
"github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/resource"
@ -149,6 +150,10 @@ func testAccAzureDatabaseServerFirewallRuleDeleted(servers []string) resource.Te
for _, server := range servers { for _, server := range servers {
rules, err := sqlClient.ListFirewallRules(server) rules, err := sqlClient.ListFirewallRules(server)
if err != nil { if err != nil {
// ¯\_(ツ)_/¯
if strings.Contains(err.Error(), "Cannot open server") {
return nil
}
return fmt.Errorf("Error listing Azure Database Server Firewall Rules for Server %q: %s", server, err) return fmt.Errorf("Error listing Azure Database Server Firewall Rules for Server %q: %s", server, err)
} }

View File

@ -2,6 +2,7 @@ package azure
import ( import (
"fmt" "fmt"
"strings"
"testing" "testing"
"github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/resource"
@ -146,6 +147,10 @@ func testAccCheckAzureSqlDatabaseServiceDeleted(s *terraform.State) error {
sqlClient := testAccProvider.Meta().(*Client).sqlClient sqlClient := testAccProvider.Meta().(*Client).sqlClient
dbs, err := sqlClient.ListDatabases(*testAccAzureSqlServerName) dbs, err := sqlClient.ListDatabases(*testAccAzureSqlServerName)
if err != nil { if err != nil {
// ¯\_(ツ)_/¯
if strings.Contains(err.Error(), "Cannot open server") {
return nil
}
return fmt.Errorf("Error issuing Azure SQL Service list request: %s", err) return fmt.Errorf("Error issuing Azure SQL Service list request: %s", err)
} }