diff --git a/.github/workflows/release-and-package.yml b/.github/workflows/release-and-package.yml index d6907e0e..0f72f388 100644 --- a/.github/workflows/release-and-package.yml +++ b/.github/workflows/release-and-package.yml @@ -43,7 +43,7 @@ jobs: mkdir -p ${{ github.workspace }}/rpmbuild/RPMS/SRPMS - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: source diff --git a/.github/workflows/run-tests-pebble.yml b/.github/workflows/run-tests-pebble.yml index 4159336f..6ee91097 100644 --- a/.github/workflows/run-tests-pebble.yml +++ b/.github/workflows/run-tests-pebble.yml @@ -17,7 +17,7 @@ jobs: test-alpine: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on Alpine @@ -25,7 +25,7 @@ jobs: test-bash-4-0: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on Alpine using Bash 4.0 @@ -33,7 +33,7 @@ jobs: test-bash-4-2: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on Alpine using Bash 4.2 @@ -41,7 +41,7 @@ jobs: test-bash-5-0: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on Alpine using Bash 5 @@ -49,7 +49,7 @@ jobs: test-centos6: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on CentOS6 @@ -57,7 +57,7 @@ jobs: test-centos7: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on CentOS7 @@ -65,7 +65,7 @@ jobs: test-centos8: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on CentOS8 @@ -73,7 +73,7 @@ jobs: test-debian: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on Debian @@ -81,7 +81,7 @@ jobs: test-rockylinux8: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on RockyLinux8 @@ -89,7 +89,7 @@ jobs: test-ubuntu: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on Ubuntu @@ -97,7 +97,7 @@ jobs: test-ubuntu14: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on Ubuntu14 @@ -105,7 +105,7 @@ jobs: test-ubuntu16: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on Ubuntu16 @@ -113,7 +113,7 @@ jobs: test-ubuntu18: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on Ubuntu18 diff --git a/.github/workflows/run-tests-staging-acmedns.yml b/.github/workflows/run-tests-staging-acmedns.yml index 9ca1ee26..17e68105 100644 --- a/.github/workflows/run-tests-staging-acmedns.yml +++ b/.github/workflows/run-tests-staging-acmedns.yml @@ -20,7 +20,7 @@ jobs: test-ubuntu-acmedns: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on Ubuntu against Staging using acmedns diff --git a/.github/workflows/run-tests-staging-duckdns.yml b/.github/workflows/run-tests-staging-duckdns.yml index c937e8a2..a5998307 100644 --- a/.github/workflows/run-tests-staging-duckdns.yml +++ b/.github/workflows/run-tests-staging-duckdns.yml @@ -1,15 +1,13 @@ name: Run tests against Staging server using DuckDNS on: workflow_dispatch: - branches: - - master env: DUCKDNS_TOKEN: ${{ secrets.DUCKDNS_TOKEN == '' && '1d616aa9-b8e4-4bb4-b312-3289de82badb' || secrets.DUCKDNS_TOKEN }} jobs: test-centos7-duckdns: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on CentOS7 against Staging using DuckDNS @@ -19,7 +17,7 @@ jobs: if: always() needs: test-centos7-duckdns steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on Ubuntu against Staging using DuckDNS diff --git a/.github/workflows/run-tests-staging-dynu.yml b/.github/workflows/run-tests-staging-dynu.yml index 7cc769bf..7d935c5e 100644 --- a/.github/workflows/run-tests-staging-dynu.yml +++ b/.github/workflows/run-tests-staging-dynu.yml @@ -1,15 +1,13 @@ name: Run tests against Staging server using Dynu on: - workflow_dispatch: - branches: - - master + workflow_dispatch env: DYNU_API_KEY: ${{ secrets.DYNU_API_KEY == '' && '65cXefd35XbYf36546eg5dYcZT6X52Y2' || secrets.DYNU_API_KEY }} jobs: test-centos7-dynu: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on CentOS7 against Staging using Dynu @@ -19,7 +17,7 @@ jobs: if: always() needs: test-centos7-dynu steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the docker compose stack run: docker compose up -d --build - name: Run test suite on Ubuntu against Staging using Dynu diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index e755b4e7..e7f251ce 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -17,7 +17,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Lint check uses: azohra/shell-linter@latest with: diff --git a/getssl b/getssl index fc725410..2c49a82f 100755 --- a/getssl +++ b/getssl @@ -1622,9 +1622,20 @@ get_auth_dns() { # get the authoritative dns server for a domain (sets primary_n # Query for NS records if [[ -z "$res" ]]; then - debug Using "$HAS_DIG_OR_DRILL $DNS_CHECK_OPTIONS ${gad_s} NS ${gad_d}" to find primary nameserver - # shellcheck disable=SC2086 - res=$($HAS_DIG_OR_DRILL $DNS_CHECK_OPTIONS ${gad_s} NS "${gad_d}"| grep -E "IN\W(NS|SOA)\W") + out="SERVFAIL" + i=0 + while [[ "$out" == *"SERVFAIL"* ]] && [[ $i -lt 5 ]]; do + debug Using "$HAS_DIG_OR_DRILL $DNS_CHECK_OPTIONS ${gad_s} NS ${gad_d}" to find primary nameserver + # shellcheck disable=SC2086 + out=$($HAS_DIG_OR_DRILL $DNS_CHECK_OPTIONS ${gad_s} NS "${gad_d}") + res=$(echo "$out"| grep -E "IN\W(NS|SOA)\W") + if [[ "$out" == *SERVFAIL* ]]; then + debug Output from "$HAS_DIG_OR_DRILL $DNS_CHECK_OPTIONS ${gad_s} NS ${gad_d}" contains SERVFAIL + debug "$out" + sleep 2 + fi + ((i++)) + done fi if [[ -n "$res" ]]; then diff --git a/test/24-wildcard-sans.bats b/test/24-wildcard-sans.bats index eca79dc2..10de29f0 100644 --- a/test/24-wildcard-sans.bats +++ b/test/24-wildcard-sans.bats @@ -50,7 +50,6 @@ teardown_file() { check_output_for_errors run openssl x509 -noout -text -in "${INSTALL_DIR}/.getssl/${GETSSL_CMD_HOST}/${GETSSL_CMD_HOST}.crt" # verify certificate is for wildcard domain with non-wildcard domain in the Subject Alternative Name list - # assert_output --regexp "Subject: CN[ ]?=[ ]?\*.wild-${GETSSL_HOST}" assert_output --partial "DNS:${GETSSL_HOST}" } @@ -69,6 +68,5 @@ teardown_file() { check_output_for_errors run openssl x509 -noout -text -in "${INSTALL_DIR}/.getssl/${GETSSL_CMD_HOST}/${GETSSL_CMD_HOST}.crt" # verify certificate is for non-wildcard domain with wildcard domain in the Subject Alternative Name list - # assert_output --regexp "Subject: CN[ ]?=[ ]?${GETSSL_HOST}" assert_output --partial "DNS:*.wild-${GETSSL_HOST}" } diff --git a/test/Dockerfile-centos7 b/test/Dockerfile-centos7 index ce659892..5bb32297 100644 --- a/test/Dockerfile-centos7 +++ b/test/Dockerfile-centos7 @@ -13,9 +13,9 @@ RUN yum -y install ftp vsftpd RUN yum -y install openssh-server # Set locale -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 WORKDIR /root RUN mkdir -p /etc/nginx/pki/private diff --git a/test/Dockerfile-centos7-duckdns b/test/Dockerfile-centos7-duckdns index f66eaf02..bdbcd9ee 100644 --- a/test/Dockerfile-centos7-duckdns +++ b/test/Dockerfile-centos7-duckdns @@ -8,12 +8,12 @@ RUN yum -y install epel-release RUN yum -y install git curl bind-utils ldns wget which nginx jq # Set locale -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 -ENV staging "true" -ENV dynamic_dns "dynu" +ENV staging="true" +ENV dynamic_dns="dynu" WORKDIR /root RUN mkdir -p /etc/nginx/pki/private diff --git a/test/Dockerfile-centos7-dynu b/test/Dockerfile-centos7-dynu index d73958e2..074a0a2d 100644 --- a/test/Dockerfile-centos7-dynu +++ b/test/Dockerfile-centos7-dynu @@ -8,12 +8,12 @@ RUN yum -y install epel-release RUN yum -y install git curl bind-utils ldns wget which nginx jq # Set locale -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 -ENV staging "true" -ENV dynamic_dns "duckdns" +ENV staging="true" +ENV dynamic_dns="duckdns" WORKDIR /root RUN mkdir -p /etc/nginx/pki diff --git a/test/Dockerfile-centos8 b/test/Dockerfile-centos8 index e1025a11..e918e4e9 100644 --- a/test/Dockerfile-centos8 +++ b/test/Dockerfile-centos8 @@ -15,9 +15,9 @@ RUN yum -y install ftp vsftpd RUN yum -y install openssh-server # Set locale -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 WORKDIR /root RUN mkdir -p /etc/nginx/pki/private diff --git a/test/Dockerfile-debian b/test/Dockerfile-debian index 5ac7ef88..689e1437 100644 --- a/test/Dockerfile-debian +++ b/test/Dockerfile-debian @@ -11,9 +11,9 @@ RUN apt-get install -y locales # for idn testing # Set locale RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 WORKDIR /root RUN mkdir -p /etc/nginx/pki/private diff --git a/test/Dockerfile-rockylinux8 b/test/Dockerfile-rockylinux8 index 5723634a..7ecddf45 100644 --- a/test/Dockerfile-rockylinux8 +++ b/test/Dockerfile-rockylinux8 @@ -10,9 +10,9 @@ RUN yum -y update && \ glibc-locale-source glibc-langpack-en # for en_US.UTF-8 support # Set locale -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 WORKDIR /root RUN mkdir -p /etc/nginx/pki/private diff --git a/test/Dockerfile-ubuntu b/test/Dockerfile-ubuntu index 1abd7486..ce428c95 100644 --- a/test/Dockerfile-ubuntu +++ b/test/Dockerfile-ubuntu @@ -3,7 +3,7 @@ FROM ubuntu:latest # Note this image uses mawk1.3 # Set noninteractive otherwise tzdata hangs -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive # Update and install required software RUN apt-get update --fix-missing @@ -15,9 +15,9 @@ RUN apt-get install -y locales # for idn testing # Set locale RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 # Setup ftp ENV VSFTPD_CONF=/etc/vsftpd.conf diff --git a/test/Dockerfile-ubuntu-acmedns b/test/Dockerfile-ubuntu-acmedns index 0a30eea3..db0320ad 100644 --- a/test/Dockerfile-ubuntu-acmedns +++ b/test/Dockerfile-ubuntu-acmedns @@ -3,14 +3,14 @@ FROM ubuntu:latest # Note this image uses mawk1.3 # Set noninteractive otherwise tzdata hangs -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive # Ensure tests in this image use the staging server -ENV staging "true" +ENV staging="true" # 2016ENV dynamic_dns "acme-dns" -ENV ACMEDNS_API_USER 49ac5f6d-74cd-4aca-acfe-f9457af7894c -ENV ACMEDNS_API_KEY 2NPGF8cH7PeTrHZWXImi1prhTsQGz2pdCC7Za5zE -ENV ACMEDNS_SUBDOMAIN 7268181b-7075-4dce-be51-9c20c205cf6e +ENV ACMEDNS_API_USER=49ac5f6d-74cd-4aca-acfe-f9457af7894c +ENV ACMEDNS_API_KEY=2NPGF8cH7PeTrHZWXImi1prhTsQGz2pdCC7Za5zE +ENV ACMEDNS_SUBDOMAIN=7268181b-7075-4dce-be51-9c20c205cf6e # Update and install required software RUN apt-get update --fix-missing @@ -20,9 +20,9 @@ RUN apt-get install -y locales # for idn testing # Set locale RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 WORKDIR /root diff --git a/test/Dockerfile-ubuntu-duckdns b/test/Dockerfile-ubuntu-duckdns index d2ed88ac..dbb8f217 100644 --- a/test/Dockerfile-ubuntu-duckdns +++ b/test/Dockerfile-ubuntu-duckdns @@ -3,11 +3,11 @@ FROM ubuntu:latest # Note this image uses mawk1.3 # Set noninteractive otherwise tzdata hangs -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive # Ensure tests in this image use the staging server -ENV staging "true" -ENV dynamic_dns "duckdns" +ENV staging="true" +ENV dynamic_dns="duckdns" # Update and install required software RUN apt-get update --fix-missing @@ -17,9 +17,9 @@ RUN apt-get install -y locales # for idn testing # Set locale RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 WORKDIR /root diff --git a/test/Dockerfile-ubuntu-dynu b/test/Dockerfile-ubuntu-dynu index fe5f74dd..8f655b59 100644 --- a/test/Dockerfile-ubuntu-dynu +++ b/test/Dockerfile-ubuntu-dynu @@ -3,11 +3,11 @@ FROM ubuntu:latest # Note this image uses mawk1.3 # Set noninteractive otherwise tzdata hangs -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive # Ensure tests in this image use the staging server -ENV staging "true" -ENV dynamic_dns "dynu" +ENV staging="true" +ENV dynamic_dns="dynu" # Update and install required software RUN apt-get update --fix-missing @@ -17,9 +17,9 @@ RUN apt-get install -y locales # for idn testing # Set locale RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 WORKDIR /root diff --git a/test/Dockerfile-ubuntu14 b/test/Dockerfile-ubuntu14 index bb36a9f7..fda2915f 100644 --- a/test/Dockerfile-ubuntu14 +++ b/test/Dockerfile-ubuntu14 @@ -13,9 +13,9 @@ RUN apt-get update --fix-missing && \ # Set locale RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 WORKDIR /root RUN mkdir -p /etc/nginx/pki/private diff --git a/test/Dockerfile-ubuntu16 b/test/Dockerfile-ubuntu16 index e8f0273a..0798baa6 100644 --- a/test/Dockerfile-ubuntu16 +++ b/test/Dockerfile-ubuntu16 @@ -12,9 +12,9 @@ RUN apt-get install -y locales # for idn testing # Set locale RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 WORKDIR /root RUN mkdir -p /etc/nginx/pki/private diff --git a/test/Dockerfile-ubuntu18 b/test/Dockerfile-ubuntu18 index 981dddd3..e9664a8c 100644 --- a/test/Dockerfile-ubuntu18 +++ b/test/Dockerfile-ubuntu18 @@ -12,9 +12,9 @@ RUN apt-get install -y locales # for idn testing # Set locale RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 WORKDIR /root RUN mkdir -p /etc/nginx/pki/private diff --git a/test/run-test.sh b/test/run-test.sh index d5d34f5e..62bee669 100755 --- a/test/run-test.sh +++ b/test/run-test.sh @@ -14,6 +14,8 @@ if [ $# -gt 1 ]; then if [[ $COMMAND != "bats /getssl/test"* ]]; then if [[ $COMMAND == /getssl/test* ]]; then COMMAND="bats $COMMAND" + elif [[ $COMMAND == test/* ]]; then + COMMAND="bats /getssl/$COMMAND" else COMMAND="bats /getssl/test/$COMMAND" fi diff --git a/test/u2-test-get_auth_dns-drill.bats b/test/u2-test-get_auth_dns-drill.bats index 468f6b5a..1baaa178 100644 --- a/test/u2-test-get_auth_dns-drill.bats +++ b/test/u2-test-get_auth_dns-drill.bats @@ -66,14 +66,14 @@ teardown() { run get_auth_dns ubuntu-getssl.ignorelist.com # Assert that we've found the primary_ns server - assert_output --regexp 'set primary_ns = ns[1-3]+\.afraid\.org' + assert_output --regexp 'set primary_ns = ns[1-4]+\.afraid\.org' # Assert that we had to use drill NS assert_line --regexp 'Using drill.* NS' # Check all Authoritive DNS servers are returned if requested CHECK_ALL_AUTH_DNS=true run get_auth_dns ubuntu-getssl.ignorelist.com - assert_output --regexp 'set primary_ns = (ns[1-3]+\.afraid\.org ?)+' + assert_output --regexp 'set primary_ns = (ns[1-4]+\.afraid\.org ?)+' }