From c5708044e7a266eef3883a05af69ab348cb1a2c8 Mon Sep 17 00:00:00 2001 From: Tom Krizek Date: Thu, 22 Dec 2022 14:26:03 +0100 Subject: [PATCH 1/5] Rename dig reference files in the rrsetorder test bin/tests/system/rrsetorder/dig.out* files match a gitignore expression present in bin/tests/system/.gitignore. Since these are meant to be reference files that are compared to the files generated when the "rrsetorder" system test is run, rename them to avoid listing tracked files in .gitignore files. --- ...fixed.good => reference.dig.out.fixed.good} | 0 ...om.good1 => reference.dig.out.random.good1} | 0 ....good10 => reference.dig.out.random.good10} | 0 ....good11 => reference.dig.out.random.good11} | 0 ....good12 => reference.dig.out.random.good12} | 0 ....good13 => reference.dig.out.random.good13} | 0 ....good14 => reference.dig.out.random.good14} | 0 ....good15 => reference.dig.out.random.good15} | 0 ....good16 => reference.dig.out.random.good16} | 0 ....good17 => reference.dig.out.random.good17} | 0 ....good18 => reference.dig.out.random.good18} | 0 ....good19 => reference.dig.out.random.good19} | 0 ...om.good2 => reference.dig.out.random.good2} | 0 ....good20 => reference.dig.out.random.good20} | 0 ....good21 => reference.dig.out.random.good21} | 0 ....good22 => reference.dig.out.random.good22} | 0 ....good23 => reference.dig.out.random.good23} | 0 ....good24 => reference.dig.out.random.good24} | 0 ...om.good3 => reference.dig.out.random.good3} | 0 ...om.good4 => reference.dig.out.random.good4} | 0 ...om.good5 => reference.dig.out.random.good5} | 0 ...om.good6 => reference.dig.out.random.good6} | 0 ...om.good7 => reference.dig.out.random.good7} | 0 ...om.good8 => reference.dig.out.random.good8} | 0 ...om.good9 => reference.dig.out.random.good9} | 0 bin/tests/system/rrsetorder/tests.sh | 18 +++++++++--------- 26 files changed, 9 insertions(+), 9 deletions(-) rename bin/tests/system/rrsetorder/{dig.out.fixed.good => reference.dig.out.fixed.good} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good1 => reference.dig.out.random.good1} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good10 => reference.dig.out.random.good10} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good11 => reference.dig.out.random.good11} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good12 => reference.dig.out.random.good12} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good13 => reference.dig.out.random.good13} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good14 => reference.dig.out.random.good14} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good15 => reference.dig.out.random.good15} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good16 => reference.dig.out.random.good16} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good17 => reference.dig.out.random.good17} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good18 => reference.dig.out.random.good18} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good19 => reference.dig.out.random.good19} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good2 => reference.dig.out.random.good2} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good20 => reference.dig.out.random.good20} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good21 => reference.dig.out.random.good21} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good22 => reference.dig.out.random.good22} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good23 => reference.dig.out.random.good23} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good24 => reference.dig.out.random.good24} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good3 => reference.dig.out.random.good3} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good4 => reference.dig.out.random.good4} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good5 => reference.dig.out.random.good5} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good6 => reference.dig.out.random.good6} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good7 => reference.dig.out.random.good7} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good8 => reference.dig.out.random.good8} (100%) rename bin/tests/system/rrsetorder/{dig.out.random.good9 => reference.dig.out.random.good9} (100%) diff --git a/bin/tests/system/rrsetorder/dig.out.fixed.good b/bin/tests/system/rrsetorder/reference.dig.out.fixed.good similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.fixed.good rename to bin/tests/system/rrsetorder/reference.dig.out.fixed.good diff --git a/bin/tests/system/rrsetorder/dig.out.random.good1 b/bin/tests/system/rrsetorder/reference.dig.out.random.good1 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good1 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good1 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good10 b/bin/tests/system/rrsetorder/reference.dig.out.random.good10 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good10 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good10 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good11 b/bin/tests/system/rrsetorder/reference.dig.out.random.good11 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good11 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good11 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good12 b/bin/tests/system/rrsetorder/reference.dig.out.random.good12 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good12 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good12 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good13 b/bin/tests/system/rrsetorder/reference.dig.out.random.good13 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good13 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good13 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good14 b/bin/tests/system/rrsetorder/reference.dig.out.random.good14 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good14 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good14 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good15 b/bin/tests/system/rrsetorder/reference.dig.out.random.good15 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good15 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good15 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good16 b/bin/tests/system/rrsetorder/reference.dig.out.random.good16 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good16 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good16 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good17 b/bin/tests/system/rrsetorder/reference.dig.out.random.good17 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good17 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good17 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good18 b/bin/tests/system/rrsetorder/reference.dig.out.random.good18 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good18 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good18 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good19 b/bin/tests/system/rrsetorder/reference.dig.out.random.good19 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good19 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good19 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good2 b/bin/tests/system/rrsetorder/reference.dig.out.random.good2 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good2 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good2 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good20 b/bin/tests/system/rrsetorder/reference.dig.out.random.good20 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good20 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good20 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good21 b/bin/tests/system/rrsetorder/reference.dig.out.random.good21 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good21 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good21 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good22 b/bin/tests/system/rrsetorder/reference.dig.out.random.good22 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good22 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good22 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good23 b/bin/tests/system/rrsetorder/reference.dig.out.random.good23 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good23 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good23 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good24 b/bin/tests/system/rrsetorder/reference.dig.out.random.good24 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good24 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good24 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good3 b/bin/tests/system/rrsetorder/reference.dig.out.random.good3 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good3 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good3 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good4 b/bin/tests/system/rrsetorder/reference.dig.out.random.good4 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good4 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good4 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good5 b/bin/tests/system/rrsetorder/reference.dig.out.random.good5 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good5 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good5 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good6 b/bin/tests/system/rrsetorder/reference.dig.out.random.good6 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good6 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good6 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good7 b/bin/tests/system/rrsetorder/reference.dig.out.random.good7 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good7 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good7 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good8 b/bin/tests/system/rrsetorder/reference.dig.out.random.good8 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good8 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good8 diff --git a/bin/tests/system/rrsetorder/dig.out.random.good9 b/bin/tests/system/rrsetorder/reference.dig.out.random.good9 similarity index 100% rename from bin/tests/system/rrsetorder/dig.out.random.good9 rename to bin/tests/system/rrsetorder/reference.dig.out.random.good9 diff --git a/bin/tests/system/rrsetorder/tests.sh b/bin/tests/system/rrsetorder/tests.sh index c2d94d8bd6..524efd984f 100644 --- a/bin/tests/system/rrsetorder/tests.sh +++ b/bin/tests/system/rrsetorder/tests.sh @@ -41,7 +41,7 @@ if $test_fixed; then for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 do dig_cmd @10.53.0.1 fixed.example > dig.out.fixed || ret=1 - diff dig.out.fixed dig.out.fixed.good >/dev/null || ret=1 + diff dig.out.fixed reference.dig.out.fixed.good >/dev/null || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status + ret)) @@ -133,7 +133,7 @@ do match=0 for j in $GOOD_RANDOM do - eval "diff dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1" + eval "diff dig.out.random reference.dig.out.random.good$j >/dev/null && match$j=1 match=1" if [ $match -eq 1 ]; then break; fi done if [ $match -eq 0 ]; then ret=1; fi @@ -172,7 +172,7 @@ if $test_fixed; then for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 do dig_cmd @10.53.0.2 fixed.example > dig.out.fixed || ret=1 - diff dig.out.fixed dig.out.fixed.good || ret=1 + diff dig.out.fixed reference.dig.out.fixed.good || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status + ret)) @@ -242,7 +242,7 @@ do match=0 for j in $GOOD_RANDOM do - eval "diff dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1" + eval "diff dig.out.random reference.dig.out.random.good$j >/dev/null && match$j=1 match=1" if [ $match -eq 1 ]; then break; fi done if [ $match -eq 0 ]; then ret=1; fi @@ -297,7 +297,7 @@ if $test_fixed; then for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 do dig_cmd @10.53.0.2 fixed.example > dig.out.fixed || ret=1 - diff dig.out.fixed dig.out.fixed.good || ret=1 + diff dig.out.fixed reference.dig.out.fixed.good || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status + ret)) @@ -367,7 +367,7 @@ do match=0 for j in $GOOD_RANDOM do - eval "diff dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1" + eval "diff dig.out.random reference.dig.out.random.good$j >/dev/null && match$j=1 match=1" if [ $match -eq 1 ]; then break; fi done if [ $match -eq 0 ]; then ret=1; fi @@ -406,7 +406,7 @@ if $test_fixed; then for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 do dig_cmd @10.53.0.3 fixed.example > dig.out.fixed || ret=1 - diff dig.out.fixed dig.out.fixed.good || ret=1 + diff dig.out.fixed reference.dig.out.fixed.good || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status + ret)) @@ -480,7 +480,7 @@ do match=0 for j in $GOOD_RANDOM do - eval "diff dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1" + eval "diff dig.out.random reference.dig.out.random.good$j >/dev/null && match$j=1 match=1" if [ $match -eq 1 ]; then break; fi done if [ $match -eq 0 ]; then ret=1; fi @@ -522,7 +522,7 @@ do match=0 for j in $GOOD_RANDOM do - eval "diff dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1" + eval "diff dig.out.random reference.dig.out.random.good$j >/dev/null && match$j=1 match=1" if [ $match -eq 1 ]; then break; fi done if [ $match -eq 0 ]; then ret=1; fi From b8616e457ffd40e1b2f570c4c0c3dc2ff44543a7 Mon Sep 17 00:00:00 2001 From: Tom Krizek Date: Thu, 22 Dec 2022 14:28:53 +0100 Subject: [PATCH 2/5] Remove ans.pl system test files from gitignore The ans*.pl scripts are part of system tests and should be part of the repository. The gitignore entires for these files have been removed. --- bin/tests/system/rpzrecurse/.gitignore | 1 - bin/tests/system/serve-stale/.gitignore | 1 - 2 files changed, 2 deletions(-) diff --git a/bin/tests/system/rpzrecurse/.gitignore b/bin/tests/system/rpzrecurse/.gitignore index 3132239b3c..5d4371d852 100644 --- a/bin/tests/system/rpzrecurse/.gitignore +++ b/bin/tests/system/rpzrecurse/.gitignore @@ -4,7 +4,6 @@ /ns3/named.conf /ns3/named2.conf /ns4/named.conf -/ans5/ans.pl /ans5/ans.pid /dnsrps-secondary.conf /dnsrps.conf diff --git a/bin/tests/system/serve-stale/.gitignore b/bin/tests/system/serve-stale/.gitignore index 3d3bc7f474..518f051e4b 100644 --- a/bin/tests/system/serve-stale/.gitignore +++ b/bin/tests/system/serve-stale/.gitignore @@ -1,5 +1,4 @@ /ans2/ans.pid -/ans2/ans.pl /ns1/named.conf /ns3/named.conf /ns3/root.bk From e03daf22ecb2637f4299f125aab2d91da040f79c Mon Sep 17 00:00:00 2001 From: Tom Krizek Date: Thu, 22 Dec 2022 14:46:49 +0100 Subject: [PATCH 3/5] Make gitignore matching in rpzrecurse more precise The pre-defined test cases use named.$TESTCASE.conf naming convention, where TESTCASE is a human readable name contaning actual word(s). The autogenerated test cases' names always start with a number from 1 to 6. --- bin/tests/system/rpzrecurse/ns2/.gitignore | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/tests/system/rpzrecurse/ns2/.gitignore b/bin/tests/system/rpzrecurse/ns2/.gitignore index db4f2c3d45..69f6f6cee2 100644 --- a/bin/tests/system/rpzrecurse/ns2/.gitignore +++ b/bin/tests/system/rpzrecurse/ns2/.gitignore @@ -1,3 +1,8 @@ /*.local /*.queries -/*.conf +/named.1*.conf +/named.2*.conf +/named.3*.conf +/named.4*.conf +/named.5*.conf +/named.6*.conf From a02da6cf217fb772ecd1a5e78e2f7dd9afc13de3 Mon Sep 17 00:00:00 2001 From: Tom Krizek Date: Thu, 22 Dec 2022 14:54:32 +0100 Subject: [PATCH 4/5] Remove obsolete gitignore file in mysqldyn The Makefile used to be autogenerated prior to 67f76b126900d313b343f563353f8237a6a264d2 which is the reason why the .gitignore existed in the first place. Since then, a static Makefile is used and is supposed to be tracked in the git repo. --- contrib/dlz/modules/mysqldyn/.gitignore | 1 - 1 file changed, 1 deletion(-) delete mode 100644 contrib/dlz/modules/mysqldyn/.gitignore diff --git a/contrib/dlz/modules/mysqldyn/.gitignore b/contrib/dlz/modules/mysqldyn/.gitignore deleted file mode 100644 index f3c7a7c5da..0000000000 --- a/contrib/dlz/modules/mysqldyn/.gitignore +++ /dev/null @@ -1 +0,0 @@ -Makefile From 5b28da7ea0c378435736a8cf4021740055bad3ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Fri, 23 Dec 2022 13:21:47 +0100 Subject: [PATCH 5/5] Detect "ignored yet tracked" files in GitLab CI Ensure that no .gitignore file in the tree contains patterns matching files tracked by Git by adding a simple script that detects such situations and running that script as part of the "misc" job in the "precheck" stage of every GitLab CI pipeline. --- .gitlab-ci.yml | 1 + util/check-gitignore.sh | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 util/check-gitignore.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 54b25ecd14..f874bb6878 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -443,6 +443,7 @@ misc: - test ! -f CHANGES.SE || sh util/check-line-length.sh CHANGES.SE - rm CHANGES.tmp - sh util/check-categories.sh + - sh util/check-gitignore.sh - if git grep SYSTEMTESTTOP -- ':!.gitlab-ci.yml'; then echo 'Please use relative paths instead of $SYSTEMTESTTOP.'; exit 1; fi - bash util/unused-headers.sh - bash util/xmllint-html.sh diff --git a/util/check-gitignore.sh b/util/check-gitignore.sh new file mode 100755 index 0000000000..d273dd464e --- /dev/null +++ b/util/check-gitignore.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +ignored_yet_tracked="$(git ls-files --cached --ignored --exclude-standard | git check-ignore --verbose --stdin --no-index)" + +if [ -n "${ignored_yet_tracked}" ]; then + echo "The following .gitignore files contain patterns matching tracked files:" + echo + echo "${ignored_yet_tracked}" + echo + echo "Please adjust the contents of the above .gitignore files and/or the names of the tracked files." + exit 1 +fi