File tree 1 file changed +11
-14
lines changed
tests/packaging/interactive
1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change 4
4
5
5
gitroot=$( git rev-parse --show-toplevel)
6
6
rpz_file=$gitroot /example.rpz
7
- rpz_conf=" [{ 'file': '$rpz_file ' }]"
8
-
9
- rpz_conf=$( cat << EOF
10
- { "rpz": [
11
- { "file": "$rpz_file " }
12
- ]}
13
- EOF
14
- )
15
7
16
8
rpz_example=$( cat << EOF
17
9
\$ ORIGIN RPZ.EXAMPLE.ORG.
22
14
# create example RPZ
23
15
echo " $rpz_example " >> $rpz_file
24
16
17
+ rpz_conf=$( cat << EOF
18
+ local-data:
19
+ rpz:
20
+ - file: $rpz_file
21
+ watchdog: false
22
+ EOF
23
+ )
24
+
25
25
# configure RPZ file
26
- kresctl config set -p /local-data " $rpz_conf "
26
+ echo " $rpz_conf " >> /etc/knot-resolver/config.yaml
27
27
if [ " $? " -ne " 0" ]; then
28
28
echo " Could not set RPZ."
29
29
exit 1
@@ -37,12 +37,11 @@ function count_reloads(){
37
37
echo " $( journalctl -u knot-resolver.service | grep -c " Policy rules reloaded" ) "
38
38
}
39
39
40
- # test that files watchdog is turned off
40
+ # test that RPZ watchdog is turned off
41
41
# {{
42
42
43
43
err_count=$( count_errors)
44
44
rel_count=$( count_reloads)
45
- sleep 6
46
45
47
46
if [ $( count_errors) -ne $err_count ] || [ $( count_reloads) -ne $rel_count ]; then
48
47
echo " RPZ file watchdog is running (should not) or other errors occurred."
61
60
# test modification
62
61
# {{
63
62
64
- rel_count=$( count_reloads)
65
-
66
- # modify certificate files with '-', it will trigger reload
63
+ # modify RPZ file, it will trigger reload
67
64
rel_count=$( count_reloads)
68
65
echo " 32.1.2.0.192.rpz-client-ip CNAME rpz-passthru." >> $rpz_file
69
66
You can’t perform that action at this time.
0 commit comments