@@ -98,116 +98,6 @@ func TestAccIP_Tags(t *testing.T) {
9898 })
9999}
100100
101- func TestAccIP_RoutedMigrate (t * testing.T ) {
102- tt := acctest .NewTestTools (t )
103- defer tt .Cleanup ()
104-
105- resource .ParallelTest (t , resource.TestCase {
106- ProviderFactories : tt .ProviderFactories ,
107- CheckDestroy : instancechecks .IsIPDestroyed (tt ),
108- Steps : []resource.TestStep {
109- {
110- Config : `
111- resource "scaleway_instance_ip" "main" {
112- type = "nat"
113- }
114- ` ,
115- Check : resource .ComposeTestCheckFunc (
116- instancechecks .CheckIPExists (tt , "scaleway_instance_ip.main" ),
117- resource .TestCheckResourceAttr ("scaleway_instance_ip.main" , "type" , "nat" ),
118- ),
119- },
120- {
121- Config : `
122- resource "scaleway_instance_ip" "main" {
123- type = "nat"
124- }
125- resource "scaleway_instance_ip" "copy" {
126- }
127- ` ,
128- Check : resource .ComposeTestCheckFunc (
129- instancechecks .CheckIPExists (tt , "scaleway_instance_ip.main" ),
130- instancechecks .CheckIPExists (tt , "scaleway_instance_ip.copy" ),
131- resource .TestCheckResourceAttr ("scaleway_instance_ip.main" , "type" , "nat" ),
132- resource .TestCheckResourceAttr ("scaleway_instance_ip.copy" , "type" , "nat" ),
133- resource .TestCheckResourceAttrPair ("scaleway_instance_ip.main" , "id" , "scaleway_instance_ip.copy" , "id" ),
134- ),
135- ResourceName : "scaleway_instance_ip.copy" ,
136- ImportState : true ,
137- ImportStateIdFunc : func (state * terraform.State ) (string , error ) {
138- return state .RootModule ().Resources ["scaleway_instance_ip.main" ].Primary .ID , nil
139- },
140- ImportStatePersist : true ,
141- },
142- {
143- Config : `
144- resource "scaleway_instance_ip" "main" {
145- type = "routed_ipv4"
146- }
147- resource "scaleway_instance_ip" "copy" {
148- }
149- ` ,
150- Check : resource .ComposeTestCheckFunc (
151- instancechecks .CheckIPExists (tt , "scaleway_instance_ip.main" ),
152- instancechecks .CheckIPExists (tt , "scaleway_instance_ip.copy" ),
153- resource .TestCheckResourceAttr ("scaleway_instance_ip.main" , "type" , "routed_ipv4" ),
154- resource .TestCheckResourceAttrPair ("scaleway_instance_ip.main" , "id" , "scaleway_instance_ip.copy" , "id" ),
155- ),
156- },
157- {
158- // After the main IP migrated, we check that there is no ForceNew on the copy
159- // This check that the ip is not deleted if the migration is done outside terraform
160- RefreshState : true ,
161- Check : resource .ComposeTestCheckFunc (
162- instancechecks .CheckIPExists (tt , "scaleway_instance_ip.main" ),
163- instancechecks .CheckIPExists (tt , "scaleway_instance_ip.copy" ),
164- resource .TestCheckResourceAttr ("scaleway_instance_ip.main" , "type" , "routed_ipv4" ),
165- resource .TestCheckResourceAttr ("scaleway_instance_ip.copy" , "type" , "routed_ipv4" ),
166- resource .TestCheckResourceAttrPair ("scaleway_instance_ip.main" , "id" , "scaleway_instance_ip.copy" , "id" ),
167- ),
168- },
169- },
170- })
171- }
172-
173- func TestAccIP_RoutedDowngrade (t * testing.T ) {
174- tt := acctest .NewTestTools (t )
175- defer tt .Cleanup ()
176-
177- resource .ParallelTest (t , resource.TestCase {
178- ProviderFactories : tt .ProviderFactories ,
179- CheckDestroy : instancechecks .IsIPDestroyed (tt ),
180- Steps : []resource.TestStep {
181- {
182- Config : `
183- resource "scaleway_instance_ip" "main" {
184- type = "routed_ipv4"
185- }
186- ` ,
187- Check : resource .ComposeTestCheckFunc (
188- instancechecks .CheckIPExists (tt , "scaleway_instance_ip.main" ),
189- resource .TestCheckResourceAttr ("scaleway_instance_ip.main" , "type" , "routed_ipv4" ),
190- isIPValid ("scaleway_instance_ip.main" , "address" ),
191- isIPCIDRValid ("scaleway_instance_ip.main" , "prefix" ),
192- ),
193- },
194- {
195- Config : `
196- resource "scaleway_instance_ip" "main" {
197- type = "nat"
198- }
199- ` ,
200- Check : resource .ComposeTestCheckFunc (
201- instancechecks .CheckIPExists (tt , "scaleway_instance_ip.main" ),
202- resource .TestCheckResourceAttr ("scaleway_instance_ip.main" , "type" , "nat" ),
203- isIPValid ("scaleway_instance_ip.main" , "address" ),
204- isIPCIDRValid ("scaleway_instance_ip.main" , "prefix" ),
205- ),
206- },
207- },
208- })
209- }
210-
211101func TestAccIP_RoutedIPV6 (t * testing.T ) {
212102 tt := acctest .NewTestTools (t )
213103 defer tt .Cleanup ()
0 commit comments