summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgregor herrmann <gregoa@debian.org>2023-10-29 17:53:34 +0100
committergregor herrmann <gregoa@debian.org>2023-10-29 17:55:23 +0100
commit6333e4667475957119aae4e7bdc68b87e4c16f75 (patch)
tree7ab9a72d1c4673ce06a05462cb8cac0c8380f4c3
parent8e35bf612bd27becc2d69cb1ce8f6cf3c96d6f11 (diff)
Disable querying of external nameservers during build tests.
Set RES_NAMESERVERS and RES_OPTIONS in debian/rules, additionally patch t/05_api_4.t, which has nameservers hardcoded, to honour NO_NETWORK_TESTING. Thanks: Sven Mueller for the bug report. Closes: #1055023
-rw-r--r--debian/patches/no_network.patch25
-rw-r--r--debian/patches/series1
-rwxr-xr-xdebian/rules4
3 files changed, 30 insertions, 0 deletions
diff --git a/debian/patches/no_network.patch b/debian/patches/no_network.patch
new file mode 100644
index 0000000..df05c75
--- /dev/null
+++ b/debian/patches/no_network.patch
@@ -0,0 +1,25 @@
+Description: skip test with external nameservers if NO_NETWORK_TESTING is set
+Origin: vendor
+Bug-Debian: https://bugs.debian.org/1055023
+Forwarded: not-needed
+Author: gregor herrmann <gregoa@debian.org>
+Last-Update: 2023-10-29
+
+--- a/t/05_api_4.t
++++ b/t/05_api_4.t
+@@ -61,12 +61,15 @@
+ timeout => 0.001,
+ );
+
++SKIP: {
++ skip "NO_NETWORK_TESTING set", 1 if $ENV{NO_NETWORK_TESTING};
+ $resolver->resolve(
+ event => "response",
+ host => "google.com",
+ context => $request++,
+ nameservers => ['8.8.8.8', '8.8.4.4'],
+ );
++};
+ }
+
+ sub got_response {
diff --git a/debian/patches/series b/debian/patches/series
index be173b6..5b7318d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
net-dns-1.38-deprecations.patch
+no_network.patch
diff --git a/debian/rules b/debian/rules
index 2d33f6a..10c7296 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,3 +2,7 @@
%:
dh $@
+
+override_dh_auto_test:
+ # disable DNS queries
+ RES_NAMESERVERS="" RES_OPTIONS=attempts:0 NO_NETWORK_TESTING=1 dh_auto_test