Skip to content

Commit

Permalink
feat: e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiMengXS committed Oct 8, 2023
1 parent c84c000 commit afb9616
Show file tree
Hide file tree
Showing 19 changed files with 73 additions and 78 deletions.
12 changes: 6 additions & 6 deletions .changelog/2175.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
```release-note:new-resource
tencentcloud_ssl_replace_certificate
tencentcloud_ssl_replace_certificate_operation
```

```release-note:new-resource
tencentcloud_ssl_revoke_certificate
tencentcloud_ssl_revoke_certificate_operation
```

```release-note:new-resource
tencentcloud_ssl_update_certificate_instance
tencentcloud_ssl_update_certificate_instance_operation
```

```release-note:new-resource
tencentcloud_ssl_update_certificate_record_retry
tencentcloud_ssl_update_certificate_record_retry_operation
```

```release-note:new-resource
tencentcloud_ssl_update_certificate_record_rollback
tencentcloud_ssl_update_certificate_record_rollback_operation
```

```release-note:new-resource
tencentcloud_ssl_upload_revoke_letter
tencentcloud_ssl_upload_revoke_letter_operation
```
10 changes: 5 additions & 5 deletions tencentcloud/resource_tc_ssl_replace_certificate_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Provides a resource to create a ssl replace_certificate
Example Usage
```hcl
resource "tencentcloud_ssl_replace_certificate" "replace_certificate" {
resource "tencentcloud_ssl_replace_certificate_operation" "replace_certificate" {
certificate_id = "8L6JsWq2"
valid_type = "DNS_AUTO"
csr_type = "online"
Expand All @@ -16,7 +16,7 @@ Import
ssl replace_certificate can be imported using the id, e.g.
```
terraform import tencentcloud_ssl_replace_certificate.replace_certificate replace_certificate_id
terraform import tencentcloud_ssl_replace_certificate_operation.replace_certificate replace_certificate_id
```
*/
package tencentcloud
Expand Down Expand Up @@ -99,7 +99,7 @@ func resourceTencentCloudSslReplaceCertificateOperation() *schema.Resource {
}

func resourceTencentCloudSslReplaceCertificateCreate(d *schema.ResourceData, meta interface{}) error {
defer logElapsed("resource.tencentcloud_ssl_replace_certificate.create")()
defer logElapsed("resource.tencentcloud_ssl_replace_certificate_operation.create")()
defer inconsistentCheck(d, meta)()

logId := getLogId(contextNil)
Expand Down Expand Up @@ -165,14 +165,14 @@ func resourceTencentCloudSslReplaceCertificateCreate(d *schema.ResourceData, met
}

func resourceTencentCloudSslReplaceCertificateRead(d *schema.ResourceData, meta interface{}) error {
defer logElapsed("resource.tencentcloud_ssl_replace_certificate.read")()
defer logElapsed("resource.tencentcloud_ssl_replace_certificate_operation.read")()
defer inconsistentCheck(d, meta)()

return nil
}

func resourceTencentCloudSslReplaceCertificateDelete(d *schema.ResourceData, meta interface{}) error {
defer logElapsed("resource.tencentcloud_ssl_replace_certificate.delete")()
defer logElapsed("resource.tencentcloud_ssl_replace_certificate_operation.delete")()
defer inconsistentCheck(d, meta)()

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ func TestAccTencentCloudSslReplaceCertificateResource_basic(t *testing.T) {
Steps: []resource.TestStep{
{
Config: testAccSslReplaceCertificate,
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_ssl_replace_certificate.replace_certificate", "id"),
resource.TestCheckResourceAttr("tencentcloud_ssl_replace_certificate.replace_certificate", "certificate_id", "8hUkH3xC"),
resource.TestCheckResourceAttr("tencentcloud_ssl_replace_certificate.replace_certificate", "valid_type", "DNS_AUTO"),
resource.TestCheckResourceAttr("tencentcloud_ssl_replace_certificate.replace_certificate", "csr_type", "online"),
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_ssl_replace_certificate_operation.replace_certificate", "id"),
resource.TestCheckResourceAttr("tencentcloud_ssl_replace_certificate_operation.replace_certificate", "certificate_id", "8hUkH3xC"),
resource.TestCheckResourceAttr("tencentcloud_ssl_replace_certificate_operation.replace_certificate", "valid_type", "DNS_AUTO"),
resource.TestCheckResourceAttr("tencentcloud_ssl_replace_certificate_operation.replace_certificate", "csr_type", "online"),
),
},
},
Expand All @@ -28,7 +28,7 @@ func TestAccTencentCloudSslReplaceCertificateResource_basic(t *testing.T) {

const testAccSslReplaceCertificate = `
resource "tencentcloud_ssl_replace_certificate" "replace_certificate" {
resource "tencentcloud_ssl_replace_certificate_operation" "replace_certificate" {
certificate_id = "8hUkH3xC"
valid_type = "DNS_AUTO"
csr_type = "online"
Expand Down
10 changes: 5 additions & 5 deletions tencentcloud/resource_tc_ssl_revoke_certificate_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Provides a resource to create a ssl revoke_certificate
Example Usage
```hcl
resource "tencentcloud_ssl_revoke_certificate" "revoke_certificate" {
resource "tencentcloud_ssl_revoke_certificate_operation" "revoke_certificate" {
certificate_id = "7zUGkVab"
}
```
Expand All @@ -14,7 +14,7 @@ Import
ssl revoke_certificate can be imported using the id, e.g.
```
terraform import tencentcloud_ssl_revoke_certificate.revoke_certificate revoke_certificate_id
terraform import tencentcloud_ssl_revoke_certificate_operation.revoke_certificate revoke_certificate_id
```
*/
package tencentcloud
Expand Down Expand Up @@ -56,7 +56,7 @@ func resourceTencentCloudSslRevokeCertificateOperation() *schema.Resource {
}

func resourceTencentCloudSslRevokeCertificateCreate(d *schema.ResourceData, meta interface{}) error {
defer logElapsed("resource.tencentcloud_ssl_revoke_certificate.create")()
defer logElapsed("resource.tencentcloud_ssl_revoke_certificate_operation.create")()
defer inconsistentCheck(d, meta)()

logId := getLogId(contextNil)
Expand Down Expand Up @@ -99,14 +99,14 @@ func resourceTencentCloudSslRevokeCertificateCreate(d *schema.ResourceData, meta
}

func resourceTencentCloudSslRevokeCertificateRead(d *schema.ResourceData, meta interface{}) error {
defer logElapsed("resource.tencentcloud_ssl_revoke_certificate.read")()
defer logElapsed("resource.tencentcloud_ssl_revoke_certificate_operation.read")()
defer inconsistentCheck(d, meta)()

return nil
}

func resourceTencentCloudSslRevokeCertificateDelete(d *schema.ResourceData, meta interface{}) error {
defer logElapsed("resource.tencentcloud_ssl_revoke_certificate.delete")()
defer logElapsed("resource.tencentcloud_ssl_revoke_certificate_operation.delete")()
defer inconsistentCheck(d, meta)()

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ func TestAccTencentCloudSslRevokeCertificateResource_basic(t *testing.T) {
Steps: []resource.TestStep{
{
Config: testAccSslRevokeCertificate,
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_ssl_revoke_certificate.revoke_certificate", "id"),
resource.TestCheckResourceAttr("tencentcloud_ssl_revoke_certificate.revoke_certificate", "certificate_id", "8hUkH3xC"),
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_ssl_revoke_certificate_operation.revoke_certificate", "id"),
resource.TestCheckResourceAttr("tencentcloud_ssl_revoke_certificate_operation.revoke_certificate", "certificate_id", "8hUkH3xC"),
),
},
},
Expand All @@ -26,7 +26,7 @@ func TestAccTencentCloudSslRevokeCertificateResource_basic(t *testing.T) {

const testAccSslRevokeCertificate = `
resource "tencentcloud_ssl_revoke_certificate" "revoke_certificate" {
resource "tencentcloud_ssl_revoke_certificate_operation" "revoke_certificate" {
certificate_id = "8hUkH3xC"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Provides a resource to create a ssl update_certificate_instance
Example Usage
```hcl
resource "tencentcloud_ssl_update_certificate_instance" "update_certificate_instance" {
resource "tencentcloud_ssl_update_certificate_instance_operation" "update_certificate_instance" {
certificate_id = "8x1eUSSl"
old_certificate_id = "8xNdi2ig"
resource_types = ["cdn"]
Expand All @@ -16,7 +16,7 @@ Import
ssl update_certificate_instance can be imported using the id, e.g.
```
terraform import tencentcloud_ssl_update_certificate_instance.update_certificate_instance update_certificate_instance_id
terraform import tencentcloud_ssl_update_certificate_instance_operation.update_certificate_instance update_certificate_instance_id
```
*/
package tencentcloud
Expand Down Expand Up @@ -92,7 +92,7 @@ func resourceTencentCloudSslUpdateCertificateInstanceOperation() *schema.Resourc
}

func resourceTencentCloudSslUpdateCertificateInstanceCreate(d *schema.ResourceData, meta interface{}) error {
defer logElapsed("resource.tencentcloud_ssl_update_certificate_instance.create")()
defer logElapsed("resource.tencentcloud_ssl_update_certificate_instance_operation.create")()
defer inconsistentCheck(d, meta)()

logId := getLogId(contextNil)
Expand Down Expand Up @@ -167,14 +167,14 @@ func resourceTencentCloudSslUpdateCertificateInstanceCreate(d *schema.ResourceDa
}

func resourceTencentCloudSslUpdateCertificateInstanceRead(d *schema.ResourceData, meta interface{}) error {
defer logElapsed("resource.tencentcloud_ssl_update_certificate_instance.read")()
defer logElapsed("resource.tencentcloud_ssl_update_certificate_instance_operation.read")()
defer inconsistentCheck(d, meta)()

return nil
}

func resourceTencentCloudSslUpdateCertificateInstanceDelete(d *schema.ResourceData, meta interface{}) error {
defer logElapsed("resource.tencentcloud_ssl_update_certificate_instance.delete")()
defer logElapsed("resource.tencentcloud_ssl_update_certificate_instance_operation.delete")()
defer inconsistentCheck(d, meta)()

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ func TestAccTencentCloudSslUpdateCertificateInstanceResource_basic(t *testing.T)
Steps: []resource.TestStep{
{
Config: testAccSslUpdateCertificateInstance,
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_ssl_update_certificate_instance.update_certificate_instance", "id"),
resource.TestCheckResourceAttr("tencentcloud_ssl_update_certificate_instance.update_certificate_instance", "certificate_id", "7REHyHM1"),
resource.TestCheckResourceAttr("tencentcloud_ssl_update_certificate_instance.update_certificate_instance", "old_certificate_id", "9D3qRt7r"),
resource.TestCheckResourceAttr("tencentcloud_ssl_update_certificate_instance.update_certificate_instance", "resource_types.0", "cdn"),
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_ssl_update_certificate_instance_operation.update_certificate_instance", "id"),
resource.TestCheckResourceAttr("tencentcloud_ssl_update_certificate_instance_operation.update_certificate_instance", "certificate_id", "7REHyHM1"),
resource.TestCheckResourceAttr("tencentcloud_ssl_update_certificate_instance_operation.update_certificate_instance", "old_certificate_id", "9D3qRt7r"),
resource.TestCheckResourceAttr("tencentcloud_ssl_update_certificate_instance_operation.update_certificate_instance", "resource_types.0", "cdn"),
),
},
},
Expand All @@ -28,7 +28,7 @@ func TestAccTencentCloudSslUpdateCertificateInstanceResource_basic(t *testing.T)

const testAccSslUpdateCertificateInstance = `
resource "tencentcloud_ssl_update_certificate_instance" "update_certificate_instance" {
resource "tencentcloud_ssl_update_certificate_instance_operation" "update_certificate_instance" {
certificate_id = "7REHyHM1"
old_certificate_id = "9D3qRt7r"
resource_types = ["cdn"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Provides a resource to create a ssl update_certificate_record_retry
Example Usage
```hcl
resource "tencentcloud_ssl_update_certificate_record_retry" "update_certificate_record_retry" {
resource "tencentcloud_ssl_update_certificate_record_retry_operation" "update_certificate_record_retry" {
deploy_record_id = "1603"
}
```
Expand All @@ -14,7 +14,7 @@ Import
ssl update_certificate_record_retry can be imported using the id, e.g.
```
terraform import tencentcloud_ssl_update_certificate_record_retry.update_certificate_record_retry update_certificate_record_retry_id
terraform import tencentcloud_ssl_update_certificate_record_retry_operation.update_certificate_record_retry update_certificate_record_retry_id
```
*/
package tencentcloud
Expand Down Expand Up @@ -55,7 +55,7 @@ func resourceTencentCloudSslUpdateCertificateRecordRetryOperation() *schema.Reso
}

func resourceTencentCloudSslUpdateCertificateRecordRetryCreate(d *schema.ResourceData, meta interface{}) error {
defer logElapsed("resource.tencentcloud_ssl_update_certificate_record_retry.create")()
defer logElapsed("resource.tencentcloud_ssl_update_certificate_record_retry_operation.create")()
defer inconsistentCheck(d, meta)()

logId := getLogId(contextNil)
Expand Down Expand Up @@ -93,14 +93,14 @@ func resourceTencentCloudSslUpdateCertificateRecordRetryCreate(d *schema.Resourc
}

func resourceTencentCloudSslUpdateCertificateRecordRetryRead(d *schema.ResourceData, meta interface{}) error {
defer logElapsed("resource.tencentcloud_ssl_update_certificate_record_retry.read")()
defer logElapsed("resource.tencentcloud_ssl_update_certificate_record_retry_operation.read")()
defer inconsistentCheck(d, meta)()

return nil
}

func resourceTencentCloudSslUpdateCertificateRecordRetryDelete(d *schema.ResourceData, meta interface{}) error {
defer logElapsed("resource.tencentcloud_ssl_update_certificate_record_retry.delete")()
defer logElapsed("resource.tencentcloud_ssl_update_certificate_record_retry_operation.delete")()
defer inconsistentCheck(d, meta)()

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ func TestAccTencentCloudSslUpdateCertificateRecordRetryResource_basic(t *testing
Steps: []resource.TestStep{
{
Config: testAccSslUpdateCertificateRecordRetry,
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_ssl_update_certificate_record_retry.update_certificate_record_retry", "id"),
resource.TestCheckResourceAttr("tencentcloud_ssl_update_certificate_record_retry.update_certificate_record_retry", "deploy_record_id", "1689"),
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_ssl_update_certificate_record_retry_operation.update_certificate_record_retry", "id"),
resource.TestCheckResourceAttr("tencentcloud_ssl_update_certificate_record_retry_operation.update_certificate_record_retry", "deploy_record_id", "1689"),
),
},
{
ResourceName: "tencentcloud_ssl_update_certificate_record_retry.update_certificate_record_retry",
ResourceName: "tencentcloud_ssl_update_certificate_record_retry_operation.update_certificate_record_retry",
ImportState: true,
ImportStateVerify: true,
},
Expand All @@ -31,7 +31,7 @@ func TestAccTencentCloudSslUpdateCertificateRecordRetryResource_basic(t *testing

const testAccSslUpdateCertificateRecordRetry = `
resource "tencentcloud_ssl_update_certificate_record_retry" "update_certificate_record_retry" {
resource "tencentcloud_ssl_update_certificate_record_retry_operation" "update_certificate_record_retry" {
deploy_record_id = "1689"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Provides a resource to create a ssl update_certificate_record_rollback
Example Usage
```hcl
resource "tencentcloud_ssl_update_certificate_record_rollback" "update_certificate_record_rollback" {
resource "tencentcloud_ssl_update_certificate_record_rollback_operation" "update_certificate_record_rollback" {
deploy_record_id = "1603"
}
```
Expand All @@ -14,7 +14,7 @@ Import
ssl update_certificate_record_rollback can be imported using the id, e.g.
```
terraform import tencentcloud_ssl_update_certificate_record_rollback.update_certificate_record_rollback update_certificate_record_rollback_id
terraform import tencentcloud_ssl_update_certificate_record_rollback_operation.update_certificate_record_rollback update_certificate_record_rollback_id
```
*/
package tencentcloud
Expand Down Expand Up @@ -48,7 +48,7 @@ func resourceTencentCloudSslUpdateCertificateRecordRollbackOperation() *schema.R
}

func resourceTencentCloudSslUpdateCertificateRecordRollbackCreate(d *schema.ResourceData, meta interface{}) error {
defer logElapsed("resource.tencentcloud_ssl_update_certificate_record_rollback.create")()
defer logElapsed("resource.tencentcloud_ssl_update_certificate_record_rollback_operation.create")()
defer inconsistentCheck(d, meta)()

logId := getLogId(contextNil)
Expand Down Expand Up @@ -85,14 +85,14 @@ func resourceTencentCloudSslUpdateCertificateRecordRollbackCreate(d *schema.Reso
}

func resourceTencentCloudSslUpdateCertificateRecordRollbackRead(d *schema.ResourceData, meta interface{}) error {
defer logElapsed("resource.tencentcloud_ssl_update_certificate_record_rollback.read")()
defer logElapsed("resource.tencentcloud_ssl_update_certificate_record_rollback_operation.read")()
defer inconsistentCheck(d, meta)()

return nil
}

func resourceTencentCloudSslUpdateCertificateRecordRollbackDelete(d *schema.ResourceData, meta interface{}) error {
defer logElapsed("resource.tencentcloud_ssl_update_certificate_record_rollback.delete")()
defer logElapsed("resource.tencentcloud_ssl_update_certificate_record_rollback_operation.delete")()
defer inconsistentCheck(d, meta)()

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ func TestAccTencentCloudSslUpdateCertificateRecordRollbackResource_basic(t *test
Steps: []resource.TestStep{
{
Config: testAccSslUpdateCertificateRecordRollback,
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_ssl_update_certificate_record_rollback.update_certificate_record_rollback", "id"),
resource.TestCheckResourceAttr("tencentcloud_ssl_update_certificate_record_rollback.update_certificate_record_rollback", "deploy_record_id", "1689"),
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_ssl_update_certificate_record_rollback_operation.update_certificate_record_rollback", "id"),
resource.TestCheckResourceAttr("tencentcloud_ssl_update_certificate_record_rollback_operation.update_certificate_record_rollback", "deploy_record_id", "1693"),
),
},
},
Expand All @@ -26,8 +26,8 @@ func TestAccTencentCloudSslUpdateCertificateRecordRollbackResource_basic(t *test

const testAccSslUpdateCertificateRecordRollback = `
resource "tencentcloud_ssl_update_certificate_record_rollback" "update_certificate_record_rollback" {
deploy_record_id = "1689"
resource "tencentcloud_ssl_update_certificate_record_rollback_operation" "update_certificate_record_rollback" {
deploy_record_id = "1693"
}
`
Loading

0 comments on commit afb9616

Please sign in to comment.