Skip to content

Commit

Permalink
Replace centos7 with rockylinux9 in integration-tests (#906)
Browse files Browse the repository at this point in the history
* add rockylinux9 test image

* use own .PHONY directive to avoid merge conflicts

* replace centos7 with rockylinux9 in integration tests

---------

Co-authored-by: Ahmed Elsabbahy <[email protected]>
  • Loading branch information
dklimpel and aelsabbahy authored Jul 9, 2024
1 parent ff26784 commit 05f03a3
Show file tree
Hide file tree
Showing 11 changed files with 402 additions and 15 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,5 @@ jobs:
with:
go-version-file: go.mod

#- name: Integration tests
# run: make test-int-all

# GHA does not work with centos7
- name: Integration tests-64
run: make wheezy trusty alpine3 arch test-int-serve-linux-amd64
- name: Integration tests-32
run: make wheezy-32 trusty-32 alpine3-32 arch-32
- name: Integration tests
run: make test-int-all
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,19 @@ 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: 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-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

centos7-32: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh centos7 386
.PHONY: rockylinux9-32
rockylinux9-32: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh rockylinux9 386
wheezy-32: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh wheezy 386
Expand All @@ -120,6 +124,10 @@ arch-32: build
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
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh wheezy amd64
Expand Down
25 changes: 25 additions & 0 deletions integration-tests/Dockerfile_rockylinux9
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM rockylinux:9

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 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); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;

CMD ["/usr/sbin/init"]

RUN systemctl enable httpd
RUN systemctl enable tinyproxy
RUN chmod 700 ~root
RUN mkfifo /pipe
4 changes: 2 additions & 2 deletions integration-tests/goss/generate_goss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ for x in /etc/passwd /tmp/goss/foobar;do
goss a "${args[@]}" file $x
done

[[ $OS == "centos7" ]] && package="httpd" || package="apache2"
[[ $OS == "centos7" ]] && user="apache" || user="www-data"
[[ $OS == "centos7" || $OS == "rockylinux9" ]] && package="httpd" || package="apache2"
[[ $OS == "centos7" || $OS == "rockylinux9" ]] && user="apache" || user="www-data"
goss a "${args[@]}" package $package foobar vim-tiny

goss a "${args[@]}" addr --timeout 1s httpbin:80 httpbin:22
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/goss/goss-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ service:
foobar:
enabled: false
running: false
{{ if .Env.OS | regexMatch "centos[7]" }}
{{ if .Env.OS | regexMatch "centos[7]|rockylinux[9]" }}
httpd:
{{else}}
apache2:
Expand Down
17 changes: 17 additions & 0 deletions integration-tests/goss/rockylinux9/goss-aa-expected.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package:
httpd:
installed: true
versions:
- 2.4.57-8.el9
port:
tcp:80:
listening: true
ip:
- 0.0.0.0
service:
httpd:
enabled: true
running: true
process:
httpd:
running: true
127 changes: 127 additions & 0 deletions integration-tests/goss/rockylinux9/goss-expected-q.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
file:
/etc/passwd:
exists: true
contents: []
/tmp/goss/foobar:
exists: false
contents: []
package:
foobar:
installed: false
httpd:
installed: true
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:
foobar:
enabled: false
running: false
httpd:
enabled: true
running: true
user:
apache:
exists: true
foobar:
exists: false
group:
apache:
exists: true
foobar:
exists: false
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:
foobar:
running: false
httpd:
running: true
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: []
Loading

0 comments on commit 05f03a3

Please sign in to comment.