Skip to content
Open
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
30 changes: 22 additions & 8 deletions .github/workflows/golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,33 @@ jobs:
- name: Unit tests and coverage
run: make cov

integration-test:
integration-test-linux:
needs: [coverage]
name: Integration tests (ubuntu-latest)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Integration tests
shell: bash
run: make test-int-all

integration-test-other:
needs: [coverage]
name: Integration tests
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os:
- macos-latest
- windows-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand All @@ -59,9 +78,4 @@ jobs:
shell: bash
run: |
os_name="$(go env GOOS)"
if [[ "${os_name}" == "darwin" || "${os_name}" == "windows" ]]; then
make "test-int-${os_name}-all"
else
# linux runs all tests;
make test-int-all
fi
make "test-int-${os_name}-all"
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ VENV := $(shell echo $${VIRTUAL_ENV-.venv})
PYTHON := $(VENV)/bin/python
DOCS_DEPS := $(VENV)/.docs.dependencies

.PHONY: all build install test release bench fmt lint vet test-int-all gen centos7 wheezy trusty alpine3 arch test-int32 centos7-32 wheezy-32 trusty-32 alpine3-32 arch-32
.PHONY: all build install test release bench fmt lint vet test-int-all gen centos7 test-int32 centos7-32

all: test-short-all test-int-all dgoss-sha256 dcgoss-sha256 kgoss-sha256

Expand Down Expand Up @@ -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 bullseye jammy alpine3 arch test-int-serve-linux-amd64
test-int-32: rockylinux9-32 bullseye-32 alpine3-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
Expand All @@ -109,34 +109,34 @@ centos7-32: build
rockylinux9-32: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh rockylinux9 386
wheezy-32: build
.PHONY: bullseye-32
bullseye-32: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh wheezy 386
trusty-32: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh trusty 386
cd integration-tests/ && ./test.sh bullseye 386
.PHONY: alpine3-32
alpine3-32: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh alpine3 386
arch-32: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh arch 386
centos7: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh centos7 amd64
.PHONY: rockylinux9
rockylinux9: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh rockylinux9 amd64
wheezy: build
.PHONY: bullseye
bullseye: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh wheezy amd64
trusty: build
cd integration-tests/ && ./test.sh bullseye amd64
.PHONY: jammy
jammy: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh trusty amd64
cd integration-tests/ && ./test.sh jammy amd64
.PHONY: alpine3
alpine3: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh alpine3 amd64
.PHONY: arch
arch: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh arch amd64
Expand Down
6 changes: 4 additions & 2 deletions integration-tests/Dockerfile_alpine3
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM alpine:3.19
FROM alpine:3.20
LABEL org.opencontainers.image.authors="Ahmed"

