--- /dev/null
+; 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.
+
+$ORIGIN .
+$TTL 300 ; 5 minutes
+unsigned IN SOA ns.unsigned. hostmaster.unsigned. (
+ 2010080906 ; serial
+ 20 ; refresh (20 seconds)
+ 20 ; retry (20 seconds)
+ 1814400 ; expire (3 weeks)
+ 3600 ; minimum (1 hour)
+ )
+unsigned. 5 NS ns.unsigned.
+ns.unsigned. A 10.53.0.3
+
+data.unsigned. 20 TXT "example org data"
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
+n=$((n + 1))
+echo_i "checking static-stub synthesised NS is not returned ($n)"
+ret=0
+$DIG $DIGOPTS unsigned. @10.53.0.2 ns >dig.out.ns2.ns.test$n || ret=1
+sleep 2
+$DIG $DIGOPTS data.unsigned @10.53.0.2 txt >dig.out.ns2.txt1.test$n || ret=1
+sleep 4
+$DIG $DIGOPTS data.unsigned @10.53.0.2 txt >dig.out.ns2.txt2.test$n || ret=1
+grep "status: NOERROR" dig.out.ns2.ns.test$n >/dev/null || ret=1
+grep "status: NOERROR" dig.out.ns2.txt1.test$n >/dev/null || ret=1
+# NS RRset from zone is returned
+grep '^unsigned\..*NS.ns\.unsigned\.$' dig.out.ns2.txt1.test$n >/dev/null || ret=1
+grep '^unsigned\..*NS.unsigned\.$' dig.out.ns2.txt1.test$n >/dev/null && ret=1
+# NS expired and synthesised response is not returned
+grep "status: NOERROR" dig.out.ns2.txt2.test$n >/dev/null || ret=1
+grep '^unsigned\..*NS.ns\.unsigned\.$' dig.out.ns2.txt2.test$n >/dev/null && ret=1
+grep '^unsigned\..*NS.unsigned\.$' dig.out.ns2.txt2.test$n >/dev/null && ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1