goss-org / goss

Quick and Easy server testing/validation
https://goss.rocks
Apache License 2.0
5.5k stars 470 forks source link

fix integration tests for alpine3 #937

Closed dklimpel closed 1 week ago

dklimpel commented 1 week ago
Checklist

Description of change

Apache2 has only one listener by design. Either IPv4 or IPv6.

It seems that the order of the ip addresses has been changed (in CI/docker runtime). Previously IPv4 first to now IPv6 first. If the test with Apache2 should explicitly test IPv4, the service should also explicitly run on IPv4.

Related:

aelsabbahy commented 1 week ago

Yeah, I think this is related to https://github.com/goss-org/goss/issues/149

My guess is travis-ci changed that setting in their CI runners. I'm not able to reproduce that behavior on my local machine and the CI used to work just fine.. so that's my theory.

I added some debugging to my branch yesterday which showed that it was indeed listening to tcp6 here:

https://app.travis-ci.com/github/goss-org/goss/jobs/623192771#L5295

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.11:42279        0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:8888            0.0.0.0:*               LISTEN      -
tcp        0      0 :::8888                 :::*                    LISTEN      -
tcp        0      0 :::80                   :::*                    LISTEN      164/httpd

This PR is the cleanest fix, so I'll merge this and close out the other ones.

Great find and thanks for the elegant fix!

dklimpel commented 1 week ago

I had a discussion with my colleague. One alternative is to switch from Apache2 to Nginx. Nginx runs on both ports, IPv4 and IPv6.