Skip to content

Commit

Permalink
Trying to update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sahaqaa committed Aug 14, 2024
1 parent 7d5c912 commit d7ee56c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cloudconnexa/resource_route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ resource "cloudconnexa_network" "test" {
vpn_region_id = "fi-hel"
}
default_route {
subnet = "10.1.2.0/24"
subnet = "10.1.1.0/24"
type = "IP_V4"
}
}
Expand Down
9 changes: 5 additions & 4 deletions cloudconnexa/resource_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package cloudconnexa
import (
"errors"
"fmt"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
"github.com/openvpn/cloudconnexa-go-client/v2/cloudconnexa"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
Expand Down Expand Up @@ -81,7 +82,7 @@ func testAccCheckCloudConnexaServiceDestroy(state *terraform.State) error {
func testAccCloudConnexaServiceConfig(service cloudconnexa.IPService, networkName string) string {
return fmt.Sprintf(`
provider "cloudconnexa" {
base_url = "https://%s.api.openvpn.com"
base_url = "https://%[1]s.api.openvpn.com"
}
resource "cloudconnexa_network" "test" {
Expand All @@ -93,7 +94,7 @@ resource "cloudconnexa_network" "test" {
vpn_region_id = "fi-hel"
}
default_route {
value = "10.1.2.0/24"
subnet = "10.1.2.0/24"
type = "IP_V4"
}
}
Expand All @@ -104,7 +105,7 @@ resource "cloudconnexa_ip_service" "test" {
description = "test"
network_item_type = "NETWORK"
network_item_id = cloudconnexa_network.test.id
routes = ["test.ua" ]
routes = ["10.1.2.1/32" ]
config {
service_types = ["ANY"]
}
Expand Down
5 changes: 3 additions & 2 deletions cloudconnexa/resource_user_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/openvpn/cloudconnexa-go-client/v2/cloudconnexa"
"testing"

"github.com/openvpn/cloudconnexa-go-client/v2/cloudconnexa"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
Expand Down Expand Up @@ -96,7 +97,7 @@ func testAccCloudConnexaUserGroupConfig(userGroup cloudconnexa.UserGroup) string

return fmt.Sprintf(`
provider "cloudconnexa" {
base_url = "https://%s.api.openvpn.com"
base_url = "https://%[1]s.api.openvpn.com"
}
resource "cloudconnexa_user_group" "test" {
name = "%s"
Expand Down
13 changes: 11 additions & 2 deletions cloudconnexa/resource_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package cloudconnexa
import (
"errors"
"fmt"
"github.com/openvpn/cloudconnexa-go-client/v2/cloudconnexa"
"testing"

"github.com/openvpn/cloudconnexa-go-client/v2/cloudconnexa"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
Expand Down Expand Up @@ -106,13 +107,21 @@ func testAccCloudConnexaUserImportStateIdFunc(n string) resource.ImportStateIdFu
func testAccCloudConnexaUserConfig(user cloudconnexa.User) string {
return fmt.Sprintf(`
provider "cloudconnexa" {
base_url = "https://%s.api.openvpn.com"
base_url = "https://%[1]s.api.openvpn.com"
}
resource "cloudconnexa_user_group" "test" {
name = "test-group"
vpn_region_ids = ["eu-central-1"]
connect_auth = "AUTH"
}
resource "cloudconnexa_user" "test" {
username = "%s"
email = "%s"
first_name = "%s"
last_name = "%s"
group_id = cloudconnexa_user_group.test.id
}
`, testCloudID, user.Username, user.Email, user.FirstName, user.LastName)
}

0 comments on commit d7ee56c

Please sign in to comment.