-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testcase: Change vpc and vswitch creation to read #4387
Conversation
@@ -293,7 +293,7 @@ func resourceAliyunVpnGatewayDelete(d *schema.ResourceData, meta interface{}) er | |||
}) | |||
|
|||
if err != nil { | |||
if IsExpectedErrors(err, []string{"InvalidVpnGatewayInstanceId.NotFound"}) { | |||
if IsExpectedErrors(err, []string{"InvalidVpnGatewayInstanceId.NotFound", "ForbiddenRelease"}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改为预付费后,删除资源时抛出errcode:ForbiddenRelease,所以在这里做预知错误处理
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ForbiddenRelease 是代表这个资源已经不存在了么
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不是,报错信息是:Forbidden to release a prepaid instance within validity period,有效期内无法删除实例
bandwidth = "10" | ||
enable_ssl = true | ||
instance_charge_type = "PostPaid" | ||
instance_charge_type = "PrePaid" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里修改这个字段为预付费的原因是查看了当前资源的文档以及去控制台手动创建测试,发现这个资源现在只支持预付费类型.
@@ -124,7 +124,7 @@ func TestAccAlicloudSslVpnClientCert_basic(t *testing.T) { | |||
// module name | |||
IDRefreshName: resourceId, | |||
Providers: testAccProviders, | |||
CheckDestroy: testAccCheckSslVpnClientCertDestroy, | |||
CheckDestroy: nil, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两个case是只有国际站的账号才能创建,你是怎么测试的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果你的账号可以测试成功,那么这个case就不受账号类型的限制了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已去掉
@@ -293,7 +293,7 @@ func resourceAliyunVpnGatewayDelete(d *schema.ResourceData, meta interface{}) er | |||
}) | |||
|
|||
if err != nil { | |||
if IsExpectedErrors(err, []string{"InvalidVpnGatewayInstanceId.NotFound"}) { | |||
if IsExpectedErrors(err, []string{"InvalidVpnGatewayInstanceId.NotFound", "ForbiddenRelease"}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ForbiddenRelease 是代表这个资源已经不存在了么
c07de88
to
e666efd
Compare
|
||
return WrapError(vpnGatewayService.WaitForVpnGateway(d.Id(), Deleted, DefaultTimeoutMedium)) | ||
log.Printf("[WARN] Cannot destroy resource Alicloud Resource VPN Gateway. Terraform will remove this resource from the state file, however resources may remain.") | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对于预付费的要改成这种,对于后付费的,还是应该保留原有的逻辑
e666efd
to
da823fb
Compare
@@ -15,6 +15,8 @@ Provides a VPN gateway resource. | |||
|
|||
-> Currently International-Site account can open `PostPaid` VPN gateway and China-Site account can open `PrePaid` VPN gateway. | |||
|
|||
-> **NOTE:** The resource Cannot destroy. Terraform will remove this resource from the state file, however resources may remain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要说清楚,只有是预付费的时候才不能删除,
da823fb
to
73aa1e0
Compare
@@ -15,6 +15,8 @@ Provides a VPN gateway resource. | |||
|
|||
-> Currently International-Site account can open `PostPaid` VPN gateway and China-Site account can open `PrePaid` VPN gateway. | |||
|
|||
-> **NOTE:** If the resource is `PerPaid` type the resource Cannot destroy. Terraform will remove this resource from the state file, however resources may remain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-> NOTE: PrePaid
VPN gateway cannot be destroyed and provider will remove it from the state file.
73aa1e0
to
6430796
Compare
@@ -124,7 +124,7 @@ func TestAccAlicloudSslVpnClientCert_basic(t *testing.T) { | |||
// module name | |||
IDRefreshName: resourceId, | |||
Providers: testAccProviders, | |||
CheckDestroy: testAccCheckSslVpnClientCertDestroy, | |||
CheckDestroy: nil, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果你的账号可以测试成功,那么这个case就不受账号类型的限制了
57d8e04
to
111c765
Compare
@@ -12,7 +12,7 @@ func TestAccAlicloudVpnGatewaysDataSourceBasic(t *testing.T) { | |||
rand := acctest.RandIntRange(1000, 9999) | |||
preCheck := func() { | |||
testAccPreCheck(t) | |||
testAccPreCheckWithAccountSiteType(t, IntlSite) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
后付费的case还是应该保留
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已改
@@ -15,6 +15,8 @@ Provides a VPN gateway resource. | |||
|
|||
-> Currently International-Site account can open `PostPaid` VPN gateway and China-Site account can open `PrePaid` VPN gateway. | |||
|
|||
-> **NOTE:** `PrePaid` VPN gateway cannot be destroyed and provider will remove it from the state file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个描述跟 nat gateway 的那个保持一致
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已改
111c765
to
4ac2ed1
Compare
No description provided.