Skip to content

Commit

Permalink
tests(instance): add explicit nat ip types and routed_ip_enabled to f…
Browse files Browse the repository at this point in the history
…alse (#2530)
  • Loading branch information
Codelax committed Apr 12, 2024
1 parent c7b60a4 commit aa53415
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions internal/services/instance/ip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func TestAccIP_RoutedMigrate(t *testing.T) {
{
Config: `
resource "scaleway_instance_ip" "main" {
type = "nat"
}
`,
Check: resource.ComposeTestCheckFunc(
Expand All @@ -119,6 +120,7 @@ func TestAccIP_RoutedMigrate(t *testing.T) {
{
Config: `
resource "scaleway_instance_ip" "main" {
type = "nat"
}
resource "scaleway_instance_ip" "copy" {
}
Expand Down
12 changes: 9 additions & 3 deletions internal/services/instance/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,7 @@ func TestAccServer_Bootscript(t *testing.T) {
image = "ubuntu_focal"
boot_type = "bootscript"
bootscript_id = "%s"
routed_ip_enabled = false
}
`, bootscript),
Check: resource.ComposeTestCheckFunc(
Expand Down Expand Up @@ -1485,6 +1486,7 @@ func TestAccServer_RoutedIPEnable(t *testing.T) {
image = "ubuntu_jammy"
type = "PRO2-XXS"
state = "stopped"
routed_ip_enabled = false
}`,
Check: resource.ComposeTestCheckFunc(
arePrivateNICsPresent(tt, "scaleway_instance_server.main"),
Expand Down Expand Up @@ -1520,6 +1522,7 @@ func TestAccServer_RoutedIPEnableWithIP(t *testing.T) {
{
Config: `
resource "scaleway_instance_ip" "main" {
type = "nat"
}
resource "scaleway_instance_server" "main" {
Expand All @@ -1528,6 +1531,7 @@ func TestAccServer_RoutedIPEnableWithIP(t *testing.T) {
image = "ubuntu_jammy"
type = "PRO2-XXS"
state = "stopped"
routed_ip_enabled = false
}`,
Check: resource.ComposeTestCheckFunc(
arePrivateNICsPresent(tt, "scaleway_instance_server.main"),
Expand All @@ -1536,8 +1540,7 @@ func TestAccServer_RoutedIPEnableWithIP(t *testing.T) {
},
{
Config: `
resource "scaleway_instance_ip" "main" {
}
resource "scaleway_instance_ip" "main" {}
resource "scaleway_instance_server" "main" {
name = "tf-tests-instance-server-routedip-enable-with-ip"
Expand Down Expand Up @@ -1779,13 +1782,16 @@ func TestAccServer_IPMigrate(t *testing.T) {
{
ProviderFactories: providerFactories,
Config: fmt.Sprintf(`
resource "scaleway_instance_ip" "ip" {}
resource "scaleway_instance_ip" "ip" {
type = "nat"
}
resource "scaleway_instance_server" "main" {
ip_id = scaleway_instance_ip.ip.id
image = "ubuntu_jammy"
type = "PRO2-XXS"
state = "stopped"
routed_ip_enabled = false
}
resource "scaleway_iam_application" "app" {
Expand Down

0 comments on commit aa53415

Please sign in to comment.