Skip to content

Commit

Permalink
Fix acceptance and intragtion tests
Browse files Browse the repository at this point in the history
  • Loading branch information
outscale-toa committed Aug 8, 2024
1 parent 152259c commit bc7b325
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 1 addition & 6 deletions outscale/data_source_outscale_net_peerings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,12 @@ const testAccDataSourceOutscaleLinPeeringsConnectionConfig = `
accepter_net_id = outscale_net.outscale_net.net_id
source_net_id = outscale_net.outscale_net2.net_id
tags {
key = "okht"
key = "name"
value = "testacc-peerings-ds"
}
}
resource "outscale_net_peering" "outscale_net_peering2" {
accepter_net_id = outscale_net.outscale_net.net_id
source_net_id = outscale_net.outscale_net2.net_id
}
data "outscale_net_peerings" "outscale_net_peerings" {
filter {
name = "net_peering_ids"
Expand Down
1 change: 0 additions & 1 deletion outscale/resource_outscale_public_ip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func TestAccOthers_PublicIP_basic(t *testing.T) {
}

func TestAccVM_PublicIP_instance(t *testing.T) {
t.Parallel()
var conf oscgo.PublicIp
omi := os.Getenv("OUTSCALE_IMAGEID")
region := utils.GetRegion()
Expand Down
8 changes: 8 additions & 0 deletions outscale/resource_outscale_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"log"
"net/http"
"strings"
"time"

Expand Down Expand Up @@ -267,11 +268,18 @@ func ResourceOutscaleSecurityGroupDelete(d *schema.ResourceData, meta interface{

log.Printf("[DEBUG] Security Group destroy: %v", d.Id())
securityGroupID := d.Id()
sg, _, err := readSecurityGroups(conn, securityGroupID)
if err != nil {
return err
}
return resource.Retry(5*time.Minute, func() *resource.RetryError {
_, httpResp, err := conn.SecurityGroupApi.DeleteSecurityGroup(context.Background()).DeleteSecurityGroupRequest(oscgo.DeleteSecurityGroupRequest{
SecurityGroupId: &securityGroupID,
}).Execute()
if err != nil {
if sg.GetNetId() != "" && httpResp.StatusCode == http.StatusConflict {
return utils.CheckThrottling(httpResp, err)
}
if strings.Contains(err.Error(), "DependencyProblem") {
return resource.RetryableError(err)
}
Expand Down

0 comments on commit bc7b325

Please sign in to comment.