Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use testing framework for server integration tests #206

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions tests/integration/targets/server/tasks/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,35 @@
hetzner.hcloud.ssh_key:
name: "{{ hcloud_ssh_key_name }}"
state: absent

- name: Cleanup test_network
hetzner.hcloud.network:
name: "{{ hcloud_network_name }}"
state: absent

- name: Cleanup test_primary_ipv4_1
hetzner.hcloud.primary_ip:
name: "{{ hcloud_primary_ip_name }}v4-1"
state: absent

- name: Cleanup test_primary_ipv4_2
hetzner.hcloud.primary_ip:
name: "{{ hcloud_primary_ip_name }}v4-2"
state: absent

- name: Cleanup test_primary_ipv6
hetzner.hcloud.primary_ip:
name: "{{ hcloud_primary_ip_name }}v6"
state: absent

- name: Cleanup test_firewall_1
hetzner.hcloud.firewall:
name: "{{ hcloud_firewall_name }}-1"
force: true
state: absent

- name: Cleanup test_firewall_2
hetzner.hcloud.firewall:
name: "{{ hcloud_firewall_name }}-2"
force: true
state: absent
59 changes: 59 additions & 0 deletions tests/integration/targets/server/tasks/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,62 @@
name: "{{ hcloud_ssh_key_name }}"
public_key: "{{ test_ssh_keypair.public_key }}"
register: test_ssh_key

- name: Create test_network
hetzner.hcloud.network:
name: "{{ hcloud_network_name }}"
ip_range: 10.0.0.0/16
labels:
key: value
register: test_network

- name: Create test_subnetwork
hetzner.hcloud.subnetwork:
network: "{{ hcloud_network_name }}"
type: server
network_zone: eu-central
ip_range: 10.0.1.0/24
register: test_subnetwork

- name: Create test_primary_ipv4_1
hetzner.hcloud.primary_ip:
name: "{{ hcloud_primary_ip_name }}v4-1"
type: ipv4
datacenter: fsn1-dc14
register: test_primary_ipv4_1

- name: Create test_primary_ipv4_2
hetzner.hcloud.primary_ip:
name: "{{ hcloud_primary_ip_name }}v4-2"
type: ipv4
datacenter: fsn1-dc14
register: test_primary_ipv4_2

- name: Create test_primary_ipv6
hetzner.hcloud.primary_ip:
name: "{{ hcloud_primary_ip_name }}v6"
type: ipv6
datacenter: fsn1-dc14
register: test_primary_ipv6

- name: Create test_firewall_1
hetzner.hcloud.firewall:
name: "{{ hcloud_firewall_name }}-1"
rules:
- direction: in
protocol: icmp
source_ips:
- 0.0.0.0/0
- ::/0
register: test_firewall_1

- name: Create test_firewall_2
hetzner.hcloud.firewall:
name: "{{ hcloud_firewall_name }}-2"
rules:
- direction: in
protocol: icmp
source_ips:
- 0.0.0.0/0
- ::/0
register: test_firewall_2
4 changes: 2 additions & 2 deletions tests/integration/targets/server/tasks/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright: (c) 2022, Hetzner Cloud GmbH <[email protected]>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
---
#- ansible.builtin.include_tasks: test_validation.yml
- ansible.builtin.include_tasks: test_validation.yml
- ansible.builtin.include_tasks: test_basic.yml
#- ansible.builtin.include_tasks: test_firewalls.yml
- ansible.builtin.include_tasks: test_firewalls.yml
- ansible.builtin.include_tasks: test_primary_ips.yml
- ansible.builtin.include_tasks: test_private_network_only.yml
Loading