Skip to content

Commit

Permalink
increase tests suites number
Browse files Browse the repository at this point in the history
  • Loading branch information
andreygubarev committed Jun 16, 2023
1 parent 5119716 commit a46fe5c
Show file tree
Hide file tree
Showing 11 changed files with 158 additions and 26 deletions.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,17 @@ lint: virtualenv ## Lint
.PHONY: test
test: virtualenv ## Test
$(VIRTUALENV_PIP) install -e .
cd tests && $(VIRTUALENV_MOLECULE) test
cd tests && $(VIRTUALENV_MOLECULE) test -s default

.PHONY: test-all
test-all: virtualenv ## Test
$(VIRTUALENV_PIP) install -e .
cd tests && \
$(VIRTUALENV_MOLECULE) destroy || true && \
$(VIRTUALENV_MOLECULE) reset && \
$(VIRTUALENV_MOLECULE) test -s default && \
$(VIRTUALENV_MOLECULE) test -s user && \
$(VIRTUALENV_MOLECULE) test -s vmnet-shared

.PHONY: clean
clean: ## Remove cache
Expand Down
33 changes: 33 additions & 0 deletions tests/.yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
# Based on ansible-lint config
extends: default

rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
colons:
max-spaces-after: -1
level: error
commas:
max-spaces-after: -1
level: error
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
max: 3
level: error
hyphens:
level: error
indentation: disable
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable
truthy: disable
25 changes: 0 additions & 25 deletions tests/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,6 @@ platforms:
image_checksum: sha512:https://cloud.debian.org/images/cloud/bullseye/latest/SHA512SUMS
image_arch: aarch64
ssh_port: 10000
- name: debian-bullseye-amd64
image: https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.qcow2
image_checksum: sha512:https://cloud.debian.org/images/cloud/bullseye/latest/SHA512SUMS
image_arch: x86_64
ssh_port: 10001
- name: ubuntu-focal-arm64
image: https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-arm64.img
image_checksum: sha256:https://cloud-images.ubuntu.com/focal/current/SHA256SUMS
image_arch: aarch64
ssh_port: 10002
- name: ubuntu-focal-amd64
image: https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img
image_checksum: sha256:https://cloud-images.ubuntu.com/focal/current/SHA256SUMS
image_arch: x86_64
ssh_port: 10003
- name: ubuntu-jammy-arm64
image: https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-arm64.img
image_checksum: sha256:https://cloud-images.ubuntu.com/jammy/current/SHA256SUMS
image_arch: aarch64
ssh_port: 10004
- name: ubuntu-jammy-amd64
image: https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
image_checksum: sha256:https://cloud-images.ubuntu.com/jammy/current/SHA256SUMS
image_arch: x86_64
ssh_port: 10005
provisioner:
name: ansible
verifier:
Expand Down
12 changes: 12 additions & 0 deletions tests/molecule/user/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
- name: Converge
hosts: all

environment:
http_proxy: "{{ lookup('ansible.builtin.env', 'http_proxy') | default(omit) }}"
https_proxy: "{{ lookup('ansible.builtin.env', 'https_proxy') | default(omit) }}"

tasks:
- name: "Include tests"
ansible.builtin.include_role:
name: "tests"
20 changes: 20 additions & 0 deletions tests/molecule/user/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
dependency:
name: galaxy
driver:
name: molecule-qemu
platforms:
- name: debian-bullseye-arm64
image: https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-arm64.qcow2
image_checksum: sha512:https://cloud.debian.org/images/cloud/bullseye/latest/SHA512SUMS
image_arch: aarch64
ssh_port: 10000
- name: debian-bullseye-amd64
image: https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.qcow2
image_checksum: sha512:https://cloud.debian.org/images/cloud/bullseye/latest/SHA512SUMS
image_arch: x86_64
ssh_port: 10001
provisioner:
name: ansible
verifier:
name: ansible
15 changes: 15 additions & 0 deletions tests/molecule/user/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- name: Prepare
hosts: all
become: true
gather_facts: false

environment:
http_proxy: "{{ lookup('ansible.builtin.env', 'http_proxy') | default(omit) }}"
https_proxy: "{{ lookup('ansible.builtin.env', 'https_proxy') | default(omit) }}"

tasks:
- name: Wait for SSH to become available
ansible.builtin.wait_for_connection:
delay: 5
timeout: 300
10 changes: 10 additions & 0 deletions tests/molecule/user/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# This is an example playbook to execute Ansible tests.

- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Example assertion
ansible.builtin.assert:
that: true
12 changes: 12 additions & 0 deletions tests/molecule/vmnet-shared/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
- name: Converge
hosts: all

environment:
http_proxy: "{{ lookup('ansible.builtin.env', 'http_proxy') | default(omit) }}"
https_proxy: "{{ lookup('ansible.builtin.env', 'https_proxy') | default(omit) }}"

tasks:
- name: "Include tests"
ansible.builtin.include_role:
name: "tests"
20 changes: 20 additions & 0 deletions tests/molecule/vmnet-shared/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
dependency:
name: galaxy
driver:
name: molecule-qemu
platforms:
- name: debian-bullseye-arm64
image: https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-arm64.qcow2
image_checksum: sha512:https://cloud.debian.org/images/cloud/bullseye/latest/SHA512SUMS
image_arch: aarch64
vm_network: vmnet-shared
- name: debian-bullseye-amd64
image: https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.qcow2
image_checksum: sha512:https://cloud.debian.org/images/cloud/bullseye/latest/SHA512SUMS
image_arch: x86_64
vm_network: vmnet-shared
provisioner:
name: ansible
verifier:
name: ansible
15 changes: 15 additions & 0 deletions tests/molecule/vmnet-shared/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- name: Prepare
hosts: all
become: true
gather_facts: false

environment:
http_proxy: "{{ lookup('ansible.builtin.env', 'http_proxy') | default(omit) }}"
https_proxy: "{{ lookup('ansible.builtin.env', 'https_proxy') | default(omit) }}"

tasks:
- name: Wait for SSH to become available
ansible.builtin.wait_for_connection:
delay: 5
timeout: 300
10 changes: 10 additions & 0 deletions tests/molecule/vmnet-shared/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# This is an example playbook to execute Ansible tests.

- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Example assertion
ansible.builtin.assert:
that: true

0 comments on commit a46fe5c

Please sign in to comment.