Skip to content
Merged
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
6 changes: 6 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ exclude_paths:
- changelogs/
- .github/

mock_roles:
- ensure-docker
- ensure-pip
- ensure-podman
- ensure-output-dirs

skip_list:
- var-naming[no-role-prefix]

Expand Down
3 changes: 3 additions & 0 deletions lint-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ansible
ansible-lint<26
antsibull-changelog
11 changes: 11 additions & 0 deletions tests/playbooks/post.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: Prepare logs
hosts: all
vars:
zuul_output_dir: "{{ ansible_user_dir }}/zuul-output"
tasks:
- name: Print all facts
copy:
content: "{{ hostvars[inventory_hostname] | to_nice_json }}"
dest: "{{ zuul_output_dir }}/facts.json"
mode: "0600"
13 changes: 13 additions & 0 deletions tests/playbooks/pre.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
- name: Prepare environment
hosts: all
any_errors_fatal: true
vars:
logs_dir: "/tmp/logs"
roles:
- ensure-output-dirs
- ensure-pip
- role: "ensure-docker"
when: cephadm_container_engine == "docker"
- role: "ensure-podman"
when: cephadm_container_engine == "podman"
18 changes: 18 additions & 0 deletions tests/playbooks/run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
- name: Install catatonit package for Podman
hosts: all
any_errors_fatal: true
tasks:
- name: Install catatonit package for Podman
package:
name: catatonit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who requires this?

state: present
become: true

- name: Run tests
hosts: all
any_errors_fatal: true
roles:
- role: cephadm
vars:
cephadm_public_interface: "{{ ansible_default_ipv4.interface }}"
31 changes: 31 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[tox]
minversion = 3.18
envlist = py3,linters
ignore_basepython_conflict = True
skipsdist = True

[testenv]
basepython = python3
usedevelop = True
allowlist_externals = bash
find
rm
deps = -r{toxinidir}/test-requirements.txt
passenv = http_proxy,HTTP_PROXY,https_proxy,HTTPS_PROXY,no_proxy,NO_PROXY, \
OS_STDOUT_CAPTURE,OS_STDERR_CAPTURE,OS_LOG_CAPTURE,OS_TEST_TIMEOUT, \
PYTHON,OS_TEST_PATH,LISTOPT,IDOPTION

[testenv:linters]
deps =
-r{toxinidir}/lint-requirements.txt
allowlist_externals = bash
find
commands =
{[testenv:ansible-lint]commands}

[testenv:ansible-lint]
setenv = {[testenv:linters]setenv}
deps = {[testenv:linters]deps}
commands =
ansible-lint -p --exclude zuul.d
antsibull-changelog lint
9 changes: 9 additions & 0 deletions zuul.d/base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- job:
parent: base
name: cephadm-base
pre-run: tests/playbooks/pre.yml
run: tests/playbooks/run.yml
post-run: tests/playbooks/post.yml
timeout: 7200
post-timeout: 1800
16 changes: 16 additions & 0 deletions zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- job:
name: cephadm-jammy-singlenode-docker-reef
parent: cephadm-base
nodeset: cephadm-jammy-single
vars:
cephadm_ceph_release: reef
cephadm_container_engine: docker

- job:
name: cephadm-jammy-singlenode-podman-reef
parent: cephadm-base
nodeset: cephadm-jammy-single
vars:
cephadm_ceph_release: reef
cephadm_container_engine: podman
19 changes: 19 additions & 0 deletions zuul.d/nodesets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- nodeset:
name: cephadm-jammy-single
nodes:
- name: primary
label: ubuntu-jammy
groups:
- name: ceph
nodes:
- primary
- name: mons
nodes:
- primary
- name: mgrs
nodes:
- primary
- name: osds
nodes:
- primary
11 changes: 11 additions & 0 deletions zuul.d/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- project:
check:
jobs:
- cephadm-jammy-singlenode-docker-reef
- cephadm-jammy-singlenode-podman-reef
- tox-linters
gate:
jobs:
- cephadm-jammy-singlenode-docker-reef
- cephadm-jammy-singlenode-podman-reef
Loading