# install apache2 and remove un-needed services
RUN apk update && \
apk add --no-cache openrc apache2=2.4.59-r0 bash ca-certificates tinyproxy && \
apk add --no-cache openrc apache2 bash ca-certificates tinyproxy dnsmasq && \
sed -i 's/Listen 80/Listen 0.0.0.0:80/g' /etc/apache2/httpd.conf && \
rc-update add apache2 && \
rc-update add tinyproxy && \
rc-update add dnsmasq && \
rm -rf /etc/init.d/networking /etc/init.d/hwdrivers /var/cache/apk/* /tmp/*
COPY dnsmasq.conf /etc/dnsmasq.conf
RUN mkfifo /pipe
1 change: 0 additions & 1 deletion integration-tests/Dockerfile_alpine3.md5

This file was deleted.

6 changes: 4 additions & 2 deletions integration-tests/Dockerfile_arch
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM archlinux:base
MAINTAINER @siddharthist

RUN pacman -Syu --noconfirm apache dnsmasq tinyproxy && \
pacman -Scc
COPY dnsmasq.conf /etc/dnsmasq.conf
RUN ln -s /does_not_exist /foo && \
chmod 700 ~root
RUN systemctl enable httpd dnsmasq tinyproxy
RUN mkfifo /pipe
1 change: 0 additions & 1 deletion integration-tests/Dockerfile_arch.md5

This file was deleted.

15 changes: 15 additions & 0 deletions integration-tests/Dockerfile_bullseye
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM debian:bullseye
LABEL org.opencontainers.image.authors="Ahmed"

RUN echo 'deb http://deb.debian.org/debian bullseye main contrib' > /etc/apt/sources.list
RUN echo 'deb http://deb.debian.org/debian bullseye-updates main contrib' >> /etc/apt/sources.list
RUN echo 'deb http://security.debian.org/debian-security/ bullseye-security main contrib' >> /etc/apt/sources.list

RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install --yes \
systemd-sysv apache2 ca-certificates tinyproxy dnsmasq && \
apt-get clean

COPY dnsmasq.conf /etc/dnsmasq.conf

RUN systemctl enable apache2 tinyproxy dnsmasq
RUN mkfifo /pipe
12 changes: 12 additions & 0 deletions integration-tests/Dockerfile_jammy
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ubuntu:jammy
LABEL org.opencontainers.image.authors="Ahmed"

RUN apt-get update && \
apt-get install --no-install-recommends -y systemd-sysv && \
apt-get install -y apache2 tinyproxy dnsmasq && \
apt-get clean

COPY dnsmasq.conf /etc/dnsmasq.conf

RUN systemctl enable apache2 tinyproxy dnsmasq
RUN mkfifo /pipe
7 changes: 5 additions & 2 deletions integration-tests/Dockerfile_rockylinux9
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM rockylinux:9

ENV container docker
ENV container=docker

RUN dnf install -y systemd httpd diffutils 'dnf-command(config-manager)' && \
dnf config-manager --set-enabled crb && \
dnf install -y epel-release && \
dnf install -y tinyproxy && \
dnf install -y tinyproxy dnsmasq && \
dnf remove -y 'dnf-command(config-manager)' epel-release

RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
Expand All @@ -17,9 +17,12 @@ RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == system
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;

COPY dnsmasq.conf /etc/dnsmasq.conf

CMD ["/usr/sbin/init"]

RUN systemctl enable httpd
RUN systemctl enable tinyproxy
RUN systemctl enable dnsmasq
RUN chmod 700 ~root
RUN mkfifo /pipe
14 changes: 0 additions & 14 deletions integration-tests/Dockerfile_trusty

This file was deleted.

1 change: 0 additions & 1 deletion integration-tests/Dockerfile_trusty.md5

This file was deleted.

13 changes: 0 additions & 13 deletions integration-tests/Dockerfile_wheezy

This file was deleted.

1 change: 0 additions & 1 deletion integration-tests/Dockerfile_wheezy.md5

This file was deleted.

17 changes: 17 additions & 0 deletions integration-tests/dnsmasq.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
port=8053
auth-server=ns1.dnstest.io,eth0
auth-sec-servers=ns2.dnstest.io
auth-zone=dnstest.io
auth-soa=2026051301,hostmaster.dnstest.io,1200,120,604800
host-record=dnstest.io,54.243.154.1
host-record=ip6.dnstest.io,2404:6800:4001:807::200e
host-record=a.dnstest.io,192.30.252.153
mx-host=dnstest.io,a.dnstest.io,5
mx-host=dnstest.io,b.dnstest.io,10
cname=c.dnstest.io,a.dnstest.io
caa-record=dnstest.io,0,issue,comodoca.com
caa-record=dnstest.io,0,issue,letsencrypt.org
caa-record=dnstest.io,0,issuewild,;
txt-record=txt._test.dnstest.io,Hello DNS
srv-host=_https._tcp.dnstest.io,a.dnstest.io,443,0,5
srv-host=_https._tcp.dnstest.io,b.dnstest.io,443,10,10
2 changes: 1 addition & 1 deletion integration-tests/goss/alpine3/goss-aa-expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package:
apache2:
installed: true
versions:
- 2.4.59-r0
- 2.4.67-r0
service:
apache2:
enabled: true
Expand Down
16 changes: 8 additions & 8 deletions integration-tests/goss/alpine3/goss-expected-q.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ addr:
tcp://httpbin:80:
reachable: true
timeout: 1000
udp://8.8.8.8:53:
udp://127.0.0.1:8053:
reachable: true
timeout: 1000
port:
Expand Down Expand Up @@ -61,35 +61,35 @@ dns:
CAA:dnstest.io:
resolvable: true
timeout: 1000
server: 8.8.8.8
server: 127.0.0.1:8053
CNAME:c.dnstest.io:
resolvable: true
timeout: 1000
server: 8.8.8.8
server: 127.0.0.1:8053
MX:dnstest.io:
resolvable: true
timeout: 1000
server: 8.8.8.8
server: 127.0.0.1:8053
NS:dnstest.io:
resolvable: true
timeout: 1000
server: 8.8.8.8
server: 127.0.0.1:8053
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
server: 127.0.0.1:8053
TXT:txt._test.dnstest.io:
resolvable: true
timeout: 1000
server: 8.8.8.8
server: 127.0.0.1:8053
ip6.dnstest.io:
resolvable: true
timeout: 1000
server: 8.8.8.8
server: 127.0.0.1:8053
localhost:
resolvable: true
timeout: 1000
Expand Down
18 changes: 9 additions & 9 deletions integration-tests/goss/alpine3/goss-expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ package:
apache2:
installed: true
versions:
- 2.4.59-r0
- 2.4.67-r0
foobar:
installed: false
vim-tiny:
Expand All @@ -25,7 +25,7 @@ addr:
tcp://httpbin:80:
reachable: true
timeout: 1000
udp://8.8.8.8:53:
udp://127.0.0.1:8053:
reachable: true
timeout: 1000
port:
Expand Down Expand Up @@ -78,27 +78,27 @@ dns:
- 0 issue letsencrypt.org
- 0 issuewild ;
timeout: 1000
server: 8.8.8.8
server: 127.0.0.1:8053
CNAME:c.dnstest.io:
resolvable: true
addrs:
- a.dnstest.io.
timeout: 1000
server: 8.8.8.8
server: 127.0.0.1:8053
MX:dnstest.io:
resolvable: true
addrs:
- 10 b.dnstest.io.
- 5 a.dnstest.io.
timeout: 1000
server: 8.8.8.8
server: 127.0.0.1:8053
NS:dnstest.io:
resolvable: true
addrs:
- ns1.dnstest.io.
- ns2.dnstest.io.
timeout: 1000
server: 8.8.8.8
server: 127.0.0.1:8053
PTR:54.243.154.1:
resolvable: true
addrs:
Expand All @@ -111,19 +111,19 @@ dns:
- 0 5 443 a.dnstest.io.
- 10 10 443 b.dnstest.io.
timeout: 1000
server: 8.8.8.8
server: 127.0.0.1:8053
TXT:txt._test.dnstest.io:
resolvable: true
addrs:
- Hello DNS
timeout: 1000
server: 8.8.8.8
server: 127.0.0.1:8053
ip6.dnstest.io:
resolvable: true
addrs:
- 2404:6800:4001:807::200e
timeout: 1000
server: 8.8.8.8
server: 127.0.0.1:8053
localhost:
resolvable: true
addrs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package:
apache2:
installed: true
versions:
- 2.4.7-1ubuntu4.22
- 2.4.67-1~deb11u1
port:
tcp:80:
listening: true
Expand Down
Loading