From d763342fd04960b239d040dc1c4dcf12fdad2690 Mon Sep 17 00:00:00 2001 From: Tim Kimber Date: Thu, 26 Sep 2024 12:46:53 +0100 Subject: [PATCH 1/5] Changes to fix Docker warnings --- test/Dockerfile-centos7 | 6 +++--- test/Dockerfile-centos7-duckdns | 10 +++++----- test/Dockerfile-centos7-dynu | 10 +++++----- test/Dockerfile-centos8 | 6 +++--- test/Dockerfile-debian | 6 +++--- test/Dockerfile-rockylinux8 | 6 +++--- test/Dockerfile-ubuntu | 8 ++++---- test/Dockerfile-ubuntu-acmedns | 16 ++++++++-------- test/Dockerfile-ubuntu-duckdns | 12 ++++++------ test/Dockerfile-ubuntu-dynu | 12 ++++++------ test/Dockerfile-ubuntu14 | 6 +++--- test/Dockerfile-ubuntu16 | 6 +++--- test/Dockerfile-ubuntu18 | 6 +++--- 13 files changed, 55 insertions(+), 55 deletions(-) diff --git a/test/Dockerfile-centos7 b/test/Dockerfile-centos7 index 6d8961c..127e2d4 100644 --- a/test/Dockerfile-centos7 +++ b/test/Dockerfile-centos7 @@ -8,9 +8,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 f66eaf0..bdbcd9e 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 d73958e..074a0a2 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 e1025a1..e918e4e 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 5ac7ef8..689e143 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 5723634..7ecddf4 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 1abd748..ce428c9 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 0a30eea..db0320a 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 d2ed88a..dbb8f21 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 fe5f74d..8f655b5 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 bb36a9f..fda2915 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 e8f0273..0798baa 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 981dddd..e9664a8 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 From ad41c8d3a1d2d60aec4bd999f7d75ecffa26248e Mon Sep 17 00:00:00 2001 From: Tim Kimber Date: Thu, 26 Sep 2024 12:49:06 +0100 Subject: [PATCH 2/5] Move to checkout v4 --- .github/workflows/release-and-package.yml | 2 +- .github/workflows/run-tests-pebble.yml | 78 +++++++++---------- .../workflows/run-tests-staging-acmedns.yml | 6 +- .../workflows/run-tests-staging-duckdns.yml | 12 +-- .github/workflows/run-tests-staging-dynu.yml | 12 +-- .github/workflows/shellcheck.yml | 2 +- 6 files changed, 56 insertions(+), 56 deletions(-) diff --git a/.github/workflows/release-and-package.yml b/.github/workflows/release-and-package.yml index d6907e0..0f72f38 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 1d707e8..6ee9109 100644 --- a/.github/workflows/run-tests-pebble.yml +++ b/.github/workflows/run-tests-pebble.yml @@ -17,104 +17,104 @@ jobs: test-alpine: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - uses: actions/checkout@v4 + - name: Build the docker compose stack + run: docker compose up -d --build - name: Run test suite on Alpine run: test/run-test.sh alpine test-bash-4-0: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - 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 run: test/run-test.sh bash4-0 test-bash-4-2: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - 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 run: test/run-test.sh bash4-2 test-bash-5-0: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - 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 run: test/run-test.sh bash5-0 test-centos6: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - uses: actions/checkout@v4 + - name: Build the docker compose stack + run: docker compose up -d --build - name: Run test suite on CentOS6 run: test/run-test.sh centos6 test-centos7: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - uses: actions/checkout@v4 + - name: Build the docker compose stack + run: docker compose up -d --build - name: Run test suite on CentOS7 run: test/run-test.sh centos7 test-centos8: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - uses: actions/checkout@v4 + - name: Build the docker compose stack + run: docker compose up -d --build - name: Run test suite on CentOS8 run: test/run-test.sh centos8 test-debian: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - uses: actions/checkout@v4 + - name: Build the docker compose stack + run: docker compose up -d --build - name: Run test suite on Debian run: test/run-test.sh debian test-rockylinux8: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - uses: actions/checkout@v4 + - name: Build the docker compose stack + run: docker compose up -d --build - name: Run test suite on RockyLinux8 run: test/run-test.sh rockylinux8 test-ubuntu: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - uses: actions/checkout@v4 + - name: Build the docker compose stack + run: docker compose up -d --build - name: Run test suite on Ubuntu run: test/run-test.sh ubuntu test-ubuntu14: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - uses: actions/checkout@v4 + - name: Build the docker compose stack + run: docker compose up -d --build - name: Run test suite on Ubuntu14 run: test/run-test.sh ubuntu14 test-ubuntu16: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - uses: actions/checkout@v4 + - name: Build the docker compose stack + run: docker compose up -d --build - name: Run test suite on Ubuntu16 run: test/run-test.sh ubuntu16 test-ubuntu18: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - uses: actions/checkout@v4 + - name: Build the docker compose stack + run: docker compose up -d --build - name: Run test suite on Ubuntu18 run: test/run-test.sh ubuntu18 diff --git a/.github/workflows/run-tests-staging-acmedns.yml b/.github/workflows/run-tests-staging-acmedns.yml index fd4897d..17e6810 100644 --- a/.github/workflows/run-tests-staging-acmedns.yml +++ b/.github/workflows/run-tests-staging-acmedns.yml @@ -20,8 +20,8 @@ jobs: test-ubuntu-acmedns: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - 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 run: test/run-test.sh ubuntu-acmedns diff --git a/.github/workflows/run-tests-staging-duckdns.yml b/.github/workflows/run-tests-staging-duckdns.yml index 4bf0caf..ae31c4e 100644 --- a/.github/workflows/run-tests-staging-duckdns.yml +++ b/.github/workflows/run-tests-staging-duckdns.yml @@ -9,9 +9,9 @@ jobs: test-centos7-duckdns: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - 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 run: test/run-test.sh centos7-duckdns test-ubuntu-duckdns: @@ -19,8 +19,8 @@ jobs: if: always() needs: test-centos7-duckdns steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - 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 run: test/run-test.sh ubuntu-duckdns diff --git a/.github/workflows/run-tests-staging-dynu.yml b/.github/workflows/run-tests-staging-dynu.yml index 8cc147e..dd21551 100644 --- a/.github/workflows/run-tests-staging-dynu.yml +++ b/.github/workflows/run-tests-staging-dynu.yml @@ -9,9 +9,9 @@ jobs: test-centos7-dynu: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - 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 run: test/run-test.sh centos7-dynu test-ubuntu-dynu: @@ -19,8 +19,8 @@ jobs: if: always() needs: test-centos7-dynu steps: - - uses: actions/checkout@v3 - - name: Build the docker-compose stack - run: docker-compose up -d --build + - 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 run: test/run-test.sh ubuntu-dynu diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index e755b4e..e7f251c 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: From 8a7628375a55c51a5fc42f080dfde74c745486f2 Mon Sep 17 00:00:00 2001 From: Tim Kimber Date: Thu, 26 Sep 2024 13:02:01 +0100 Subject: [PATCH 3/5] Remove branches from workflow_dispatch to remove warning --- .github/workflows/run-tests-staging-duckdns.yml | 2 -- .github/workflows/run-tests-staging-dynu.yml | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/run-tests-staging-duckdns.yml b/.github/workflows/run-tests-staging-duckdns.yml index ae31c4e..a599830 100644 --- a/.github/workflows/run-tests-staging-duckdns.yml +++ b/.github/workflows/run-tests-staging-duckdns.yml @@ -1,8 +1,6 @@ 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: diff --git a/.github/workflows/run-tests-staging-dynu.yml b/.github/workflows/run-tests-staging-dynu.yml index dd21551..7d935c5 100644 --- a/.github/workflows/run-tests-staging-dynu.yml +++ b/.github/workflows/run-tests-staging-dynu.yml @@ -1,8 +1,6 @@ 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: From ffdfb09577947c66590fb1a0f04fe21e3e67f3b8 Mon Sep 17 00:00:00 2001 From: Tim Kimber Date: Thu, 26 Sep 2024 14:05:05 +0100 Subject: [PATCH 4/5] Retry drill if the output contains SERVFAIL to fix test instability --- getssl | 12 +++++++++--- test/24-wildcard-sans.bats | 2 -- test/README-Testing.md | 17 +++++++++-------- test/run-test.sh | 14 ++++++++++++++ test/u2-test-get_auth_dns-drill.bats | 4 ++-- 5 files changed, 34 insertions(+), 15 deletions(-) diff --git a/getssl b/getssl index d3d8059..98e664f 100755 --- a/getssl +++ b/getssl @@ -1622,9 +1622,15 @@ 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") + ((i++)) + done fi if [[ -n "$res" ]]; then diff --git a/test/24-wildcard-sans.bats b/test/24-wildcard-sans.bats index 1ce09c2..10de29f 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/README-Testing.md b/test/README-Testing.md index 9936541..10786bc 100644 --- a/test/README-Testing.md +++ b/test/README-Testing.md @@ -15,34 +15,35 @@ Tests can also be triggered manually from the GitHub website. For dynamic DNS tests, you need accounts on duckdns.org and dynu.com, and need to create 4 domain names in each account. For duckdns.org: + - Add DUCKDNS_TOKEN to your repository's environment secrets. The value is your account's token -- Add domains -centos7-getssl.duckdns.org, wild--centos7.duckdns.org, -ubuntu-getssl.duckdns.org, and wild--ubuntu-getssl.duckdns.org +- Add domains \-centos7-getssl.duckdns.org, wild-\-centos7.duckdns.org, \-ubuntu-getssl.duckdns.org, and wild-\-ubuntu-getssl.duckdns.org For dynu.com: - - Add DYNU_API_KEY to your repository's environment secrets. The value is your account's API Key. - - Add domains -centos7-getssl.freedns.org, wild--centos7.freedns.org, -ubuntu-getssl.freedns.org, and wild--ubuntu-getssl.freedns.org -To run dynamic DNS tests outside the CI environment, you need accounts without in the domain names. Export the environment variable corresponding to the secrets (with the same values). +- Add DYNU_API_KEY to your repository's environment secrets. The value is your account's API Key. +- Add domains \-centos7-getssl.freedns.org, wild-\-centos7.freedns.org, \-ubuntu-getssl.freedns.org, and wild-\-ubuntu-getssl.freedns.org -For individual accounts, is your github account name. +To run dynamic DNS tests outside the CI environment, you need accounts without \ in the domain names. Export the environment variable corresponding to the secrets (with the same values). +For individual accounts, \ is your github account name. ## To run all the tests on a single OS 1. Start `pebble` and `challtestsrv` using ```docker-compose up -d --build``` -2. Run the test suite ```test/run-test.sh []``` +2. Run the test suite ```test/run-test.sh [\]``` 3. eg. `test/run-test.sh ubuntu16` ## To run a single bats test on a single OS 1. Start `pebble` and `challtestsrv` using ```docker-compose up -d --build``` -2. ```test/run-test.sh bats ``` +2. ```test/run-test.sh \ bats \``` 3. e.g. `test/run-test.sh ubuntu bats /getssl/test/1-simple-http01.bats` ## To debug a test 1. Start `pebble` and `challtestsrv` using ```docker-compose up -d --build``` -2. ```run-test.sh /getssl/test/debug-test.sh ``` +2. ```run-test.sh \ /getssl/test/debug-test.sh \``` 3. e.g. `test/run-test.sh ubuntu /getssl/test/debug-test.sh -d /getssl/test/test-config/getssl-http01-cfg` ## TODO diff --git a/test/run-test.sh b/test/run-test.sh index caf8ceb..62bee66 100755 --- a/test/run-test.sh +++ b/test/run-test.sh @@ -10,6 +10,20 @@ OS=$1 if [ $# -gt 1 ]; then shift COMMAND=$* + if [[ $COMMAND != bash ]]; 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 + fi + if [[ $COMMAND != *.bats ]]; then + COMMAND="${COMMAND}.bats" + fi + fi else COMMAND="bats /getssl/test --timing" fi diff --git a/test/u2-test-get_auth_dns-drill.bats b/test/u2-test-get_auth_dns-drill.bats index 3ac8a87..72fa6dc 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 ?)+' } From dfabb85668193b579e5817c02ae7dc5ed93ace86 Mon Sep 17 00:00:00 2001 From: Tim Kimber Date: Thu, 26 Sep 2024 16:50:31 +0100 Subject: [PATCH 5/5] Sleep between retries of drill --- getssl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/getssl b/getssl index a7837db..2c49a82 100755 --- a/getssl +++ b/getssl @@ -1629,6 +1629,11 @@ get_auth_dns() { # get the authoritative dns server for a domain (sets primary_n # 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