diff --git a/Makefile b/Makefile index 724e6618..9e600cca 100644 --- a/Makefile +++ b/Makefile @@ -96,8 +96,8 @@ test-darwin-all: test-short-all test-int-darwin-all test-linux-all: test-short-all test-int-64 test-int-32 test-windows-all: test-short-all test-int-windows-all -test-int-64: rockylinux9 wheezy trusty alpine3 arch test-int-serve-linux-amd64 -test-int-32: rockylinux9-32 wheezy-32 trusty-32 alpine3-32 arch-32 +test-int-64: rockylinux9 wheezy bookworm trusty alpine3 arch test-int-serve-linux-amd64 +test-int-32: rockylinux9-32 wheezy-32 bookworm-32 trusty-32 alpine3-32 arch-32 test-int-darwin-all: test-int-validate-darwin-amd64 test-int-serve-darwin-amd64 test-int-windows-all: test-int-validate-windows-amd64 test-int-serve-windows-amd64 test-int-all: test-int-32 test-int-64 @@ -112,6 +112,10 @@ rockylinux9-32: build wheezy-32: build $(info INFO: Starting build $@) cd integration-tests/ && ./test.sh wheezy 386 +.PHONY: bookworm-32 +bookworm-32: build + $(info INFO: Starting build $@) + cd integration-tests/ && ./test.sh bookworm 386 trusty-32: build $(info INFO: Starting build $@) cd integration-tests/ && ./test.sh trusty 386 @@ -131,6 +135,10 @@ rockylinux9: build wheezy: build $(info INFO: Starting build $@) cd integration-tests/ && ./test.sh wheezy amd64 +.PHONY: bookworm +bookworm: build + $(info INFO: Starting build $@) + cd integration-tests/ && ./test.sh bookworm amd64 trusty: build $(info INFO: Starting build $@) cd integration-tests/ && ./test.sh trusty amd64 diff --git a/integration-tests/Dockerfile_bookworm b/integration-tests/Dockerfile_bookworm new file mode 100644 index 00000000..2663f795 --- /dev/null +++ b/integration-tests/Dockerfile_bookworm @@ -0,0 +1,9 @@ +FROM debian:bookworm + +RUN apt-get -o Acquire::Check-Valid-Until=false update && \ + apt-get install -y apache2=2.4.62-1~deb12u2 ca-certificates tinyproxy vim-tiny systemd systemd-sysv && \ + apt-get remove -y vim-tiny && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN mkfifo /pipe diff --git a/integration-tests/goss/bookworm/goss-aa-expected.yaml b/integration-tests/goss/bookworm/goss-aa-expected.yaml new file mode 100644 index 00000000..5349698e --- /dev/null +++ b/integration-tests/goss/bookworm/goss-aa-expected.yaml @@ -0,0 +1,17 @@ +package: + apache2: + installed: true + versions: + - 2.4.62-1~deb12u2 +port: + tcp:80: + listening: true + ip: + - 0.0.0.0 +service: + apache2: + enabled: true + running: true +process: + apache2: + running: true diff --git a/integration-tests/goss/bookworm/goss-expected-q.yaml b/integration-tests/goss/bookworm/goss-expected-q.yaml new file mode 100644 index 00000000..6ca24f86 --- /dev/null +++ b/integration-tests/goss/bookworm/goss-expected-q.yaml @@ -0,0 +1,127 @@ +file: + /etc/passwd: + exists: true + contents: [] + /tmp/goss/foobar: + exists: false + contents: [] +package: + apache2: + installed: true + foobar: + installed: false + vim-tiny: + installed: false +addr: + tcp://httpbin:22: + reachable: false + timeout: 1000 + tcp://httpbin:80: + reachable: true + timeout: 1000 + udp://8.8.8.8:53: + reachable: true + timeout: 1000 +port: + tcp:80: + listening: true + tcp:9999: + listening: false + tcp6:80: + listening: false +service: + apache2: + enabled: true + running: true + foobar: + enabled: false + running: false +user: + foobar: + exists: false + www-data: + exists: true +group: + foobar: + exists: false + www-data: + exists: true +command: + echo 'hi': + exit-status: 0 + stdout: "" + stderr: "" + timeout: 10000 + foobar: + exit-status: 127 + stdout: "" + stderr: "" + timeout: 10000 +dns: + CAA:dnstest.io: + resolvable: true + timeout: 1000 + server: 8.8.8.8 + CNAME:c.dnstest.io: + resolvable: true + timeout: 1000 + server: 8.8.8.8 + MX:dnstest.io: + resolvable: true + timeout: 1000 + server: 8.8.8.8 + NS:dnstest.io: + resolvable: true + timeout: 1000 + server: 8.8.8.8 + PTR:54.243.154.1: + resolvable: true + timeout: 1000 + server: 8.8.8.8 + SRV:_https._tcp.dnstest.io: + resolvable: true + timeout: 1000 + server: 8.8.8.8 + TXT:txt._test.dnstest.io: + resolvable: true + timeout: 1000 + server: 8.8.8.8 + ip6.dnstest.io: + resolvable: true + timeout: 1000 + server: 8.8.8.8 + localhost: + resolvable: true + timeout: 1000 +process: + apache2: + running: true + foobar: + running: false +kernel-param: + kernel.ostype: + value: Linux +mount: + /dev: + exists: true + timeout: 1000 +http: + http://google.com: + status: 301 + allow-insecure: false + no-follow-redirects: true + timeout: 5000 + body: [] + https://www.apple.com: + status: 200 + allow-insecure: false + no-follow-redirects: false + timeout: 5000 + body: [] + proxy: http://127.0.0.1:8888 + https://www.google.com: + status: 200 + allow-insecure: false + no-follow-redirects: false + timeout: 5000 + body: [] diff --git a/integration-tests/goss/bookworm/goss-expected.yaml b/integration-tests/goss/bookworm/goss-expected.yaml new file mode 100644 index 00000000..fc6e58a9 --- /dev/null +++ b/integration-tests/goss/bookworm/goss-expected.yaml @@ -0,0 +1,177 @@ +file: + /etc/passwd: + exists: true + mode: "0644" + owner: root + group: root + filetype: file + contents: [] + /tmp/goss/foobar: + exists: false + contents: [] +package: + apache2: + installed: true + versions: + - 2.4.62-1~deb12u2 + foobar: + installed: false + vim-tiny: + installed: false +addr: + tcp://httpbin:22: + reachable: false + timeout: 1000 + tcp://httpbin:80: + reachable: true + timeout: 1000 + udp://8.8.8.8:53: + reachable: true + timeout: 1000 +port: + tcp:80: + listening: true + ip: + - 0.0.0.0 + tcp:9999: + listening: false + ip: [] + tcp6:80: + listening: false + ip: [] +service: + apache2: + enabled: true + running: true + foobar: + enabled: false + running: false +user: + foobar: + exists: false + www-data: + exists: true + uid: 33 + gid: 33 + groups: + - www-data + home: /var/www + shell: /usr/sbin/nologin +group: + foobar: + exists: false + www-data: + exists: true + gid: 33 +command: + echo 'hi': + exit-status: 0 + stdout: + - hi + stderr: "" + timeout: 10000 + foobar: + exit-status: 127 + stdout: "" + stderr: + - 'sh: 1: foobar: not found' + timeout: 10000 +dns: + CAA:dnstest.io: + resolvable: true + addrs: + - 0 issue comodoca.com + - 0 issue letsencrypt.org + - 0 issuewild ; + timeout: 1000 + server: 8.8.8.8 + CNAME:c.dnstest.io: + resolvable: true + addrs: + - a.dnstest.io. + timeout: 1000 + server: 8.8.8.8 + MX:dnstest.io: + resolvable: true + addrs: + - 10 b.dnstest.io. + - 5 a.dnstest.io. + timeout: 1000 + server: 8.8.8.8 + NS:dnstest.io: + resolvable: true + addrs: + - ns1.dnstest.io. + - ns2.dnstest.io. + timeout: 1000 + server: 8.8.8.8 + PTR:54.243.154.1: + resolvable: true + addrs: + - ec2-54-243-154-1.compute-1.amazonaws.com. + timeout: 1000 + server: 8.8.8.8 + SRV:_https._tcp.dnstest.io: + resolvable: true + addrs: + - 0 5 443 a.dnstest.io. + - 10 10 443 b.dnstest.io. + timeout: 1000 + server: 8.8.8.8 + TXT:txt._test.dnstest.io: + resolvable: true + addrs: + - Hello DNS + timeout: 1000 + server: 8.8.8.8 + ip6.dnstest.io: + resolvable: true + addrs: + - 2404:6800:4001:807::200e + timeout: 1000 + server: 8.8.8.8 + localhost: + resolvable: true + addrs: + - 127.0.0.1 + - ::1 + timeout: 1000 +process: + apache2: + running: true + foobar: + running: false +kernel-param: + kernel.ostype: + value: Linux +mount: + /dev: + exists: true + opts: + - rw + - nosuid + vfs-opts: + - rw + source: tmpfs + filesystem: tmpfs + timeout: 1000 +http: + http://google.com: + status: 301 + allow-insecure: false + no-follow-redirects: true + timeout: 5000 + body: [] + https://www.apple.com: + status: 200 + allow-insecure: false + no-follow-redirects: false + timeout: 5000 + body: [] + proxy: http://127.0.0.1:8888 + https://www.google.com: + status: 200 + allow-insecure: false + no-follow-redirects: false + timeout: 5000 + body: [] diff --git a/integration-tests/goss/bookworm/goss.yaml b/integration-tests/goss/bookworm/goss.yaml new file mode 100644 index 00000000..c83ed1d0 --- /dev/null +++ b/integration-tests/goss/bookworm/goss.yaml @@ -0,0 +1,35 @@ +--- +service: + autofs: + enabled: false + running: false +user: + www-data: + exists: true + uid: 33 + gid: 33 + groups: + - www-data + home: "/var/www" +group: + www-data: + exists: true + gid: 33 +process: + apache2: + running: true +port: + tcp:80: + listening: true + ip: + - '0.0.0.0' +addr: + tcp://127.0.0.1:80: + reachable: true + timeout: 500 + local-address: 127.0.0.1 +gossfile: + "../goss-s*.yaml": {} + bypath: + file: "../goss-dummy.yaml" + diff --git a/integration-tests/goss/vars.yaml b/integration-tests/goss/vars.yaml index 0686fd1a..2e2742f4 100644 --- a/integration-tests/goss/vars.yaml +++ b/integration-tests/goss/vars.yaml @@ -31,5 +31,11 @@ wheezy: apache2: "2.2.22-13+deb7u13" services: apache2: ["2", "3", "5", "4"] +bookworm: + proxy: http://127.0.0.1:8888 + packages: + apache2: "2.4.62-1~deb12u2" + services: + apache2: [] overwrite: foo diff --git a/integration-tests/test.sh b/integration-tests/test.sh index e92d08b0..484846f6 100755 --- a/integration-tests/test.sh +++ b/integration-tests/test.sh @@ -4,7 +4,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/../ci/lib/setup.sh" || exit 67 # preserve current behaviour set -x -os="${1:?"Need OS as 1st arg. e.g. alpine arch centos7 rockylinux9 trusty wheezy"}" +os="${1:?"Need OS as 1st arg. e.g. alpine arch centos7 rockylinux9 trusty wheezy bookworm"}" arch="${2:?"Need arch as 2nd arg. e.g. amd64 386"}" vars_inline="{inline: bar, overwrite: bar}"