From 905284e21b7528699bde47b67c39c240a4286656 Mon Sep 17 00:00:00 2001 From: Rene Moser Date: Fri, 27 Sep 2024 14:15:53 +0200 Subject: [PATCH] tests: rename account --- tests/integration/targets/account/aliases | 3 + .../{cs_account => account}/meta/main.yml | 0 .../{cs_account => account}/tasks/main.yml | 328 +++++++++--------- tests/integration/targets/cs_account/aliases | 2 - 4 files changed, 167 insertions(+), 166 deletions(-) create mode 100644 tests/integration/targets/account/aliases rename tests/integration/targets/{cs_account => account}/meta/main.yml (100%) rename tests/integration/targets/{cs_account => account}/tasks/main.yml (54%) delete mode 100644 tests/integration/targets/cs_account/aliases diff --git a/tests/integration/targets/account/aliases b/tests/integration/targets/account/aliases new file mode 100644 index 0000000..2ce8657 --- /dev/null +++ b/tests/integration/targets/account/aliases @@ -0,0 +1,3 @@ +cloud/cs +cs/group1 +cs/group3 diff --git a/tests/integration/targets/cs_account/meta/main.yml b/tests/integration/targets/account/meta/main.yml similarity index 100% rename from tests/integration/targets/cs_account/meta/main.yml rename to tests/integration/targets/account/meta/main.yml diff --git a/tests/integration/targets/cs_account/tasks/main.yml b/tests/integration/targets/account/tasks/main.yml similarity index 54% rename from tests/integration/targets/cs_account/tasks/main.yml rename to tests/integration/targets/account/tasks/main.yml index 5bbe54b..582f77b 100644 --- a/tests/integration/targets/cs_account/tasks/main.yml +++ b/tests/integration/targets/account/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: setup - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_username" state: absent register: acc @@ -12,22 +12,22 @@ - name: verify results of fail if missing params assert: that: - - acc is failed - - 'acc.msg == "missing required arguments: name"' + - acc is failed + - 'acc.msg == "missing required arguments: name"' - name: test fail if missing params if state=present - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" register: acc ignore_errors: true - name: verify results of fail if missing params if state=present assert: that: - - acc is failed - - 'acc.msg == "missing required arguments: email, username, password, first_name, last_name"' + - acc is failed + - 'acc.msg == "missing required arguments: email, username, password, first_name, last_name"' - name: test create user account in check mode - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" username: "{{ cs_resource_prefix }}_username" password: "{{ cs_resource_prefix }}_password" @@ -40,10 +40,10 @@ - name: verify results of create account in check mode assert: that: - - acc is changed + - acc is changed - name: test create user account - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" username: "{{ cs_resource_prefix }}_username" password: "{{ cs_resource_prefix }}_password" @@ -55,15 +55,15 @@ - name: verify results of create account assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "enabled" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "enabled" + - acc.domain == "ROOT" - name: test create user account idempotence - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" username: "{{ cs_resource_prefix }}_username" password: "{{ cs_resource_prefix }}_password" @@ -75,15 +75,15 @@ - name: verify results of create account idempotence assert: that: - - acc is not changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "enabled" - - acc.domain == "ROOT" + - acc is not changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "enabled" + - acc.domain == "ROOT" - name: test lock user account in check mode - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: locked register: acc @@ -91,45 +91,45 @@ - name: verify results of lock user account in check mode assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "enabled" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "enabled" + - acc.domain == "ROOT" - name: test lock user account - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: locked register: acc - name: verify results of lock user account assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "locked" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "locked" + - acc.domain == "ROOT" - name: test lock user account idempotence - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: locked register: acc - name: verify results of lock user account idempotence assert: that: - - acc is not changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "locked" - - acc.domain == "ROOT" + - acc is not changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "locked" + - acc.domain == "ROOT" - name: test disable user account in check mode - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: disabled register: acc @@ -137,45 +137,45 @@ - name: verify results of disable user account in check mode assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "locked" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "locked" + - acc.domain == "ROOT" - name: test disable user account - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: disabled register: acc - name: verify results of disable user account assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "disabled" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "disabled" + - acc.domain == "ROOT" - name: test disable user account idempotence - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: disabled register: acc - name: verify results of disable user account idempotence assert: that: - - acc is not changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "disabled" - - acc.domain == "ROOT" + - acc is not changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "disabled" + - acc.domain == "ROOT" - name: test lock disabled user account in check mode - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: locked register: acc @@ -183,45 +183,45 @@ - name: verify results of lock disabled user account in check mode assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "disabled" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "disabled" + - acc.domain == "ROOT" - name: test lock disabled user account - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: locked register: acc - name: verify results of lock disabled user account assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "locked" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "locked" + - acc.domain == "ROOT" - name: test lock disabled user account idempotence - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: locked register: acc - name: verify results of lock disabled user account idempotence assert: that: - - acc is not changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "locked" - - acc.domain == "ROOT" + - acc is not changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "locked" + - acc.domain == "ROOT" - name: test enable user account in check mode - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: enabled register: acc @@ -229,45 +229,45 @@ - name: verify results of enable user account in check mode assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "locked" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "locked" + - acc.domain == "ROOT" - name: test enable user account - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: enabled register: acc - name: verify results of enable user account assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "enabled" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "enabled" + - acc.domain == "ROOT" - name: test enable user account idempotence - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: enabled register: acc - name: verify results of enable user account idempotence assert: that: - - acc is not changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "enabled" - - acc.domain == "ROOT" + - acc is not changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "enabled" + - acc.domain == "ROOT" - name: test remove user account in check mode - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: absent register: acc @@ -275,40 +275,40 @@ - name: verify results of remove user account in check mode assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "enabled" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "enabled" + - acc.domain == "ROOT" - name: test remove user account - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: absent register: acc - name: verify results of remove user account assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "enabled" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "enabled" + - acc.domain == "ROOT" - name: test remove user account idempotence - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: absent register: acc - name: verify results of remove user account idempotence assert: that: - - acc is not changed + - acc is not changed - name: test create user disabled account - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" username: "{{ cs_resource_prefix }}_username" password: "{{ cs_resource_prefix }}_password" @@ -321,30 +321,30 @@ - name: verify results of create disabled account assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "disabled" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "disabled" + - acc.domain == "ROOT" - name: test remove disabled user account - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: absent register: acc - name: verify results of remove disabled user account assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "disabled" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "disabled" + - acc.domain == "ROOT" - name: test create user locked account - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" username: "{{ cs_resource_prefix }}_username" password: "{{ cs_resource_prefix }}_password" @@ -357,30 +357,30 @@ - name: verify results of create locked account assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "locked" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "locked" + - acc.domain == "ROOT" - name: test remove locked user account - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: absent register: acc - name: verify results of remove locked user account assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "locked" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "locked" + - acc.domain == "ROOT" - name: test create user unlocked/enabled account - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" username: "{{ cs_resource_prefix }}_username" password: "{{ cs_resource_prefix }}_password" @@ -393,24 +393,24 @@ - name: verify results of create unlocked/enabled account assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "enabled" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "enabled" + - acc.domain == "ROOT" - name: test remove unlocked/enabled user account - cs_account: + ngine_io.cloudstack.account: name: "{{ cs_resource_prefix }}_user" state: absent register: acc - name: verify results of remove unlocked/enabled user account assert: that: - - acc is changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "example.com" - - acc.account_type == "user" - - acc.state == "enabled" - - acc.domain == "ROOT" + - acc is changed + - acc.name == cs_resource_prefix + "_user" + - acc.network_domain == "example.com" + - acc.account_type == "user" + - acc.state == "enabled" + - acc.domain == "ROOT" diff --git a/tests/integration/targets/cs_account/aliases b/tests/integration/targets/cs_account/aliases deleted file mode 100644 index c89c86d..0000000 --- a/tests/integration/targets/cs_account/aliases +++ /dev/null @@ -1,2 +0,0 @@ -cloud/cs -shippable/cs/group1