From c6d7121e9e7586e5ee47f599dfc3a2d31eaed1dd Mon Sep 17 00:00:00 2001 From: "Jonas L." Date: Tue, 6 Aug 2024 11:59:31 +0200 Subject: [PATCH] test: ensure location is used for tests (#541) ##### SUMMARY Make sure that the tests uses the `hcloud_location_name` variable for the tests. --- tests/integration/targets/firewall/tasks/prepare.yml | 1 + tests/integration/targets/firewall_info/tasks/prepare.yml | 1 + .../integration/targets/firewall_resource/tasks/prepare.yml | 1 + tests/integration/targets/floating_ip/tasks/test.yml | 3 ++- tests/integration/targets/image_info/tasks/prepare.yml | 1 + .../integration/targets/load_balancer_info/tasks/prepare.yml | 1 + .../integration/targets/load_balancer_target/tasks/test.yml | 2 +- tests/integration/targets/primary_ip/tasks/prepare.yml | 1 + tests/integration/targets/rdns/tasks/prepare.yml | 1 + tests/integration/targets/server/tasks/test_basic.yml | 5 +++++ tests/integration/targets/server_info/tasks/prepare.yml | 2 ++ tests/integration/targets/server_network/tasks/prepare.yml | 1 + tests/integration/targets/ssh_key/tasks/test.yml | 1 + 13 files changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/integration/targets/firewall/tasks/prepare.yml b/tests/integration/targets/firewall/tasks/prepare.yml index f959f7e..1da3c17 100644 --- a/tests/integration/targets/firewall/tasks/prepare.yml +++ b/tests/integration/targets/firewall/tasks/prepare.yml @@ -4,5 +4,6 @@ name: "{{ hcloud_server_name }}" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" state: stopped register: test_server diff --git a/tests/integration/targets/firewall_info/tasks/prepare.yml b/tests/integration/targets/firewall_info/tasks/prepare.yml index 4337a73..45875b6 100644 --- a/tests/integration/targets/firewall_info/tasks/prepare.yml +++ b/tests/integration/targets/firewall_info/tasks/prepare.yml @@ -4,6 +4,7 @@ name: "{{ hcloud_server_name }}" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" labels: firewall: "{{ hcloud_firewall_name }}" state: stopped diff --git a/tests/integration/targets/firewall_resource/tasks/prepare.yml b/tests/integration/targets/firewall_resource/tasks/prepare.yml index 3a9239a..3e9e95f 100644 --- a/tests/integration/targets/firewall_resource/tasks/prepare.yml +++ b/tests/integration/targets/firewall_resource/tasks/prepare.yml @@ -4,6 +4,7 @@ name: "{{ hcloud_server_name }}" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" labels: key: value state: stopped diff --git a/tests/integration/targets/floating_ip/tasks/test.yml b/tests/integration/targets/floating_ip/tasks/test.yml index 025256e..e5f99fd 100644 --- a/tests/integration/targets/floating_ip/tasks/test.yml +++ b/tests/integration/targets/floating_ip/tasks/test.yml @@ -21,8 +21,8 @@ name: "{{ hcloud_server_name }}" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" - state: stopped location: "{{ hcloud_location_name }}" + state: stopped register: main_server - name: verify setup server assert: @@ -34,6 +34,7 @@ name: "{{ hcloud_server_name }}2" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" state: stopped register: main_server2 - name: verify setup another server diff --git a/tests/integration/targets/image_info/tasks/prepare.yml b/tests/integration/targets/image_info/tasks/prepare.yml index 4e72989..8e1b9b6 100644 --- a/tests/integration/targets/image_info/tasks/prepare.yml +++ b/tests/integration/targets/image_info/tasks/prepare.yml @@ -4,6 +4,7 @@ name: "{{ hcloud_server_name }}" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" state: stopped register: test_server diff --git a/tests/integration/targets/load_balancer_info/tasks/prepare.yml b/tests/integration/targets/load_balancer_info/tasks/prepare.yml index 9af5c46..881cf07 100644 --- a/tests/integration/targets/load_balancer_info/tasks/prepare.yml +++ b/tests/integration/targets/load_balancer_info/tasks/prepare.yml @@ -4,6 +4,7 @@ name: "{{ hcloud_server_name }}" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" state: stopped register: test_server diff --git a/tests/integration/targets/load_balancer_target/tasks/test.yml b/tests/integration/targets/load_balancer_target/tasks/test.yml index 00ad191..59bef62 100644 --- a/tests/integration/targets/load_balancer_target/tasks/test.yml +++ b/tests/integration/targets/load_balancer_target/tasks/test.yml @@ -6,8 +6,8 @@ name: "{{hcloud_server_name}}" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" - state: stopped location: "{{ hcloud_location_name }}" + state: stopped register: server - name: verify setup server assert: diff --git a/tests/integration/targets/primary_ip/tasks/prepare.yml b/tests/integration/targets/primary_ip/tasks/prepare.yml index 36ddfc1..b3ca4d8 100644 --- a/tests/integration/targets/primary_ip/tasks/prepare.yml +++ b/tests/integration/targets/primary_ip/tasks/prepare.yml @@ -4,6 +4,7 @@ name: "{{ hcloud_server_name }}" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" state: stopped enable_ipv4: false enable_ipv6: false diff --git a/tests/integration/targets/rdns/tasks/prepare.yml b/tests/integration/targets/rdns/tasks/prepare.yml index 8d4b703..dbfd6f6 100644 --- a/tests/integration/targets/rdns/tasks/prepare.yml +++ b/tests/integration/targets/rdns/tasks/prepare.yml @@ -4,6 +4,7 @@ name: "{{ hcloud_server_name }}" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" state: present register: test_server diff --git a/tests/integration/targets/server/tasks/test_basic.yml b/tests/integration/targets/server/tasks/test_basic.yml index aa29318..0cc90a0 100644 --- a/tests/integration/targets/server/tasks/test_basic.yml +++ b/tests/integration/targets/server/tasks/test_basic.yml @@ -3,6 +3,7 @@ name: "{{ hcloud_server_name }}" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" state: present register: result check_mode: true @@ -16,6 +17,7 @@ name: "{{ hcloud_server_name}}" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" enable_ipv6: False state: started register: main_server @@ -441,6 +443,7 @@ name: "{{ hcloud_server_name}}" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" ssh_keys: - "{{ hcloud_ssh_key_name }}" rescue_mode: "linux64" @@ -470,6 +473,7 @@ name: "{{ hcloud_server_name}}" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" ssh_keys: - "{{ hcloud_ssh_key_name }}" labels: @@ -563,6 +567,7 @@ rebuild_protection: true server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" ssh_keys: - "{{ hcloud_ssh_key_name }}" state: present diff --git a/tests/integration/targets/server_info/tasks/prepare.yml b/tests/integration/targets/server_info/tasks/prepare.yml index 4c1f395..d9c8197 100644 --- a/tests/integration/targets/server_info/tasks/prepare.yml +++ b/tests/integration/targets/server_info/tasks/prepare.yml @@ -4,6 +4,7 @@ name: "{{ hcloud_server_name }}" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" state: stopped labels: key: value @@ -14,6 +15,7 @@ name: "{{ hcloud_server_name }}2" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" state: stopped labels: key: value diff --git a/tests/integration/targets/server_network/tasks/prepare.yml b/tests/integration/targets/server_network/tasks/prepare.yml index aaadd1c..82b8919 100644 --- a/tests/integration/targets/server_network/tasks/prepare.yml +++ b/tests/integration/targets/server_network/tasks/prepare.yml @@ -20,5 +20,6 @@ name: "{{ hcloud_server_name }}" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" state: stopped register: test_server diff --git a/tests/integration/targets/ssh_key/tasks/test.yml b/tests/integration/targets/ssh_key/tasks/test.yml index 54bdc79..bdde78d 100644 --- a/tests/integration/targets/ssh_key/tasks/test.yml +++ b/tests/integration/targets/ssh_key/tasks/test.yml @@ -114,6 +114,7 @@ name: "{{ hcloud_server_name }}" server_type: "{{ hcloud_server_type_name }}" image: "{{ hcloud_image_name }}" + location: "{{ hcloud_location_name }}" ssh_keys: - "{{ hcloud_ssh_key_name }}" state: started