Skip to content

Commit fde6d79

Browse files
committed
fixup! fixup! manager: files: watchdog: added RPZ files
1 parent 47fe20d commit fde6d79

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

tests/packaging/interactive/rpz_watchdog.sh

+11-14
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ set -e
44

55
gitroot=$(git rev-parse --show-toplevel)
66
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-
)
157

168
rpz_example=$(cat <<EOF
179
\$ORIGIN RPZ.EXAMPLE.ORG.
@@ -22,8 +14,16 @@ EOF
2214
# create example RPZ
2315
echo "$rpz_example" >> $rpz_file
2416

17+
rpz_conf=$(cat <<EOF
18+
local-data:
19+
rpz:
20+
- file: $rpz_file
21+
watchdog: false
22+
EOF
23+
)
24+
2525
# configure RPZ file
26-
kresctl config set -p /local-data "$rpz_conf"
26+
echo "$rpz_conf" >> /etc/knot-resolver/config.yaml
2727
if [ "$?" -ne "0" ]; then
2828
echo "Could not set RPZ."
2929
exit 1
@@ -37,12 +37,11 @@ function count_reloads(){
3737
echo "$(journalctl -u knot-resolver.service | grep -c "Policy rules reloaded")"
3838
}
3939

40-
# test that files watchdog is turned off
40+
# test that RPZ watchdog is turned off
4141
# {{
4242

4343
err_count=$(count_errors)
4444
rel_count=$(count_reloads)
45-
sleep 6
4645

4746
if [ $(count_errors) -ne $err_count ] || [ $(count_reloads) -ne $rel_count ]; then
4847
echo "RPZ file watchdog is running (should not) or other errors occurred."
@@ -61,9 +60,7 @@ fi
6160
# test modification
6261
# {{
6362

64-
rel_count=$(count_reloads)
65-
66-
# modify certificate files with '-', it will trigger reload
63+
# modify RPZ file, it will trigger reload
6764
rel_count=$(count_reloads)
6865
echo "32.1.2.0.192.rpz-client-ip CNAME rpz-passthru." >> $rpz_file
6966

0 commit comments

Comments
 (0)