Skip to content

Commit

Permalink
Fix integration and acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
outscale-toa committed Aug 1, 2024
1 parent 4b32312 commit ea4aedd
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 122 deletions.
10 changes: 6 additions & 4 deletions outscale/data_source_outscale_api_access_rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package outscale
import (
"context"
"fmt"
"os"
"testing"
"time"

Expand All @@ -15,13 +16,14 @@ import (
func TestAccDataOutscaleApiAccessRules_basic(t *testing.T) {
t.Parallel()
resourceName := "outscale_api_access_rule.rule_data"
ca_path := os.Getenv("CA_PATH")
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccDataCheckOutscaleApiAccessRuleDestroy,
Steps: []resource.TestStep{
{
Config: testAccDataOutscaleApiAccessRulesConfig(),
Config: testAccDataOutscaleApiAccessRulesConfig(ca_path),
Check: resource.ComposeTestCheckFunc(
testAccCheckOutscaleApiAccessRuleExists(resourceName),
),
Expand Down Expand Up @@ -68,10 +70,10 @@ func testAccDataCheckOutscaleApiAccessRulesDestroy(s *terraform.State) error {
return nil
}

func testAccDataOutscaleApiAccessRulesConfig() string {
func testAccDataOutscaleApiAccessRulesConfig(cert_path string) string {
return fmt.Sprintf(`
resource "outscale_ca" "ca_rule" {
ca_pem = file("./test-cert.pem")
ca_pem = file("%q")
description = "Ca testacc create"
}
Expand Down Expand Up @@ -99,5 +101,5 @@ data "outscale_api_access_rules" "filters_rules" {
}
data "outscale_api_access_rules" "all_rules" {}
`)
`, cert_path)
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@
"attributes": {
"api_access_rule_id": "##id-0##",
"ca_ids": [
"##id-2##",
"##id-1##"
"##id-1##",
"##id-2##"
],
"cns": [
"outscale-1",
Expand Down Expand Up @@ -193,10 +193,10 @@
"schema_version": 0,
"attributes": {
"ca_fingerprint": "########",
"ca_id": "##id-2##",
"ca_id": "##id-1##",
"ca_pem": "########",
"description": "",
"id": "##id-2##",
"id": "##id-1##",
"request_id": "########"
},
"sensitive_attributes": [],
Expand All @@ -214,10 +214,10 @@
"schema_version": 0,
"attributes": {
"ca_fingerprint": "########",
"ca_id": "##id-1##",
"ca_id": "##id-2##",
"ca_pem": "########",
"description": "",
"id": "##id-1##",
"id": "##id-2##",
"request_id": "########"
},
"sensitive_attributes": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
"schema_version": 0,
"attributes": {
"ca_fingerprint": "########",
"ca_id": "##id-1##",
"ca_id": "##id-2##",
"ca_pem": "########",
"description": "",
"id": "##id-1##",
"id": "##id-2##",
"request_id": "########"
},
"sensitive_attributes": [],
Expand All @@ -68,10 +68,10 @@
"schema_version": 0,
"attributes": {
"ca_fingerprint": "########",
"ca_id": "##id-2##",
"ca_id": "##id-1##",
"ca_pem": "########",
"description": "",
"id": "##id-2##",
"id": "##id-1##",
"request_id": "########"
},
"sensitive_attributes": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
{
"ca_fingerprint": "########",
"ca_id": "##id-0##",
"description": "test-TF199"
"description": "test-TF199-2"
},
{
"ca_fingerprint": "########",
"ca_id": "##id-1##",
"description": "test-TF199-2"
"description": "test-TF199"
}
],
"filter": "########",
Expand All @@ -47,12 +47,12 @@
{
"ca_fingerprint": "########",
"ca_id": "##id-0##",
"description": "test-TF199"
"description": "test-TF199-2"
},
{
"ca_fingerprint": "########",
"ca_id": "##id-1##",
"description": "test-TF199-2"
"description": "test-TF199"
}
],
"filter": "########",
Expand All @@ -73,10 +73,10 @@
"schema_version": 0,
"attributes": {
"ca_fingerprint": "########",
"ca_id": "##id-0##",
"ca_id": "##id-1##",
"ca_pem": "########",
"description": "test-TF199",
"id": "##id-0##",
"id": "##id-1##",
"request_id": "########"
},
"sensitive_attributes": [],
Expand All @@ -94,10 +94,10 @@
"schema_version": 0,
"attributes": {
"ca_fingerprint": "########",
"ca_id": "##id-1##",
"ca_id": "##id-0##",
"ca_pem": "########",
"description": "test-TF199-2",
"id": "##id-1##",
"id": "##id-0##",
"request_id": "########"
},
"sensitive_attributes": [],
Expand Down
52 changes: 0 additions & 52 deletions tests/qa_provider_oapi/data/cert_example/certificate.key

This file was deleted.

29 changes: 0 additions & 29 deletions tests/qa_provider_oapi/data/cert_example/certificate.pem

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
{
"schema_version": 0,
"attributes": {
"body": "-----BEGIN CERTIFICATE-----\nMIIFCzCCAvOgAwIBAgIUepeU5aKBGJMY5XyUXqKWpuMqTmUwDQYJKoZIhvcNAQEL\nBQAwFTETMBEGA1UEAwwKZG9tYWluLmNvbTAeFw0yMzA2MjcwOTEwNDlaFw0yNDA2\nMjEwOTEwNDlaMBUxEzARBgNVBAMMCmRvbWFpbi5jb20wggIiMA0GCSqGSIb3DQEB\nAQUAA4ICDwAwggIKAoICAQDSFoa9qYsaGASCJOL33Q8m6hB2l7uBeDllijcCB9sR\nCO5A+nGvba2syBeSFWcXWrSGN1FX5pAPYzE0/avDcjZUHQ9L68wP6e3hKAZyisII\nFY0cw357PoUr26jXCmzbd2unSlStva0vxMsOLJfRK4DjB/ZtDBWlIvR52LhFfjwq\ntKTIZJepkF18IVRGaamwnikT7UkQi8fEqrkcWG9QK5RxXViegXdFbSPl1kqhtiRT\nHUZM1JBSEVoK3vp0uHGvyeN0UvNe+GUDvgXqjvxfSTvA3RlgTWWQu5UrtKlOadZM\nOJFlGaA6r8tOLZ/QlauhsFGBoA6ArldoM8gbfdwcELhdpqG1APuh6oXOvd9OeNwN\nHazK7RWd2JS+DoXRUApJ34cZhXbkbotShKPrWk16BkwhjxsOtVC0cQXFokN4Ryyi\n9LF7MJCGp8veG4eJWvd5C2wM1gTkWoMefcNwsAT0vCtjCFXDsWZKz9PFO4s447As\nQMprqw9uvA8BHFWTvz+ZjazSPOTXPIzDUD+jFOLwX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ZNEH8lH4NXvfhUD1hgpf0f9HdEZ\nR79laXexp1BpKvpaIkTIk4gp8DCBmAHuE1Vqy9jHGAxqSqAZncWjknVPfwLE0Mx6\nIqqwTKTFJIIhqJBxBqkUW46zA3/vHqhVD291HtYCP828bpudeaJnuhkOVWBHD0PA\nBml7MxoZGmGqhrqkv1pSd54NR0wrLvln275LMb1a/Wer/1OEpMbaJAaPvuw9R0ou\nr7FMRaFu87S/tMYGpRd79NPOiOqNUTFRJ9AzBhZL2rQl6hJKBjqlVAd/WS+nVTVS\nkqVUA4GRMot3rVFi5fPJK+by3AbvvI+8CUply+eEm8Y49IdssTY4+ocbkSzJS44/\nPjm4NCQd9p6+Cmrs2+2+WF1LjzHc2qf4kF00PHpRELNJThxH8tbO3zkMCzqSJE5+\njESi8nfinz9bMVo4cNokq4i3EC5lKijYJspaSXtfPssZe69LzTjkiyO8TuS8Z3EG\n/aDC04fDjiCXaqLRjYa1oZNboFsB57qGpyqlJ2YA0Yep2UBwXmL5IhSImCIH2S9j\nsH+ta5x9jCE/7l48kwC0XEOz1m/x8nqaizydN79H3gNXBk09JkCd3lE3CgWIueqw\nY1nD8v5jW6olGOp1p7LY+uf7C6pmpZwDDyL7sUvxpvEYC5U8wFxiu8Z6StGB5sA=\n-----END CERTIFICATE-----\n",
"chain": null,
"dry_run": null,
"expiration_date": "",
Expand Down
Loading

0 comments on commit ea4aedd

Please sign in to comment.