From 16c4df439a6cf9b9a3cd6847ba6be654c8f8f3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 1 Apr 2019 10:54:34 +0200 Subject: [PATCH] Migrate Scaleway tests to integration tests --- .github/BOTMETA.yml | 4 +- .../cloud-config-scaleway.ini.template | 13 ++++ .../targets/scaleway_compute/aliases | 2 + .../scaleway_compute/defaults/main.yml | 0 .../targets}/scaleway_compute/tasks/ip.yml | 0 .../targets}/scaleway_compute/tasks/main.yml | 0 .../scaleway_compute/tasks/pagination.yml | 0 .../scaleway_compute/tasks/security_group.yml | 0 .../targets}/scaleway_compute/tasks/state.yml | 0 .../targets/scaleway_image_facts/aliases | 2 + .../scaleway_image_facts/tasks/main.yml | 0 test/integration/targets/scaleway_ip/aliases | 2 + .../targets}/scaleway_ip/defaults/main.yml | 0 .../targets}/scaleway_ip/tasks/main.yml | 0 .../targets/scaleway_ip_facts/aliases | 2 + .../targets}/scaleway_ip_facts/tasks/main.yml | 0 test/integration/targets/scaleway_lb/aliases | 2 + .../targets}/scaleway_lb/defaults/main.yml | 0 .../targets}/scaleway_lb/tasks/main.yml | 0 .../scaleway_organization_facts/aliases | 2 + .../tasks/main.yml | 0 test/integration/targets/scaleway_s3/aliases | 2 + .../targets}/scaleway_s3/defaults/main.yml | 0 .../targets}/scaleway_s3/tasks/aws_s3.yml | 0 .../scaleway_s3/tasks/aws_s3_create.yml | 0 .../scaleway_s3/tasks/aws_s3_delete.yml | 0 .../scaleway_s3/tasks/aws_s3_delobj.yml | 0 .../targets}/scaleway_s3/tasks/aws_s3_get.yml | 0 .../scaleway_s3/tasks/aws_s3_getstr.yml | 0 .../scaleway_s3/tasks/aws_s3_geturl.yml | 0 .../scaleway_s3/tasks/aws_s3_list.yml | 0 .../targets}/scaleway_s3/tasks/aws_s3_put.yml | 0 .../targets}/scaleway_s3/tasks/main.yml | 0 .../targets}/scaleway_s3/tasks/s3_bucket.yml | 0 .../targets/scaleway_security_group/aliases | 2 + .../scaleway_security_group/defaults/main.yml | 0 .../scaleway_security_group/tasks/main.yml | 0 .../scaleway_security_group_facts/aliases | 2 + .../tasks/main.yml | 0 .../scaleway_security_group_rule/aliases | 2 + .../defaults/main.yml | 0 .../tasks/main.yml | 0 .../targets/scaleway_server_facts/aliases | 2 + .../scaleway_server_facts/tasks/main.yml | 0 .../targets/scaleway_snapshot_facts/aliases | 2 + .../scaleway_snapshot_facts/tasks/main.yml | 0 test/integration/targets/scaleway_ssh/aliases | 2 + .../targets}/scaleway_ssh/tasks/main.yml | 0 .../targets/scaleway_user_data/aliases | 2 + .../scaleway_user_data/defaults/main.yml | 0 .../scaleway_user_data/tasks/main.yml | 0 .../targets/scaleway_volume/aliases | 2 + .../scaleway_volume/defaults/main.yml | 0 .../targets}/scaleway_volume/tasks/main.yml | 0 .../targets/scaleway_volume_facts/aliases | 2 + .../scaleway_volume_facts/tasks/main.yml | 0 test/legacy/scaleway.yml | 24 ------- test/runner/lib/cloud/scaleway.py | 66 +++++++++++++++++++ 58 files changed, 112 insertions(+), 27 deletions(-) create mode 100644 test/integration/cloud-config-scaleway.ini.template create mode 100644 test/integration/targets/scaleway_compute/aliases rename test/{legacy/roles => integration/targets}/scaleway_compute/defaults/main.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_compute/tasks/ip.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_compute/tasks/main.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_compute/tasks/pagination.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_compute/tasks/security_group.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_compute/tasks/state.yml (100%) create mode 100644 test/integration/targets/scaleway_image_facts/aliases rename test/{legacy/roles => integration/targets}/scaleway_image_facts/tasks/main.yml (100%) create mode 100644 test/integration/targets/scaleway_ip/aliases rename test/{legacy/roles => integration/targets}/scaleway_ip/defaults/main.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_ip/tasks/main.yml (100%) create mode 100644 test/integration/targets/scaleway_ip_facts/aliases rename test/{legacy/roles => integration/targets}/scaleway_ip_facts/tasks/main.yml (100%) create mode 100644 test/integration/targets/scaleway_lb/aliases rename test/{legacy/roles => integration/targets}/scaleway_lb/defaults/main.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_lb/tasks/main.yml (100%) create mode 100644 test/integration/targets/scaleway_organization_facts/aliases rename test/{legacy/roles => integration/targets}/scaleway_organization_facts/tasks/main.yml (100%) create mode 100644 test/integration/targets/scaleway_s3/aliases rename test/{legacy/roles => integration/targets}/scaleway_s3/defaults/main.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_s3/tasks/aws_s3.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_s3/tasks/aws_s3_create.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_s3/tasks/aws_s3_delete.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_s3/tasks/aws_s3_delobj.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_s3/tasks/aws_s3_get.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_s3/tasks/aws_s3_getstr.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_s3/tasks/aws_s3_geturl.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_s3/tasks/aws_s3_list.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_s3/tasks/aws_s3_put.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_s3/tasks/main.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_s3/tasks/s3_bucket.yml (100%) create mode 100644 test/integration/targets/scaleway_security_group/aliases rename test/{legacy/roles => integration/targets}/scaleway_security_group/defaults/main.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_security_group/tasks/main.yml (100%) create mode 100644 test/integration/targets/scaleway_security_group_facts/aliases rename test/{legacy/roles => integration/targets}/scaleway_security_group_facts/tasks/main.yml (100%) create mode 100644 test/integration/targets/scaleway_security_group_rule/aliases rename test/{legacy/roles => integration/targets}/scaleway_security_group_rule/defaults/main.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_security_group_rule/tasks/main.yml (100%) create mode 100644 test/integration/targets/scaleway_server_facts/aliases rename test/{legacy/roles => integration/targets}/scaleway_server_facts/tasks/main.yml (100%) create mode 100644 test/integration/targets/scaleway_snapshot_facts/aliases rename test/{legacy/roles => integration/targets}/scaleway_snapshot_facts/tasks/main.yml (100%) create mode 100644 test/integration/targets/scaleway_ssh/aliases rename test/{legacy/roles => integration/targets}/scaleway_ssh/tasks/main.yml (100%) create mode 100644 test/integration/targets/scaleway_user_data/aliases rename test/{legacy/roles => integration/targets}/scaleway_user_data/defaults/main.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_user_data/tasks/main.yml (100%) create mode 100644 test/integration/targets/scaleway_volume/aliases rename test/{legacy/roles => integration/targets}/scaleway_volume/defaults/main.yml (100%) rename test/{legacy/roles => integration/targets}/scaleway_volume/tasks/main.yml (100%) create mode 100644 test/integration/targets/scaleway_volume_facts/aliases rename test/{legacy/roles => integration/targets}/scaleway_volume_facts/tasks/main.yml (100%) delete mode 100644 test/legacy/scaleway.yml create mode 100644 test/runner/lib/cloud/scaleway.py diff --git a/.github/BOTMETA.yml b/.github/BOTMETA.yml index 6d83c69bd8..ed08e1126f 100644 --- a/.github/BOTMETA.yml +++ b/.github/BOTMETA.yml @@ -1368,6 +1368,7 @@ files: test/integration/targets/nxos_: *nxos test/integration/targets/openssl: *crypto test/integration/targets/postgresql: *postgresql + test/integration/targets/scaleway_: *scaleway test/integration/targets/setup_acme: *crypto test/integration/targets/setup_docker: *docker test/integration/targets/setup_openssl: *crypto @@ -1378,9 +1379,6 @@ files: test/integration/targets/vultr: *vultr test/legacy/: notified: mattclay - test/legacy/scaleway: - <<: *scaleway - support: community test/runner/: notified: mattclay test/runner/lib/cloud/acme.py: *crypto diff --git a/test/integration/cloud-config-scaleway.ini.template b/test/integration/cloud-config-scaleway.ini.template new file mode 100644 index 0000000000..f10419e013 --- /dev/null +++ b/test/integration/cloud-config-scaleway.ini.template @@ -0,0 +1,13 @@ +# This is the configuration template for ansible-test Scaleway integration tests. +# +# You do not need this template if you are: +# +# 1) Running integration tests without using ansible-test. +# +# If you want to test against the Vultr public API, +# fill in the values below and save this file without the .template extension. +# This will cause ansible-test to use the given configuration. + +[default] +key = @KEY +org = @ORG diff --git a/test/integration/targets/scaleway_compute/aliases b/test/integration/targets/scaleway_compute/aliases new file mode 100644 index 0000000000..f24a42a8e5 --- /dev/null +++ b/test/integration/targets/scaleway_compute/aliases @@ -0,0 +1,2 @@ +cloud/scaleway +unsupported diff --git a/test/legacy/roles/scaleway_compute/defaults/main.yml b/test/integration/targets/scaleway_compute/defaults/main.yml similarity index 100% rename from test/legacy/roles/scaleway_compute/defaults/main.yml rename to test/integration/targets/scaleway_compute/defaults/main.yml diff --git a/test/legacy/roles/scaleway_compute/tasks/ip.yml b/test/integration/targets/scaleway_compute/tasks/ip.yml similarity index 100% rename from test/legacy/roles/scaleway_compute/tasks/ip.yml rename to test/integration/targets/scaleway_compute/tasks/ip.yml diff --git a/test/legacy/roles/scaleway_compute/tasks/main.yml b/test/integration/targets/scaleway_compute/tasks/main.yml similarity index 100% rename from test/legacy/roles/scaleway_compute/tasks/main.yml rename to test/integration/targets/scaleway_compute/tasks/main.yml diff --git a/test/legacy/roles/scaleway_compute/tasks/pagination.yml b/test/integration/targets/scaleway_compute/tasks/pagination.yml similarity index 100% rename from test/legacy/roles/scaleway_compute/tasks/pagination.yml rename to test/integration/targets/scaleway_compute/tasks/pagination.yml diff --git a/test/legacy/roles/scaleway_compute/tasks/security_group.yml b/test/integration/targets/scaleway_compute/tasks/security_group.yml similarity index 100% rename from test/legacy/roles/scaleway_compute/tasks/security_group.yml rename to test/integration/targets/scaleway_compute/tasks/security_group.yml diff --git a/test/legacy/roles/scaleway_compute/tasks/state.yml b/test/integration/targets/scaleway_compute/tasks/state.yml similarity index 100% rename from test/legacy/roles/scaleway_compute/tasks/state.yml rename to test/integration/targets/scaleway_compute/tasks/state.yml diff --git a/test/integration/targets/scaleway_image_facts/aliases b/test/integration/targets/scaleway_image_facts/aliases new file mode 100644 index 0000000000..f24a42a8e5 --- /dev/null +++ b/test/integration/targets/scaleway_image_facts/aliases @@ -0,0 +1,2 @@ +cloud/scaleway +unsupported diff --git a/test/legacy/roles/scaleway_image_facts/tasks/main.yml b/test/integration/targets/scaleway_image_facts/tasks/main.yml similarity index 100% rename from test/legacy/roles/scaleway_image_facts/tasks/main.yml rename to test/integration/targets/scaleway_image_facts/tasks/main.yml diff --git a/test/integration/targets/scaleway_ip/aliases b/test/integration/targets/scaleway_ip/aliases new file mode 100644 index 0000000000..f24a42a8e5 --- /dev/null +++ b/test/integration/targets/scaleway_ip/aliases @@ -0,0 +1,2 @@ +cloud/scaleway +unsupported diff --git a/test/legacy/roles/scaleway_ip/defaults/main.yml b/test/integration/targets/scaleway_ip/defaults/main.yml similarity index 100% rename from test/legacy/roles/scaleway_ip/defaults/main.yml rename to test/integration/targets/scaleway_ip/defaults/main.yml diff --git a/test/legacy/roles/scaleway_ip/tasks/main.yml b/test/integration/targets/scaleway_ip/tasks/main.yml similarity index 100% rename from test/legacy/roles/scaleway_ip/tasks/main.yml rename to test/integration/targets/scaleway_ip/tasks/main.yml diff --git a/test/integration/targets/scaleway_ip_facts/aliases b/test/integration/targets/scaleway_ip_facts/aliases new file mode 100644 index 0000000000..f24a42a8e5 --- /dev/null +++ b/test/integration/targets/scaleway_ip_facts/aliases @@ -0,0 +1,2 @@ +cloud/scaleway +unsupported diff --git a/test/legacy/roles/scaleway_ip_facts/tasks/main.yml b/test/integration/targets/scaleway_ip_facts/tasks/main.yml similarity index 100% rename from test/legacy/roles/scaleway_ip_facts/tasks/main.yml rename to test/integration/targets/scaleway_ip_facts/tasks/main.yml diff --git a/test/integration/targets/scaleway_lb/aliases b/test/integration/targets/scaleway_lb/aliases new file mode 100644 index 0000000000..f24a42a8e5 --- /dev/null +++ b/test/integration/targets/scaleway_lb/aliases @@ -0,0 +1,2 @@ +cloud/scaleway +unsupported diff --git a/test/legacy/roles/scaleway_lb/defaults/main.yml b/test/integration/targets/scaleway_lb/defaults/main.yml similarity index 100% rename from test/legacy/roles/scaleway_lb/defaults/main.yml rename to test/integration/targets/scaleway_lb/defaults/main.yml diff --git a/test/legacy/roles/scaleway_lb/tasks/main.yml b/test/integration/targets/scaleway_lb/tasks/main.yml similarity index 100% rename from test/legacy/roles/scaleway_lb/tasks/main.yml rename to test/integration/targets/scaleway_lb/tasks/main.yml diff --git a/test/integration/targets/scaleway_organization_facts/aliases b/test/integration/targets/scaleway_organization_facts/aliases new file mode 100644 index 0000000000..f24a42a8e5 --- /dev/null +++ b/test/integration/targets/scaleway_organization_facts/aliases @@ -0,0 +1,2 @@ +cloud/scaleway +unsupported diff --git a/test/legacy/roles/scaleway_organization_facts/tasks/main.yml b/test/integration/targets/scaleway_organization_facts/tasks/main.yml similarity index 100% rename from test/legacy/roles/scaleway_organization_facts/tasks/main.yml rename to test/integration/targets/scaleway_organization_facts/tasks/main.yml diff --git a/test/integration/targets/scaleway_s3/aliases b/test/integration/targets/scaleway_s3/aliases new file mode 100644 index 0000000000..f24a42a8e5 --- /dev/null +++ b/test/integration/targets/scaleway_s3/aliases @@ -0,0 +1,2 @@ +cloud/scaleway +unsupported diff --git a/test/legacy/roles/scaleway_s3/defaults/main.yml b/test/integration/targets/scaleway_s3/defaults/main.yml similarity index 100% rename from test/legacy/roles/scaleway_s3/defaults/main.yml rename to test/integration/targets/scaleway_s3/defaults/main.yml diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3.yml b/test/integration/targets/scaleway_s3/tasks/aws_s3.yml similarity index 100% rename from test/legacy/roles/scaleway_s3/tasks/aws_s3.yml rename to test/integration/targets/scaleway_s3/tasks/aws_s3.yml diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3_create.yml b/test/integration/targets/scaleway_s3/tasks/aws_s3_create.yml similarity index 100% rename from test/legacy/roles/scaleway_s3/tasks/aws_s3_create.yml rename to test/integration/targets/scaleway_s3/tasks/aws_s3_create.yml diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3_delete.yml b/test/integration/targets/scaleway_s3/tasks/aws_s3_delete.yml similarity index 100% rename from test/legacy/roles/scaleway_s3/tasks/aws_s3_delete.yml rename to test/integration/targets/scaleway_s3/tasks/aws_s3_delete.yml diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3_delobj.yml b/test/integration/targets/scaleway_s3/tasks/aws_s3_delobj.yml similarity index 100% rename from test/legacy/roles/scaleway_s3/tasks/aws_s3_delobj.yml rename to test/integration/targets/scaleway_s3/tasks/aws_s3_delobj.yml diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3_get.yml b/test/integration/targets/scaleway_s3/tasks/aws_s3_get.yml similarity index 100% rename from test/legacy/roles/scaleway_s3/tasks/aws_s3_get.yml rename to test/integration/targets/scaleway_s3/tasks/aws_s3_get.yml diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3_getstr.yml b/test/integration/targets/scaleway_s3/tasks/aws_s3_getstr.yml similarity index 100% rename from test/legacy/roles/scaleway_s3/tasks/aws_s3_getstr.yml rename to test/integration/targets/scaleway_s3/tasks/aws_s3_getstr.yml diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3_geturl.yml b/test/integration/targets/scaleway_s3/tasks/aws_s3_geturl.yml similarity index 100% rename from test/legacy/roles/scaleway_s3/tasks/aws_s3_geturl.yml rename to test/integration/targets/scaleway_s3/tasks/aws_s3_geturl.yml diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3_list.yml b/test/integration/targets/scaleway_s3/tasks/aws_s3_list.yml similarity index 100% rename from test/legacy/roles/scaleway_s3/tasks/aws_s3_list.yml rename to test/integration/targets/scaleway_s3/tasks/aws_s3_list.yml diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3_put.yml b/test/integration/targets/scaleway_s3/tasks/aws_s3_put.yml similarity index 100% rename from test/legacy/roles/scaleway_s3/tasks/aws_s3_put.yml rename to test/integration/targets/scaleway_s3/tasks/aws_s3_put.yml diff --git a/test/legacy/roles/scaleway_s3/tasks/main.yml b/test/integration/targets/scaleway_s3/tasks/main.yml similarity index 100% rename from test/legacy/roles/scaleway_s3/tasks/main.yml rename to test/integration/targets/scaleway_s3/tasks/main.yml diff --git a/test/legacy/roles/scaleway_s3/tasks/s3_bucket.yml b/test/integration/targets/scaleway_s3/tasks/s3_bucket.yml similarity index 100% rename from test/legacy/roles/scaleway_s3/tasks/s3_bucket.yml rename to test/integration/targets/scaleway_s3/tasks/s3_bucket.yml diff --git a/test/integration/targets/scaleway_security_group/aliases b/test/integration/targets/scaleway_security_group/aliases new file mode 100644 index 0000000000..f24a42a8e5 --- /dev/null +++ b/test/integration/targets/scaleway_security_group/aliases @@ -0,0 +1,2 @@ +cloud/scaleway +unsupported diff --git a/test/legacy/roles/scaleway_security_group/defaults/main.yml b/test/integration/targets/scaleway_security_group/defaults/main.yml similarity index 100% rename from test/legacy/roles/scaleway_security_group/defaults/main.yml rename to test/integration/targets/scaleway_security_group/defaults/main.yml diff --git a/test/legacy/roles/scaleway_security_group/tasks/main.yml b/test/integration/targets/scaleway_security_group/tasks/main.yml similarity index 100% rename from test/legacy/roles/scaleway_security_group/tasks/main.yml rename to test/integration/targets/scaleway_security_group/tasks/main.yml diff --git a/test/integration/targets/scaleway_security_group_facts/aliases b/test/integration/targets/scaleway_security_group_facts/aliases new file mode 100644 index 0000000000..f24a42a8e5 --- /dev/null +++ b/test/integration/targets/scaleway_security_group_facts/aliases @@ -0,0 +1,2 @@ +cloud/scaleway +unsupported diff --git a/test/legacy/roles/scaleway_security_group_facts/tasks/main.yml b/test/integration/targets/scaleway_security_group_facts/tasks/main.yml similarity index 100% rename from test/legacy/roles/scaleway_security_group_facts/tasks/main.yml rename to test/integration/targets/scaleway_security_group_facts/tasks/main.yml diff --git a/test/integration/targets/scaleway_security_group_rule/aliases b/test/integration/targets/scaleway_security_group_rule/aliases new file mode 100644 index 0000000000..f24a42a8e5 --- /dev/null +++ b/test/integration/targets/scaleway_security_group_rule/aliases @@ -0,0 +1,2 @@ +cloud/scaleway +unsupported diff --git a/test/legacy/roles/scaleway_security_group_rule/defaults/main.yml b/test/integration/targets/scaleway_security_group_rule/defaults/main.yml similarity index 100% rename from test/legacy/roles/scaleway_security_group_rule/defaults/main.yml rename to test/integration/targets/scaleway_security_group_rule/defaults/main.yml diff --git a/test/legacy/roles/scaleway_security_group_rule/tasks/main.yml b/test/integration/targets/scaleway_security_group_rule/tasks/main.yml similarity index 100% rename from test/legacy/roles/scaleway_security_group_rule/tasks/main.yml rename to test/integration/targets/scaleway_security_group_rule/tasks/main.yml diff --git a/test/integration/targets/scaleway_server_facts/aliases b/test/integration/targets/scaleway_server_facts/aliases new file mode 100644 index 0000000000..f24a42a8e5 --- /dev/null +++ b/test/integration/targets/scaleway_server_facts/aliases @@ -0,0 +1,2 @@ +cloud/scaleway +unsupported diff --git a/test/legacy/roles/scaleway_server_facts/tasks/main.yml b/test/integration/targets/scaleway_server_facts/tasks/main.yml similarity index 100% rename from test/legacy/roles/scaleway_server_facts/tasks/main.yml rename to test/integration/targets/scaleway_server_facts/tasks/main.yml diff --git a/test/integration/targets/scaleway_snapshot_facts/aliases b/test/integration/targets/scaleway_snapshot_facts/aliases new file mode 100644 index 0000000000..f24a42a8e5 --- /dev/null +++ b/test/integration/targets/scaleway_snapshot_facts/aliases @@ -0,0 +1,2 @@ +cloud/scaleway +unsupported diff --git a/test/legacy/roles/scaleway_snapshot_facts/tasks/main.yml b/test/integration/targets/scaleway_snapshot_facts/tasks/main.yml similarity index 100% rename from test/legacy/roles/scaleway_snapshot_facts/tasks/main.yml rename to test/integration/targets/scaleway_snapshot_facts/tasks/main.yml diff --git a/test/integration/targets/scaleway_ssh/aliases b/test/integration/targets/scaleway_ssh/aliases new file mode 100644 index 0000000000..f24a42a8e5 --- /dev/null +++ b/test/integration/targets/scaleway_ssh/aliases @@ -0,0 +1,2 @@ +cloud/scaleway +unsupported diff --git a/test/legacy/roles/scaleway_ssh/tasks/main.yml b/test/integration/targets/scaleway_ssh/tasks/main.yml similarity index 100% rename from test/legacy/roles/scaleway_ssh/tasks/main.yml rename to test/integration/targets/scaleway_ssh/tasks/main.yml diff --git a/test/integration/targets/scaleway_user_data/aliases b/test/integration/targets/scaleway_user_data/aliases new file mode 100644 index 0000000000..f24a42a8e5 --- /dev/null +++ b/test/integration/targets/scaleway_user_data/aliases @@ -0,0 +1,2 @@ +cloud/scaleway +unsupported diff --git a/test/legacy/roles/scaleway_user_data/defaults/main.yml b/test/integration/targets/scaleway_user_data/defaults/main.yml similarity index 100% rename from test/legacy/roles/scaleway_user_data/defaults/main.yml rename to test/integration/targets/scaleway_user_data/defaults/main.yml diff --git a/test/legacy/roles/scaleway_user_data/tasks/main.yml b/test/integration/targets/scaleway_user_data/tasks/main.yml similarity index 100% rename from test/legacy/roles/scaleway_user_data/tasks/main.yml rename to test/integration/targets/scaleway_user_data/tasks/main.yml diff --git a/test/integration/targets/scaleway_volume/aliases b/test/integration/targets/scaleway_volume/aliases new file mode 100644 index 0000000000..f24a42a8e5 --- /dev/null +++ b/test/integration/targets/scaleway_volume/aliases @@ -0,0 +1,2 @@ +cloud/scaleway +unsupported diff --git a/test/legacy/roles/scaleway_volume/defaults/main.yml b/test/integration/targets/scaleway_volume/defaults/main.yml similarity index 100% rename from test/legacy/roles/scaleway_volume/defaults/main.yml rename to test/integration/targets/scaleway_volume/defaults/main.yml diff --git a/test/legacy/roles/scaleway_volume/tasks/main.yml b/test/integration/targets/scaleway_volume/tasks/main.yml similarity index 100% rename from test/legacy/roles/scaleway_volume/tasks/main.yml rename to test/integration/targets/scaleway_volume/tasks/main.yml diff --git a/test/integration/targets/scaleway_volume_facts/aliases b/test/integration/targets/scaleway_volume_facts/aliases new file mode 100644 index 0000000000..f24a42a8e5 --- /dev/null +++ b/test/integration/targets/scaleway_volume_facts/aliases @@ -0,0 +1,2 @@ +cloud/scaleway +unsupported diff --git a/test/legacy/roles/scaleway_volume_facts/tasks/main.yml b/test/integration/targets/scaleway_volume_facts/tasks/main.yml similarity index 100% rename from test/legacy/roles/scaleway_volume_facts/tasks/main.yml rename to test/integration/targets/scaleway_volume_facts/tasks/main.yml diff --git a/test/legacy/scaleway.yml b/test/legacy/scaleway.yml deleted file mode 100644 index f65a059048..0000000000 --- a/test/legacy/scaleway.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -- hosts: localhost - gather_facts: no - connection: local - vars: - scw_org: "{{ lookup('env', 'SCW_ORG') }}" - - roles: - - { role: scaleway_compute, tags: test_scaleway_compute } - - { role: scaleway_image_facts, tags: test_scaleway_image_facts } - - { role: scaleway_ip, tags: test_scaleway_ip } - - { role: scaleway_ip_facts, tags: test_scaleway_ip_facts } - - { role: scaleway_lb, tags: test_scaleway_lb } - - { role: scaleway_organization_facts, tags: test_scaleway_organization_facts } - - { role: scaleway_s3, tags: test_scaleway_s3 } - - { role: scaleway_security_group_facts, tags: test_scaleway_security_group_facts } - - { role: scaleway_server_facts, tags: test_scaleway_server_facts } - - { role: scaleway_snapshot_facts, tags: test_scaleway_snapshot_facts } - - { role: scaleway_ssh, tags: test_scaleway_ssh } - - { role: scaleway_user_data, tags: test_scaleway_user_data } - - { role: scaleway_volume, tags: test_scaleway_volume } - - { role: scaleway_volume_facts, tags: test_scaleway_volume_facts } - - { role: scaleway_security_group, tags: test_scaleway_security_group } - - { role: scaleway_security_group_rule, tags: test_scaleway_security_group_rule } diff --git a/test/runner/lib/cloud/scaleway.py b/test/runner/lib/cloud/scaleway.py new file mode 100644 index 0000000000..fb9240823d --- /dev/null +++ b/test/runner/lib/cloud/scaleway.py @@ -0,0 +1,66 @@ +"""Scaleway plugin for integration tests.""" +from __future__ import absolute_import, print_function + +import os + +from lib.cloud import ( + CloudProvider, + CloudEnvironment, + CloudEnvironmentConfig, +) + +from lib.util import ConfigParser + + +class ScalewayCloudProvider(CloudProvider): + """Checks if a configuration file has been passed or fixtures are going to be used for testing""" + + def __init__(self, args): + """ + :type args: TestConfig + """ + super(ScalewayCloudProvider, self).__init__(args) + + def filter(self, targets, exclude): + """Filter out the cloud tests when the necessary config and resources are not available. + :type targets: tuple[TestTarget] + :type exclude: list[str] + """ + if os.path.isfile(self.config_static_path): + return + + super(ScalewayCloudProvider, self).filter(targets, exclude) + + def setup(self): + """Setup the cloud resource before delegation and register a cleanup callback.""" + super(ScalewayCloudProvider, self).setup() + + if os.path.isfile(self.config_static_path): + self.config_path = self.config_static_path + self.managed = False + + +class ScalewayCloudEnvironment(CloudEnvironment): + """ + Updates integration test environment after delegation. Will setup the config file as parameter. + """ + def get_environment_config(self): + """ + :rtype: CloudEnvironmentConfig + """ + parser = ConfigParser() + parser.read(self.config_path) + + env_vars = dict( + SCW_API_KEY=parser.get('default', 'key'), + SCW_ORG=parser.get('default', 'org') + ) + + ansible_vars = dict( + scw_org=parser.get('default', 'org'), + ) + + return CloudEnvironmentConfig( + env_vars=env_vars, + ansible_vars=ansible_vars, + )