diff --git a/Makefile b/Makefile index d45d2108..a4d9008c 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: centos7 wheezy trusty alpine3 arch test-int-serve-linux-amd64 -test-int-32: centos7-32 wheezy-32 trusty-32 alpine3-32 arch-32 +test-int-64: centos7 wheezy trusty noble alpine3 arch test-int-serve-linux-amd64 +test-int-32: centos7-32 wheezy-32 trusty-32 noble-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 @@ -111,6 +111,10 @@ wheezy-32: build trusty-32: build $(info INFO: Starting build $@) cd integration-tests/ && ./test.sh trusty 386 +.PHONY: noble-32 +noble-32: build + $(info INFO: Starting build $@) + cd integration-tests/ && ./test.sh noble 386 alpine3-32: build $(info INFO: Starting build $@) cd integration-tests/ && ./test.sh alpine3 386 @@ -126,6 +130,10 @@ wheezy: build trusty: build $(info INFO: Starting build $@) cd integration-tests/ && ./test.sh trusty amd64 +.PHONY: noble +noble: build + $(info INFO: Starting build $@) + cd integration-tests/ && ./test.sh noble amd64 alpine3: build $(info INFO: Starting build $@) cd integration-tests/ && ./test.sh alpine3 amd64 diff --git a/integration-tests/Dockerfile_noble b/integration-tests/Dockerfile_noble new file mode 100644 index 00000000..526e7f0a --- /dev/null +++ b/integration-tests/Dockerfile_noble @@ -0,0 +1,10 @@ +FROM ubuntu:noble +MAINTAINER Ahmed + +RUN apt-get update && \ + apt-get install --no-install-recommends -y apache2=2.4.58-1ubuntu8.1 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/goss-service.yaml b/integration-tests/goss/goss-service.yaml index 102c92cb..76bb3ea8 100644 --- a/integration-tests/goss/goss-service.yaml +++ b/integration-tests/goss/goss-service.yaml @@ -8,7 +8,7 @@ service: {{else}} apache2: {{end}} -{{ if .Env.OS | regexMatch "trusty" }} +{{ if .Env.OS | regexMatch "trusty|noble" }} enabled: false {{else}} enabled: true diff --git a/integration-tests/goss/noble/goss-aa-expected.yaml b/integration-tests/goss/noble/goss-aa-expected.yaml new file mode 100644 index 00000000..9fc73f36 --- /dev/null +++ b/integration-tests/goss/noble/goss-aa-expected.yaml @@ -0,0 +1,17 @@ +package: + apache2: + installed: true + versions: + - 2.4.58-1ubuntu8.1 +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/noble/goss-expected-q.yaml b/integration-tests/goss/noble/goss-expected-q.yaml new file mode 100644 index 00000000..6ca24f86 --- /dev/null +++ b/integration-tests/goss/noble/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/noble/goss-expected.yaml b/integration-tests/goss/noble/goss-expected.yaml new file mode 100644 index 00000000..c10a56f8 --- /dev/null +++ b/integration-tests/goss/noble/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.58-1ubuntu8.1 + 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/noble/goss.yaml b/integration-tests/goss/noble/goss.yaml new file mode 100644 index 00000000..ef693116 --- /dev/null +++ b/integration-tests/goss/noble/goss.yaml @@ -0,0 +1,35 @@ +--- +service: + tinyproxy: + enabled: true + running: true +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 dd505182..3b2ec891 100644 --- a/integration-tests/goss/vars.yaml +++ b/integration-tests/goss/vars.yaml @@ -19,6 +19,12 @@ trusty: apache2: "2.4.7-1ubuntu4.22" services: apache2: ["3"] +noble: + proxy: http://127.0.0.1:8888 + packages: + apache2: "2.4.58-1ubuntu8.1" + services: + apache2: [] wheezy: proxy: http://127.0.0.1:8888 packages: diff --git a/integration-tests/test.sh b/integration-tests/test.sh index 3225d37b..751a0e34 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 trusty wheezy"}" +os="${1:?"Need OS as 1st arg. e.g. alpine arch centos7 trusty noble wheezy"}" arch="${2:?"Need arch as 2nd arg. e.g. amd64 386"}" vars_inline="{inline: bar, overwrite: bar}" @@ -36,7 +36,7 @@ fi network=goss-test docker network create --driver bridge --subnet '172.19.0.0/16' $network docker run -d --name httpbin --network $network kennethreitz/httpbin -opts=(--env OS=$os --cap-add SYS_ADMIN -v "$PWD/goss:/goss" -d --name "$container_name" --security-opt seccomp:unconfined --security-opt label:disable) +opts=(--env OS=$os --cap-add SYS_ADMIN -v "$PWD/goss:/goss" -d --name "$container_name" --security-opt seccomp:unconfined --security-opt label:disable --privileged) id=$(docker run "${opts[@]}" --network $network "aelsabbahy/goss_$os" /sbin/init) ip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' "$id") trap "rv=\$?; docker rm -vf $id;docker rm -vf httpbin;docker network rm $network; exit \$rv" INT TERM EXIT