diff --git a/roles/validate-zone-db/files/test_zones/testing.test/zone.db b/roles/validate-zone-db/files/test_zones/testing.test/zone.db new file mode 100644 index 000000000..d11bee790 --- /dev/null +++ b/roles/validate-zone-db/files/test_zones/testing.test/zone.db @@ -0,0 +1,18 @@ +; -*- mode: zone -*- +$ORIGIN testing.test. +$TTL 1h +@ IN SOA adns1.testing.test. hostmaster.testing.test. ( + 1667422838 ; serial number unixtime + 1h ; refresh (secondary checks for updates) + 10m ; retry (secondary retries failed axfr) + 10d ; expire (secondary ends serving old data) + 5m ) ; min ttl (cache time for failed lookups) +@ IN NS ns1.testing.test. +@ IN A 127.0.0.1 +@ IN AAAA ::1 + +adns1 IN A 127.0.0.1 +adns1 IN AAAA ::1 + +ns1 IN A 127.0.0.1 +ns1 IN AAAA ::1 diff --git a/roles/validate-zone-db/tasks/main.yaml b/roles/validate-zone-db/tasks/main.yaml index 4b3c17613..7ea2de08c 100644 --- a/roles/validate-zone-db/tasks/main.yaml +++ b/roles/validate-zone-db/tasks/main.yaml @@ -9,7 +9,14 @@ when: not zone_db_files - name: 'Run checkzone' - command: '/usr/sbin/named-checkzone {{ zj_zone_db_file[0] }} {{ zj_zone_db_file[1] }}' + # Use shell so that $PATH can be used to lookup the executable path. + # Jammy installs to /usr/bin but older releases install to /usr/sbin. + shell: | + # Explicitly add /usr/sbin to path in case it isnt already there. + export PATH=$PATH:/usr/sbin + named-checkzone {{ zj_zone_db_file[0] }} {{ zj_zone_db_file[1] }} loop: "{{ zone_db_files }}" loop_control: loop_var: zj_zone_db_file + tags: + - skip_ansible_lint diff --git a/tools/update-test-platforms.py b/tools/update-test-platforms.py index e5cee6dfa..c644d77c2 100755 --- a/tools/update-test-platforms.py +++ b/tools/update-test-platforms.py @@ -59,6 +59,7 @@ TAGS = { 'centos-platforms': CENTOS_PLATFORMS, 'debian-platforms': DEBIAN_PLATFORMS, 'ubuntu-platforms': UBUNTU_PLATFORMS, + 'debuntu-platforms': UBUNTU_PLATFORMS + DEBIAN_PLATFORMS, 'all-platforms': ALL_PLATFORMS, } diff --git a/zuul-tests.d/general-roles-jobs.yaml b/zuul-tests.d/general-roles-jobs.yaml index af8ff2ede..d5f340eac 100644 --- a/zuul-tests.d/general-roles-jobs.yaml +++ b/zuul-tests.d/general-roles-jobs.yaml @@ -388,6 +388,68 @@ netconsole_remote_ip: 192.0.2.1 netconsole_remote_port: 6666 +- job: + name: zuul-jobs-test-validate-zone-db + description: Test the validate-zone-db role + tags: debuntu-platforms + files: + - ^roles/validate-zone-db/.* + run: test-playbooks/simple-role-test.yaml + vars: + role_name: validate-zone-db + zone_files: + - /home/zuul/src/opendev.org/zuul/zuul-jobs/roles/validate-zone-db/files/test_zones + +- job: + name: zuul-jobs-test-validate-zone-db-debian-bullseye + description: Test the validate-zone-db role on debian-bullseye + parent: zuul-jobs-test-validate-zone-db + tags: auto-generated + nodeset: + nodes: + - name: debian-bullseye + label: debian-bullseye + +- job: + name: zuul-jobs-test-validate-zone-db-debian-buster + description: Test the validate-zone-db role on debian-buster + parent: zuul-jobs-test-validate-zone-db + tags: auto-generated + nodeset: + nodes: + - name: debian-buster + label: debian-buster + +- job: + name: zuul-jobs-test-validate-zone-db-ubuntu-bionic + description: Test the validate-zone-db role on ubuntu-bionic + parent: zuul-jobs-test-validate-zone-db + tags: auto-generated + nodeset: + nodes: + - name: ubuntu-bionic + label: ubuntu-bionic + +- job: + name: zuul-jobs-test-validate-zone-db-ubuntu-focal + description: Test the validate-zone-db role on ubuntu-focal + parent: zuul-jobs-test-validate-zone-db + tags: auto-generated + nodeset: + nodes: + - name: ubuntu-focal + label: ubuntu-focal + +- job: + name: zuul-jobs-test-validate-zone-db-ubuntu-jammy + description: Test the validate-zone-db role on ubuntu-jammy + parent: zuul-jobs-test-validate-zone-db + tags: auto-generated + nodeset: + nodes: + - name: ubuntu-jammy + label: ubuntu-jammy + - job: name: zuul-jobs-test-dstat-graph description: Test the dstat-graph roles @@ -832,6 +894,11 @@ - zuul-jobs-test-enable-fips - zuul-jobs-test-ensure-bazelisk - zuul-jobs-test-netconsole + - zuul-jobs-test-validate-zone-db-debian-bullseye + - zuul-jobs-test-validate-zone-db-debian-buster + - zuul-jobs-test-validate-zone-db-ubuntu-bionic + - zuul-jobs-test-validate-zone-db-ubuntu-focal + - zuul-jobs-test-validate-zone-db-ubuntu-jammy - zuul-jobs-test-dstat-graph-centos-7 - zuul-jobs-test-dstat-graph-centos-8-stream - zuul-jobs-test-dstat-graph-centos-9-stream