Skip to content

Commit aa53415

Browse files
authored
tests(instance): add explicit nat ip types and routed_ip_enabled to false (#2530)
1 parent c7b60a4 commit aa53415

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

internal/services/instance/ip_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ func TestAccIP_RoutedMigrate(t *testing.T) {
109109
{
110110
Config: `
111111
resource "scaleway_instance_ip" "main" {
112+
type = "nat"
112113
}
113114
`,
114115
Check: resource.ComposeTestCheckFunc(
@@ -119,6 +120,7 @@ func TestAccIP_RoutedMigrate(t *testing.T) {
119120
{
120121
Config: `
121122
resource "scaleway_instance_ip" "main" {
123+
type = "nat"
122124
}
123125
resource "scaleway_instance_ip" "copy" {
124126
}

internal/services/instance/server_test.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,7 @@ func TestAccServer_Bootscript(t *testing.T) {
958958
image = "ubuntu_focal"
959959
boot_type = "bootscript"
960960
bootscript_id = "%s"
961+
routed_ip_enabled = false
961962
}
962963
`, bootscript),
963964
Check: resource.ComposeTestCheckFunc(
@@ -1485,6 +1486,7 @@ func TestAccServer_RoutedIPEnable(t *testing.T) {
14851486
image = "ubuntu_jammy"
14861487
type = "PRO2-XXS"
14871488
state = "stopped"
1489+
routed_ip_enabled = false
14881490
}`,
14891491
Check: resource.ComposeTestCheckFunc(
14901492
arePrivateNICsPresent(tt, "scaleway_instance_server.main"),
@@ -1520,6 +1522,7 @@ func TestAccServer_RoutedIPEnableWithIP(t *testing.T) {
15201522
{
15211523
Config: `
15221524
resource "scaleway_instance_ip" "main" {
1525+
type = "nat"
15231526
}
15241527
15251528
resource "scaleway_instance_server" "main" {
@@ -1528,6 +1531,7 @@ func TestAccServer_RoutedIPEnableWithIP(t *testing.T) {
15281531
image = "ubuntu_jammy"
15291532
type = "PRO2-XXS"
15301533
state = "stopped"
1534+
routed_ip_enabled = false
15311535
}`,
15321536
Check: resource.ComposeTestCheckFunc(
15331537
arePrivateNICsPresent(tt, "scaleway_instance_server.main"),
@@ -1536,8 +1540,7 @@ func TestAccServer_RoutedIPEnableWithIP(t *testing.T) {
15361540
},
15371541
{
15381542
Config: `
1539-
resource "scaleway_instance_ip" "main" {
1540-
}
1543+
resource "scaleway_instance_ip" "main" {}
15411544
15421545
resource "scaleway_instance_server" "main" {
15431546
name = "tf-tests-instance-server-routedip-enable-with-ip"
@@ -1779,13 +1782,16 @@ func TestAccServer_IPMigrate(t *testing.T) {
17791782
{
17801783
ProviderFactories: providerFactories,
17811784
Config: fmt.Sprintf(`
1782-
resource "scaleway_instance_ip" "ip" {}
1785+
resource "scaleway_instance_ip" "ip" {
1786+
type = "nat"
1787+
}
17831788
17841789
resource "scaleway_instance_server" "main" {
17851790
ip_id = scaleway_instance_ip.ip.id
17861791
image = "ubuntu_jammy"
17871792
type = "PRO2-XXS"
17881793
state = "stopped"
1794+
routed_ip_enabled = false
17891795
}
17901796
17911797
resource "scaleway_iam_application" "app" {

0 commit comments

Comments
 (0)