From 72aa06f1ea8ba258d82c7a86e61eb04898fb20cd Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sat, 18 Jan 2020 13:26:32 +0000 Subject: [PATCH] test: Add Debian 9 and 10 to molecule platforms --- meta/main.yml | 10 +++++++--- molecule/change-to-non-root-user/Dockerfile.j2 | 2 ++ molecule/change-to-non-root-user/molecule.yml | 18 ++++++++++++++++++ .../tests/test_default.py | 2 +- molecule/default/Dockerfile.j2 | 2 ++ molecule/default/molecule.yml | 18 ++++++++++++++++++ molecule/default/tests/test_default.py | 2 +- molecule/with-config/Dockerfile.j2 | 2 ++ molecule/with-config/molecule.yml | 18 ++++++++++++++++++ molecule/with-config/tests/test_default.py | 2 +- 10 files changed, 70 insertions(+), 6 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index 84d9637..2d98af4 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -6,14 +6,18 @@ galaxy_info: license: MIT min_ansible_version: 2.0 platforms: - - name: Ubuntu + - name: Debian versions: - - bionic - - xenial + - stretch + - buster - name: EL versions: - 7 - 8 + - name: Ubuntu + versions: + - bionic + - xenial galaxy_tags: - adblocking - adguard diff --git a/molecule/change-to-non-root-user/Dockerfile.j2 b/molecule/change-to-non-root-user/Dockerfile.j2 index 95e99c2..e60e4d2 100644 --- a/molecule/change-to-non-root-user/Dockerfile.j2 +++ b/molecule/change-to-non-root-user/Dockerfile.j2 @@ -39,3 +39,5 @@ RUN if [ $(command -v apt-get) ]; then \ xbps-install -y python sudo bash ca-certificates && \ xbps-remove -O; \ fi + +RUN if [ ! -e /sbin/init ]; then ln -s /lib/systemd/systemd /sbin/init; fi diff --git a/molecule/change-to-non-root-user/molecule.yml b/molecule/change-to-non-root-user/molecule.yml index 0d59f0b..0a4bc66 100644 --- a/molecule/change-to-non-root-user/molecule.yml +++ b/molecule/change-to-non-root-user/molecule.yml @@ -22,6 +22,24 @@ platforms: - /tmp volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro + - name: debian-9 + image: jrei/systemd-debian:9 + command: /sbin/init + privileged: true + tmpfs: + - /run + - /tmp + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + - name: debian-10 + image: jrei/systemd-debian:10 + command: /sbin/init + privileged: true + tmpfs: + - /run + - /tmp + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro - name: ubuntu-16.04 image: jrei/systemd-ubuntu:16.04 command: /sbin/init diff --git a/molecule/change-to-non-root-user/tests/test_default.py b/molecule/change-to-non-root-user/tests/test_default.py index a2603fa..ba89ba8 100644 --- a/molecule/change-to-non-root-user/tests/test_default.py +++ b/molecule/change-to-non-root-user/tests/test_default.py @@ -47,7 +47,7 @@ def test_adguardhome_binary(host): def test_adguardhome_service(host): - s = host.service('adguardhome') + s = host.service('adguardhome.service') assert s.is_enabled assert s.is_running diff --git a/molecule/default/Dockerfile.j2 b/molecule/default/Dockerfile.j2 index 95e99c2..e60e4d2 100644 --- a/molecule/default/Dockerfile.j2 +++ b/molecule/default/Dockerfile.j2 @@ -39,3 +39,5 @@ RUN if [ $(command -v apt-get) ]; then \ xbps-install -y python sudo bash ca-certificates && \ xbps-remove -O; \ fi + +RUN if [ ! -e /sbin/init ]; then ln -s /lib/systemd/systemd /sbin/init; fi diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 0d59f0b..0a4bc66 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -22,6 +22,24 @@ platforms: - /tmp volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro + - name: debian-9 + image: jrei/systemd-debian:9 + command: /sbin/init + privileged: true + tmpfs: + - /run + - /tmp + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + - name: debian-10 + image: jrei/systemd-debian:10 + command: /sbin/init + privileged: true + tmpfs: + - /run + - /tmp + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro - name: ubuntu-16.04 image: jrei/systemd-ubuntu:16.04 command: /sbin/init diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py index 00f2edb..c5b775d 100644 --- a/molecule/default/tests/test_default.py +++ b/molecule/default/tests/test_default.py @@ -37,7 +37,7 @@ def test_adguardhome_binary(host): def test_adguardhome_service(host): - s = host.service('adguardhome') + s = host.service('adguardhome.service') assert s.is_enabled assert s.is_running diff --git a/molecule/with-config/Dockerfile.j2 b/molecule/with-config/Dockerfile.j2 index 95e99c2..e60e4d2 100644 --- a/molecule/with-config/Dockerfile.j2 +++ b/molecule/with-config/Dockerfile.j2 @@ -39,3 +39,5 @@ RUN if [ $(command -v apt-get) ]; then \ xbps-install -y python sudo bash ca-certificates && \ xbps-remove -O; \ fi + +RUN if [ ! -e /sbin/init ]; then ln -s /lib/systemd/systemd /sbin/init; fi diff --git a/molecule/with-config/molecule.yml b/molecule/with-config/molecule.yml index 0d59f0b..0a4bc66 100644 --- a/molecule/with-config/molecule.yml +++ b/molecule/with-config/molecule.yml @@ -22,6 +22,24 @@ platforms: - /tmp volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro + - name: debian-9 + image: jrei/systemd-debian:9 + command: /sbin/init + privileged: true + tmpfs: + - /run + - /tmp + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + - name: debian-10 + image: jrei/systemd-debian:10 + command: /sbin/init + privileged: true + tmpfs: + - /run + - /tmp + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro - name: ubuntu-16.04 image: jrei/systemd-ubuntu:16.04 command: /sbin/init diff --git a/molecule/with-config/tests/test_default.py b/molecule/with-config/tests/test_default.py index 84cb3a9..3cd2927 100644 --- a/molecule/with-config/tests/test_default.py +++ b/molecule/with-config/tests/test_default.py @@ -47,7 +47,7 @@ def test_adguardhome_binary(host): def test_adguardhome_service(host): - s = host.service('adguardhome') + s = host.service('adguardhome.service') assert s.is_enabled assert s.is_running