@@ -12,7 +12,10 @@ import (
1212 "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/iam"
1313)
1414
15- const SSHKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICJEoOOgQBLJPs4g/XcPTKT82NywNPpxeuA20FlOPlpO [email protected] " 15+ const (
16+ SSHKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICJEoOOgQBLJPs4g/XcPTKT82NywNPpxeuA20FlOPlpO [email protected] " 17+ SSHKeyWithoutComment = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICJEoOOgQBLJPs4g/XcPTKT82NywNPpxeuA20FlOPlpO"
18+ )
1619
1720func init () {
1821 resource .AddTestSweepers ("scaleway_iam_ssh_key" , & resource.Sweeper {
@@ -68,7 +71,7 @@ func TestAccScalewayIamSSHKey_basic(t *testing.T) {
6871 Check : resource .ComposeTestCheckFunc (
6972 iam .CheckSSHKeyExists (tt , "scaleway_iam_ssh_key.main" ),
7073 resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "name" , name ),
71- resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "public_key" , SSHKey ),
74+ resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "public_key" , SSHKeyWithoutComment ),
7275 ),
7376 },
7477 {
@@ -81,7 +84,7 @@ func TestAccScalewayIamSSHKey_basic(t *testing.T) {
8184 Check : resource .ComposeTestCheckFunc (
8285 iam .CheckSSHKeyExists (tt , "scaleway_iam_ssh_key.main" ),
8386 resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "name" , name + "-updated" ),
84- resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "public_key" , SSHKey ),
87+ resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "public_key" , SSHKeyWithoutComment ),
8588 ),
8689 },
8790 },
@@ -108,7 +111,7 @@ func TestAccScalewayIamSSHKey_WithNewLine(t *testing.T) {
108111 Check : resource .ComposeTestCheckFunc (
109112 iam .CheckSSHKeyExists (tt , "scaleway_iam_ssh_key.main" ),
110113 resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "name" , name ),
111- resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "public_key" , SSHKey ),
114+ resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "public_key" , SSHKeyWithoutComment ),
112115 ),
113116 },
114117 },
@@ -135,7 +138,7 @@ func TestAccScalewayIamSSHKey_ChangeResourceName(t *testing.T) {
135138 Check : resource .ComposeTestCheckFunc (
136139 iam .CheckSSHKeyExists (tt , "scaleway_iam_ssh_key.first" ),
137140 resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.first" , "name" , name ),
138- resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.first" , "public_key" , SSHKey ),
141+ resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.first" , "public_key" , SSHKeyWithoutComment ),
139142 ),
140143 },
141144 {
@@ -148,7 +151,7 @@ func TestAccScalewayIamSSHKey_ChangeResourceName(t *testing.T) {
148151 Check : resource .ComposeTestCheckFunc (
149152 iam .CheckSSHKeyExists (tt , "scaleway_iam_ssh_key.second" ),
150153 resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.second" , "name" , name ),
151- resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.second" , "public_key" , SSHKey ),
154+ resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.second" , "public_key" , SSHKeyWithoutComment ),
152155 ),
153156 },
154157 },
@@ -175,7 +178,7 @@ func TestAccScalewayIamSSHKey_Disabled(t *testing.T) {
175178 Check : resource .ComposeTestCheckFunc (
176179 iam .CheckSSHKeyExists (tt , "scaleway_iam_ssh_key.main" ),
177180 resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "name" , name ),
178- resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "public_key" , SSHKey ),
181+ resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "public_key" , SSHKeyWithoutComment ),
179182 resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "disabled" , "false" ),
180183 ),
181184 },
@@ -190,7 +193,7 @@ func TestAccScalewayIamSSHKey_Disabled(t *testing.T) {
190193 Check : resource .ComposeTestCheckFunc (
191194 iam .CheckSSHKeyExists (tt , "scaleway_iam_ssh_key.main" ),
192195 resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "name" , name ),
193- resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "public_key" , SSHKey ),
196+ resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "public_key" , SSHKeyWithoutComment ),
194197 resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "disabled" , "true" ),
195198 ),
196199 },
@@ -205,7 +208,7 @@ func TestAccScalewayIamSSHKey_Disabled(t *testing.T) {
205208 Check : resource .ComposeTestCheckFunc (
206209 iam .CheckSSHKeyExists (tt , "scaleway_iam_ssh_key.main" ),
207210 resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "name" , name ),
208- resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "public_key" , SSHKey ),
211+ resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "public_key" , SSHKeyWithoutComment ),
209212 resource .TestCheckResourceAttr ("scaleway_iam_ssh_key.main" , "disabled" , "false" ),
210213 ),
211214 },
0 commit comments