Skip to content

Commit 2ab33c4

Browse files
author
mikatong
committed
fix: gaap unit test
1 parent 7142923 commit 2ab33c4

File tree

4 files changed

+10
-22
lines changed

4 files changed

+10
-22
lines changed

tencentcloud/data_source_tc_gaap_realservers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func TestAccDataSourceTencentCloudGaapRealservers_name(t *testing.T) {
7474

7575
const TestAccDataSourceTencentCloudGaapRealserversBasic = `
7676
resource tencentcloud_gaap_realserver "foo" {
77-
ip = "1.1.1.1"
77+
ip = "1.1.1.10"
7878
name = "ci-test-gaap-realserver"
7979
}
8080

tencentcloud/data_source_tc_gaap_security_policies_test.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,8 @@ func TestAccDataSourceTencentCloudGaapSecurityPolices_basic(t *testing.T) {
2727
}
2828

2929
var TestAccDataSourceTencentCloudGaapSecurityPolicesBasic = fmt.Sprintf(`
30-
resource tencentcloud_gaap_security_policy "foo" {
31-
proxy_id = "%s"
32-
action = "ACCEPT"
33-
}
3430
3531
data tencentcloud_gaap_security_policies "foo" {
36-
id = tencentcloud_gaap_security_policy.foo.id
32+
id = "%s"
3733
}
38-
`, defaultGaapProxyId)
34+
`, defaultGaapSecurityPolicyId)

tencentcloud/data_source_tc_gaap_security_rules_test.go

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,10 @@ func TestAccDataSourceTencentCloudGaapSecurityRules_multi(t *testing.T) {
120120
}
121121

122122
var TestAccDataSourceTencentCloudGaapSecurityRulesBasic = fmt.Sprintf(`
123-
resource tencentcloud_gaap_security_policy "foo" {
124-
proxy_id = "%s"
125-
action = "ACCEPT"
126-
}
127123
128124
resource tencentcloud_gaap_security_rule "foo" {
129-
policy_id = tencentcloud_gaap_security_policy.foo.id
130-
name = "ci-test-gaap-s-rule"
125+
policy_id = "%s"
126+
name = "ci-test-gaap-s-rule-ds"
131127
cidr_ip = "1.1.1.1"
132128
action = "ACCEPT"
133129
protocol = "TCP"
@@ -137,16 +133,12 @@ resource tencentcloud_gaap_security_rule "foo" {
137133
data tencentcloud_gaap_security_rules "foo" {
138134
policy_id = tencentcloud_gaap_security_rule.foo.policy_id
139135
}
140-
`, defaultGaapProxyId)
136+
`, defaultGaapSecurityPolicyId)
141137

142138
var TestAccDataSourceTencentCloudGaapSecurityRulesRuleId = fmt.Sprintf(`
143-
resource tencentcloud_gaap_security_policy "foo" {
144-
proxy_id = "%s"
145-
action = "ACCEPT"
146-
}
147139
148140
resource tencentcloud_gaap_security_rule "foo" {
149-
policy_id = tencentcloud_gaap_security_policy.foo.id
141+
policy_id = "%s"
150142
name = "ci-test-gaap-s-rule"
151143
cidr_ip = "1.1.1.1"
152144
action = "ACCEPT"
@@ -155,10 +147,10 @@ resource tencentcloud_gaap_security_rule "foo" {
155147
}
156148
157149
data tencentcloud_gaap_security_rules "ruleId" {
158-
policy_id = tencentcloud_gaap_security_policy.foo.id
150+
policy_id = "%s"
159151
rule_id = tencentcloud_gaap_security_rule.foo.id
160152
}
161-
`, defaultGaapProxyId)
153+
`, defaultGaapSecurityPolicyId, defaultGaapSecurityPolicyId)
162154

163155
var TestAccDataSourceTencentCloudGaapSecurityRulesAction = fmt.Sprintf(`
164156
resource tencentcloud_gaap_security_policy "foo" {

tencentcloud/resource_tc_gaap_proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ func resourceTencentCloudGaapProxyUpdate(d *schema.ResourceData, m interface{})
337337
d.SetPartial("concurrent")
338338
}
339339
//deal with sync delay
340-
time.Sleep(time.Duration(10) * time.Second)
340+
time.Sleep(time.Duration(20) * time.Second)
341341
}
342342

343343
if d.HasChange("enable") {

0 commit comments

Comments
 (0)