From baef7bb95e68bcf8e32ae7f4e5559c7794ef7b4b Mon Sep 17 00:00:00 2001 From: Justin Ludwig Date: Sat, 25 May 2024 19:09:54 -0700 Subject: [PATCH] installer tests for latest alpine, fedora, & ubuntu --- README.md | 2 +- ...alpine-3.19.dockerfile => alpine-3.20.dockerfile} | 2 +- test_install/docker-compose.yml | 12 ++++++------ .../{fedora-39.dockerfile => fedora-40.dockerfile} | 2 +- .../{install_alpine_319.py => install_alpine_320.py} | 4 ++-- .../{install_fedora_39.py => install_fedora_40.py} | 4 ++-- ...l_ubuntu_minotaur.py => install_ubuntu_numbat.py} | 4 ++-- ...-minotaur.dockerfile => ubuntu-numbat.dockerfile} | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) rename test_install/{alpine-3.19.dockerfile => alpine-3.20.dockerfile} (79%) rename test_install/{fedora-39.dockerfile => fedora-40.dockerfile} (92%) rename test_install/{install_alpine_319.py => install_alpine_320.py} (98%) rename test_install/{install_fedora_39.py => install_fedora_40.py} (97%) rename test_install/{install_ubuntu_minotaur.py => install_ubuntu_numbat.py} (96%) rename test_install/{ubuntu-minotaur.dockerfile => ubuntu-numbat.dockerfile} (93%) diff --git a/README.md b/README.md index 8cfc2c1..66e7af0 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ docker run \ Run all (docker-based) installer tests: ``` docker-compose -f test_install/docker-compose.yml build --pull -tox -e py310 test_install +tox -e py310 -- test_install ``` Manually run pre-push hook on all version-controlled files: diff --git a/test_install/alpine-3.19.dockerfile b/test_install/alpine-3.20.dockerfile similarity index 79% rename from test_install/alpine-3.19.dockerfile rename to test_install/alpine-3.20.dockerfile index bfd9323..daebfe9 100644 --- a/test_install/alpine-3.19.dockerfile +++ b/test_install/alpine-3.20.dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.19 +FROM alpine:3.20 RUN apk add openrc WORKDIR /usr/local/src/agent CMD ["/sbin/init"] diff --git a/test_install/docker-compose.yml b/test_install/docker-compose.yml index 0faa3eb..c9eb55d 100644 --- a/test_install/docker-compose.yml +++ b/test_install/docker-compose.yml @@ -30,10 +30,10 @@ services: # /sys mount not strictly needed # but avoids some error messages when starting agent as daemon - alpine_319: + alpine_320: build: context: . - dockerfile: alpine-3.19.dockerfile + dockerfile: alpine-3.20.dockerfile volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro - ../:/usr/local/src/agent @@ -86,10 +86,10 @@ services: volumes: - ../:/usr/local/src/agent - fedora_39: + fedora_40: build: context: . - dockerfile: fedora-39.dockerfile + dockerfile: fedora-40.dockerfile privileged: true volumes: - ../:/usr/local/src/agent @@ -182,10 +182,10 @@ services: volumes: - ../:/usr/local/src/agent - ubuntu_minotaur: # aka 23.10 + ubuntu_numbat: # aka 24.04 build: context: . - dockerfile: ubuntu-minotaur.dockerfile + dockerfile: ubuntu-numbat.dockerfile privileged: true volumes: - ../:/usr/local/src/agent diff --git a/test_install/fedora-39.dockerfile b/test_install/fedora-40.dockerfile similarity index 92% rename from test_install/fedora-39.dockerfile rename to test_install/fedora-40.dockerfile index c6624db..1564f51 100644 --- a/test_install/fedora-39.dockerfile +++ b/test_install/fedora-40.dockerfile @@ -1,4 +1,4 @@ -FROM fedora:39 +FROM fedora:40 RUN dnf install -y systemd RUN /bin/sh -c 'cd /lib/systemd/system/sysinit.target.wants/ && rm $(ls | grep -v systemd-tmpfiles-setup)' WORKDIR /usr/local/src/agent diff --git a/test_install/install_alpine_319.py b/test_install/install_alpine_320.py similarity index 98% rename from test_install/install_alpine_319.py rename to test_install/install_alpine_320.py index d1631ea..7fd0e2b 100644 --- a/test_install/install_alpine_319.py +++ b/test_install/install_alpine_320.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -"""Install tests for Alpine 3.19.""" +"""Install tests for Alpine 3.20.""" import pytest from .util import exec_docker_shell, read_line, read_until, write_cmd, write_fake_cnf @@ -7,7 +7,7 @@ from .util import exec_docker_shell, read_line, read_until, write_cmd, write_fak @pytest.mark.timeout(60) def test_forced_install_and_remove_with_fake_credentials(): - with exec_docker_shell("alpine_319") as proc: + with exec_docker_shell("alpine_320") as proc: write_fake_cnf(proc, credentials=True) write_cmd(proc, "./install.sh --install --force") assert read_line(proc) == "running as root" diff --git a/test_install/install_fedora_39.py b/test_install/install_fedora_40.py similarity index 97% rename from test_install/install_fedora_39.py rename to test_install/install_fedora_40.py index 66b015a..0cb9243 100644 --- a/test_install/install_fedora_39.py +++ b/test_install/install_fedora_40.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -"""Install tests for Fedora 39.""" +"""Install tests for Fedora 40.""" import pytest from .util import exec_docker_shell, read_line, read_until, write_cmd, write_fake_cnf @@ -7,7 +7,7 @@ from .util import exec_docker_shell, read_line, read_until, write_cmd, write_fak @pytest.mark.timeout(90) def test_forced_install_with_fake_credentials(): - with exec_docker_shell("fedora_39") as proc: + with exec_docker_shell("fedora_40") as proc: write_fake_cnf(proc, credentials=True) write_cmd(proc, "./install.sh --install --force") assert read_line(proc) == "running as root" diff --git a/test_install/install_ubuntu_minotaur.py b/test_install/install_ubuntu_numbat.py similarity index 96% rename from test_install/install_ubuntu_minotaur.py rename to test_install/install_ubuntu_numbat.py index 5fd79e4..f2a0dd3 100644 --- a/test_install/install_ubuntu_minotaur.py +++ b/test_install/install_ubuntu_numbat.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -"""Install tests for Ubuntu Minotaur (23.10).""" +"""Install tests for Ubuntu Minotaur (24.04).""" import pytest from .util import exec_docker_shell, read_line, read_until, write_cmd, write_fake_cnf @@ -7,7 +7,7 @@ from .util import exec_docker_shell, read_line, read_until, write_cmd, write_fak @pytest.mark.timeout(90) def test_forced_install_with_fake_credentials(): - with exec_docker_shell("ubuntu_minotaur") as proc: + with exec_docker_shell("ubuntu_numbat") as proc: write_fake_cnf(proc, credentials=True) write_cmd(proc, "./install.sh --install --force") assert read_line(proc) == "running as root" diff --git a/test_install/ubuntu-minotaur.dockerfile b/test_install/ubuntu-numbat.dockerfile similarity index 93% rename from test_install/ubuntu-minotaur.dockerfile rename to test_install/ubuntu-numbat.dockerfile index a6409e7..d7b552a 100644 --- a/test_install/ubuntu-minotaur.dockerfile +++ b/test_install/ubuntu-numbat.dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.04 ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get install -y systemd wget RUN /bin/sh -c 'cd /lib/systemd/system/sysinit.target.wants/ && rm $(ls | grep -v systemd-tmpfiles-setup)' -- 2.45.2