Skip to content

Commit 50022be

Browse files
authored
Merge pull request #1752 from tencentcloudstack/feat/fix_vpn_v2_test
fix vpn v2 test
2 parents a49f99d + df6661c commit 50022be

File tree

2 files changed

+45
-3
lines changed

2 files changed

+45
-3
lines changed

tencentcloud/resource_tc_vpn_gateway_ssl_client_cert_test.go

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,55 @@ func TestAccTencentCloudVpnGatewaySslClientCertResource_basic(t *testing.T) {
3636

3737
const testAccVpnGatewaySslClientCert = `
3838
39+
resource "tencentcloud_vpn_ssl_server" "server" {
40+
local_address = [
41+
"172.16.0.0/17",
42+
]
43+
remote_address = "173.16.1.0/24"
44+
ssl_vpn_server_name = "tf-vpn-ssl-server"
45+
vpn_gateway_id = "vpngw-mll9np1x"
46+
ssl_vpn_protocol = "UDP"
47+
ssl_vpn_port = 1194
48+
integrity_algorithm = "MD5"
49+
encrypt_algorithm = "AES-128-CBC"
50+
compress = false
51+
}
52+
53+
resource "tencentcloud_vpn_ssl_client" "client" {
54+
ssl_vpn_server_id = tencentcloud_vpn_ssl_server.server.id
55+
ssl_vpn_client_name = "tf-vpn-ssl-client"
56+
}
57+
3958
resource "tencentcloud_vpn_gateway_ssl_client_cert" "vpn_gateway_ssl_client_cert" {
40-
ssl_vpn_client_id = "vpnc-52f5lnd5"
59+
ssl_vpn_client_id = tencentcloud_vpn_ssl_client.client.id
4160
switch = "off"
4261
}
4362
4463
`
4564

4665
const testAccVpnGatewaySslClientCertUpdate = `
4766
67+
resource "tencentcloud_vpn_ssl_server" "server" {
68+
local_address = [
69+
"172.16.0.0/17",
70+
]
71+
remote_address = "173.16.1.0/24"
72+
ssl_vpn_server_name = "tf-vpn-ssl-server"
73+
vpn_gateway_id = "vpngw-mll9np1x"
74+
ssl_vpn_protocol = "UDP"
75+
ssl_vpn_port = 1194
76+
integrity_algorithm = "MD5"
77+
encrypt_algorithm = "AES-128-CBC"
78+
compress = false
79+
}
80+
81+
resource "tencentcloud_vpn_ssl_client" "client" {
82+
ssl_vpn_server_id = tencentcloud_vpn_ssl_server.server.id
83+
ssl_vpn_client_name = "tf-vpn-ssl-client"
84+
}
85+
4886
resource "tencentcloud_vpn_gateway_ssl_client_cert" "vpn_gateway_ssl_client_cert" {
49-
ssl_vpn_client_id = "vpnc-52f5lnd5"
87+
ssl_vpn_client_id = tencentcloud_vpn_ssl_client.client.id
5088
switch = "on"
5189
}
5290

tencentcloud/resource_tc_vpn_ssl_server.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,11 @@ func resourceTencentCloudVpnSslServerRead(d *schema.ResourceData, meta interface
226226
_ = d.Set("encrypt_algorithm", info.EncryptAlgorithm)
227227
}
228228
if _, ok := d.GetOk("compress"); ok {
229-
_ = d.Set("compress", info.Compress)
229+
compress := *info.Compress
230+
_ = d.Set("compress", false)
231+
if compress != 0 {
232+
_ = d.Set("compress", true)
233+
}
230234
}
231235
return nil
232236
})

0 commit comments

Comments
 (0)