Skip to content

Commit

Permalink
Add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
outscale-toa committed Oct 14, 2024
1 parent f90873a commit 93b7cc4
Show file tree
Hide file tree
Showing 6 changed files with 319 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"version": "########",
"terraform_version": "########",
"serial": "########",
"lineage": "########",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "outscale_user",
"name": "userInteg",
"provider": "provider[\"registry.terraform.io/outscale/outscale\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"creation_date": "########",
"id": "##id-0##",
"last_modification_date": "########",
"path": "/",
"policy": [],
"user_id": "##id-0##",
"user_name": "test_integ"
},
"sensitive_attributes": [],
"private": "bnVsbA=="
}
]
}
],
"check_results": "########"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource "outscale_user" "userInteg" {
user_name = "test_integ"
path = "/"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"version": "########",
"terraform_version": "########",
"serial": "########",
"lineage": "########",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "outscale_policy",
"name": "policy_user01",
"provider": "provider[\"registry.terraform.io/outscale/outscale\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"creation_date": "########",
"description": "Example of description",
"document": "{\"Statement\": [ {\"Effect\": \"Allow\", \"Action\": [\"*\"], \"Resource\": [\"*\"]} ]}",
"id": "##id-0##",
"is_linkable": true,
"last_modification_date": "########",
"orn": "########",
"path": "/okht/",
"policy_default_version_id": "##id-1##",
"policy_id": "##id-2##",
"policy_name": "okht-user-policy",
"resources_count": 0
},
"sensitive_attributes": [],
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "outscale_user",
"name": "userInteg",
"provider": "provider[\"registry.terraform.io/outscale/outscale\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"creation_date": "########",
"id": "##id-3##",
"last_modification_date": "########",
"path": "/Integ/",
"policy": [
{
"creation_date": "########",
"last_modification_date": "########",
"policy_id": "##id-2##",
"policy_name": "okht-user-policy",
"policy_orn": "orn:ows:idauth::339215505907:policy/okht/okht-user-policy"
}
],
"user_id": "##id-3##",
"user_name": "test_integ_update"
},
"sensitive_attributes": [],
"private": "bnVsbA==",
"dependencies": [
"outscale_policy.policy_user01"
]
}
]
}
],
"check_results": "########"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
resource "outscale_policy" "policy_user01" {
description = "Example of description"
document = "{\"Statement\": [ {\"Effect\": \"Allow\", \"Action\": [\"*\"], \"Resource\": [\"*\"]} ]}"
path = "/okht/"
policy_name = "okht-user-policy"
}

resource "outscale_user" "userInteg" {
user_name = "test_integ_update"
path = "/Integ/"
policy {
policy_orn = outscale_policy.policy_user01.orn
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
"version": "########",
"terraform_version": "########",
"serial": "########",
"lineage": "########",
"outputs": {},
"resources": [
{
"mode": "data",
"type": "outscale_user_groups",
"name": "testgrpData",
"provider": "provider[\"registry.terraform.io/outscale/outscale\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"filter": "########",
"id": "##id-0##",
"user_groups": [
{
"creation_date": "########",
"last_modification_date": "########",
"orn": "########",
"path": "/TestdataUG/",
"user_group_id": "##id-1##",
"user_group_name": "testDataugInteg"
}
]
},
"sensitive_attributes": []
}
]
},
{
"mode": "managed",
"type": "outscale_policy",
"name": "policy_userGroup01",
"provider": "provider[\"registry.terraform.io/outscale/outscale\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"creation_date": "########",
"description": "Example of description",
"document": "{\"Statement\": [ {\"Effect\": \"Allow\", \"Action\": [\"*\"], \"Resource\": [\"*\"]} ]}",
"id": "##id-2##",
"is_linkable": true,
"last_modification_date": "########",
"orn": "########",
"path": "/okht/",
"policy_default_version_id": "##id-3##",
"policy_id": "##id-4##",
"policy_name": "group-policy",
"resources_count": 0
},
"sensitive_attributes": [],
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "outscale_policy",
"name": "policy_userTest",
"provider": "provider[\"registry.terraform.io/outscale/outscale\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"creation_date": "########",
"description": "Example of description",
"document": "{\"Statement\": [ {\"Effect\": \"Allow\", \"Action\": [\"*\"], \"Resource\": [\"*\"]} ]}",
"id": "##id-5##",
"is_linkable": true,
"last_modification_date": "########",
"orn": "########",
"path": "/",
"policy_default_version_id": "##id-3##",
"policy_id": "##id-6##",
"policy_name": "user-policy",
"resources_count": 0
},
"sensitive_attributes": [],
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "outscale_user",
"name": "userTest",
"provider": "provider[\"registry.terraform.io/outscale/outscale\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"creation_date": "########",
"id": "##id-7##",
"last_modification_date": "########",
"path": "/IntegGroup/",
"policy": [
{
"creation_date": "########",
"last_modification_date": "########",
"policy_id": "##id-6##",
"policy_name": "user-policy",
"policy_orn": "orn:ows:idauth::339215505907:policy/user-policy"
}
],
"user_id": "##id-7##",
"user_name": "group_user"
},
"sensitive_attributes": [],
"private": "bnVsbA==",
"dependencies": [
"outscale_policy.policy_userTest"
]
}
]
},
{
"mode": "managed",
"type": "outscale_user_group",
"name": "dataUserGroupInteg",
"provider": "provider[\"registry.terraform.io/outscale/outscale\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"creation_date": "########",
"id": "##id-8##",
"last_modification_date": "########",
"orn": "########",
"path": "/TestdataUG/",
"policy": [
{
"creation_date": "########",
"last_modification_date": "########",
"policy_id": "##id-4##",
"policy_name": "group-policy",
"policy_orn": "orn:ows:idauth::339215505907:policy/okht/group-policy"
}
],
"user": [],
"user_group_id": "##id-1##",
"user_group_name": "testDataugInteg"
},
"sensitive_attributes": [],
"private": "bnVsbA==",
"dependencies": [
"outscale_policy.policy_userGroup01"
]
}
]
}
],
"check_results": "########"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
resource "outscale_policy" "policy_userGroup01" {
description = "Example of description"
document = "{\"Statement\": [ {\"Effect\": \"Allow\", \"Action\": [\"*\"], \"Resource\": [\"*\"]} ]}"
path = "/okht/"
policy_name = "group-policy"
}

resource "outscale_policy" "policy_userTest" {
description = "Example of description"
document = "{\"Statement\": [ {\"Effect\": \"Allow\", \"Action\": [\"*\"], \"Resource\": [\"*\"]} ]}"
path = "/"
policy_name = "user-policy"
}

resource "outscale_user" "userTest" {
user_name = "group_user"
path = "/IntegGroup/"
policy {
policy_orn = outscale_policy.policy_userTest.orn
}
}

resource "outscale_user_group" "dataUserGroupInteg" {
user_group_name = "testDataugInteg"
path = "/TestdataUG/"
policy {
policy_orn = outscale_policy.policy_userGroup01.orn
}
}

data "outscale_user_groups" "testgrpData" {
filter {
name = "user_group_ids"
values = [outscale_user_group.dataUserGroupInteg.user_group_id]
}
filter {
name = "path_prefix"
values = ["/TestdataUG/"]
}
}

0 comments on commit 93b7cc4

Please sign in to comment.