diff --git a/.travis.yml b/.travis.yml index 6cd0e18e..3bf344f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ before_install: - (sudo aa-status; true) # - echo "==== System update ====" - # Do not run 'upgrade' + # Do not run 'upgrade' - takes too long - sudo apt-get update # - echo "==== Install QA/test prerequisites ====" @@ -43,21 +43,20 @@ install: - sudo ./setup/start.sh -v script: - #- sudo find / -name nsd.service - #- sudo sed -i 's|-d|-d -4 -a 0.0.0.0@5053 -p 5053 -V 3|' /etc/systemd/system/multi-user.target.wants/nsd.service - #- sudo sed -i 's|-d|-d -4 -a 0.0.0.0@5053 -p 5053 -V 3|' /lib/systemd/system/nsd.service + # nsd won't start on Travis without the changes below: ip6 off and + # control-enable set to no. Even though the nsd docs says the + # default value for control-enable is no, running "nsd-checkconf -o + # control-enable /etc/nsd/nsd.conf" returns "yes", so we explicitly + # set it here. + # + # we're assuming that the "ip-address" line is the last line in the + # "server" section of nsd.conf. if this generated file output + # changes, the sed command below may need to be adjusted. - sudo sed -i 's/ip-address\(.\)\(.*\)/ip-address\1\2\n do-ip4\1 yes\n do-ip6\1 no\n verbosity\1 3\nremote-control\1\n control-enable\1 no/' /etc/nsd/nsd.conf - - sudo systemctl daemon-reload - - sudo systemctl restart nsd - - sudo systemctl status -l nsd - - sudo cat /var/log/nsd.log - sudo cat /etc/nsd/nsd.conf - - sudo nsd-checkconf -o port /etc/nsd/nsd.conf - - sudo nsd-checkconf -o ip-address /etc/nsd/nsd.conf - - sudo cat /etc/systemd/system/multi-user.target.wants/nsd.service - - sudo tail -100 /var/log/syslog - - sudo ps -efww | grep nsd - - sudo ss -lp "sport = 8952" - - sudo ss -lp "sport = :domain" - - sudo ss -lp "sport = 5053" + - sudo systemctl restart nsd + - sudo systemctl status nsd + # + # launch automated tests, but skip tests that require remote + # smtp support because Travis-CI blocks outgoing port 25 - sudo ./tests/runner.sh -dumpoutput -no-smtp-remote diff --git a/tests/suites/_mgmt-functions.sh b/tests/suites/_mgmt-functions.sh index c6c406fd..07fbdc5b 100644 --- a/tests/suites/_mgmt-functions.sh +++ b/tests/suites/_mgmt-functions.sh @@ -70,6 +70,9 @@ mgmt_rest() { record "Ignoring curl return code 56 due to 200 status" elif [ $code -ne 16 -o $REST_HTTP_CODE -ne 200 ]; then + # any error code will fail the rest call except for a 16 + # with a 200 HTTP status. + # 16="a problem was detected in the HTTP2 framing layer. This is somewhat generic and can be one out of several problems" REST_ERROR="CURL failed with code $code" record "${F_DANGER}$REST_ERROR${F_RESET}" record "$output" @@ -86,15 +89,6 @@ mgmt_rest() { return 0 } -systemctl_reset() { - local service="$1" - # for travis-ci: reset nsd to avoid "nsd.service: Start request - # repeated too quickly", which occurs inside kick() of the - # management flask app when "system restart nsd" is called on - # detection of a new mail domain - record "[systemctl reset-failed $service]" - systemctl reset-failed $service 2>&1 >>$TEST_OF -} mgmt_create_user() { local email="$1" @@ -109,15 +103,6 @@ mgmt_create_user() { record "[create user $email]" mgmt_rest POST /admin/mail/users/add "email=$email" "password=$pass" rc=$? - if echo "$REST_OUTPUT" | grep "updated DNS:" >/dev/null; then - record "[Detected dns update]" - systemctl status nsd.service >>$TEST_OF - record "Sleeping 5 seconds for services to start" - sleep 5 - systemctl status nsd.service >>$TEST_OF - record "[NSD LOG]" - cat /var/log/nsd.log >>$TEST_OF - fi return $rc }