1 # #-- 07-confroot.test --#
2 # source the master var file when it's there
3 [ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
4 # use .tpkg.var.test for in test variable passing
5 [ -f .tpkg.var.test ] && source .tpkg.var.test
9 if uname | grep "MINGW" >/dev/null; then
10 # no chroot, no need to test.
11 # (test fails on / en \ comparisons, by the way).
12 echo "no chroot on windows, end test"
21 if test $? -ne 0; then
22 echo "could not create subdir"
32 pidfile: "/unbound.pid"
34 root-hints: "$subdir/root.cb"
35 root-hints: "/subdir/root.cc"
39 trust-anchor-file: "$subdir/trustanchor.conf"
40 trust-anchor-file: "/subdir/trustanchor.conf"
41 trust-anchor-file: "trustanchor.conf"
43 trusted-keys-file: "trustkeys.conf"
44 trusted-keys-file: "$subdir/trustkeys2.conf"
45 trusted-keys-file: "/subdir/trustkeys3.conf"
49 echo ". NS a.root-servers.net." > subdir/root.ca
50 echo "a.root-servers.net. IN A 127.0.0.1" >> subdir/root.ca
51 echo ". CH NS b.root-servers.net." > subdir/root.cb
52 echo "b.root-servers.net. CH A 127.0.0.1" >> subdir/root.cb
53 echo ". HS NS c.root-servers.net." > subdir/root.cc
54 echo "c.root-servers.net. HS A 127.0.0.1" >> subdir/root.cc
55 echo "" > subdir/trustkeys.conf
56 echo "" > subdir/trustkeys2.conf
57 echo "" > subdir/trustkeys3.conf
58 echo "" > subdir/trustanchor.conf
59 echo "" > subdir/trustanchor2.conf
60 echo "" > subdir/trustanchor3.conf
62 $PRE/unbound-checkconf test.conf
63 if test $? -ne 0; then
64 echo "Checkconf of config with chroot inside it failed"
77 pidfile: "/unbound.pid"
79 root-hints: "$subdir/root.cb"
80 root-hints: "/subdir/root.cc"
84 trust-anchor-file: "$subdir/trustanchor.conf"
85 trust-anchor-file: "/subdir/trustanchor.conf"
86 trust-anchor-file: "trustanchor.conf"
88 trusted-keys-file: "trustkeys.conf"
89 trusted-keys-file: "$subdir/trustkeys2.conf"
90 trusted-keys-file: "/subdir/trustkeys3.conf"
93 $PRE/unbound-checkconf test.conf
94 if test $? -ne 0; then
95 echo "Checkconf of config with chroot inside it failed"
102 cat > test.conf <<EOF
108 pidfile: "/unbound.pid"
109 root-hints: "root.ca"
110 root-hints: "$subdir/root.cb"
111 root-hints: "/subdir/root.cc"
113 logfile: "output.log"
115 trust-anchor-file: "$subdir/trustanchor.conf"
116 trust-anchor-file: "/subdir/trustanchor.conf"
117 trust-anchor-file: "trustanchor.conf"
119 trusted-keys-file: "trustkeys.conf"
120 trusted-keys-file: "$subdir/trustkeys2.conf"
121 trusted-keys-file: "/subdir/trustkeys3.conf"
124 $PRE/unbound-checkconf test.conf
125 if test $? -ne 0; then
126 echo "Checkconf of config with chroot inside it failed"
133 cat > test.conf <<EOF
136 directory: "./subdir"
139 pidfile: "/unbound.pid"
140 root-hints: "root.ca"
141 #root-hints: "$subdir/root.cb"
142 root-hints: "/subdir/root.cc"
144 logfile: "output.log"
146 #trust-anchor-file: "$subdir/trustanchor.conf"
147 trust-anchor-file: "/subdir/trustanchor.conf"
148 trust-anchor-file: "trustanchor.conf"
150 trusted-keys-file: "trustkeys.conf"
151 #trusted-keys-file: "$subdir/trustkeys2.conf"
152 trusted-keys-file: "/subdir/trustkeys3.conf"
155 $PRE/unbound-checkconf test.conf
156 if test $? -ne 0; then
157 echo "Checkconf of config with chroot inside it failed"
164 cat > test.conf <<EOF
170 pidfile: "/unbound.pid"
171 root-hints: "root.ca"
172 root-hints: "$subdir/root.cb"
173 #root-hints: "/subdir/root.cc"
175 logfile: "output.log"
177 trust-anchor-file: "$subdir/trustanchor.conf"
178 #trust-anchor-file: "/subdir/trustanchor.conf"
179 trust-anchor-file: "trustanchor.conf"
181 trusted-keys-file: "trustkeys.conf"
182 trusted-keys-file: "$subdir/trustkeys2.conf"
183 #trusted-keys-file: "/subdir/trustkeys3.conf"
186 $PRE/unbound-checkconf test.conf
187 if test $? -ne 0; then
188 echo "Checkconf of config with chroot inside it failed"
195 cat > test.conf <<EOF
201 pidfile: "/unbound.pid"
202 #root-hints: "root.ca"
203 root-hints: "$subdir/root.cb"
204 root-hints: "subdir/root.cc"
206 logfile: "output.log"
208 trust-anchor-file: "$subdir/trustanchor.conf"
209 trust-anchor-file: "subdir/trustanchor.conf"
210 #trust-anchor-file: "trustanchor.conf"
212 #trusted-keys-file: "trustkeys.conf"
213 trusted-keys-file: "$subdir/trustkeys2.conf"
214 trusted-keys-file: "subdir/trustkeys3.conf"
217 $PRE/unbound-checkconf test.conf
218 if test $? -ne 0; then
219 echo "Checkconf of config with chroot inside it failed"
226 cat > test.conf <<EOF
232 pidfile: "/nosubdir/unbound.pid"
233 #root-hints: "root.ca"
234 #root-hints: "$subdir/root.cb"
235 root-hints: "subdir/root.cc"
237 logfile: "output.log"
239 #trust-anchor-file: "$subdir/trustanchor.conf"
240 trust-anchor-file: "subdir/trustanchor.conf"
241 #trust-anchor-file: "trustanchor.conf"
243 #trusted-keys-file: "trustkeys.conf"
244 #trusted-keys-file: "$subdir/trustkeys2.conf"
245 trusted-keys-file: "subdir/trustkeys3.conf"
248 $PRE/unbound-checkconf test.conf
249 if test $? -ne 1; then
250 echo "Checkconf of config with chroot inside it failed"
257 cat > test.conf <<EOF
263 pidfile: "/unbound.pid"
264 #root-hints: "root.ca"
265 root-hints: "$subdir/root.cb"
266 root-hints: "/subdir/root.cc"
268 logfile: "output.log"
270 trust-anchor-file: "$subdir/trustanchor.conf"
271 trust-anchor-file: "/subdir/trustanchor.conf"
272 #trust-anchor-file: "trustanchor.conf"
274 #trusted-keys-file: "trustkeys.conf"
275 trusted-keys-file: "$subdir/trustkeys2.conf"
276 trusted-keys-file: "/subdir/trustkeys3.conf"
279 $PRE/unbound-checkconf test.conf
280 if test $? -ne 0; then
281 echo "Checkconf of config with chroot inside it failed"