Replace duplicated code snippet with calls to helper functions

Reduce code duplication by replacing a code snippet repeated throughout
system tests using "trusted-keys" and/or "managed-keys" configuration
sections with calls to keyfile_to_{managed,trusted}_keys() helper
functions.
This commit is contained in:
Michał Kępień
2018-06-13 07:47:12 +02:00
parent 2392b8bc7d
commit 120af964ce
21 changed files with 34 additions and 270 deletions

View File

@@ -32,12 +32,4 @@ cat $infile $keyname.key > $zonefile
$SIGNER -P -g -o $zone $zonefile > /dev/null
# Configure the resolving server with a trusted key.
cat $keyname.key | grep -v '^; ' | $PERL -n -e '
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
local $key = join("", @rest);
print <<EOF
trusted-keys {
"$dn" $flags $proto $alg "$key";
};
EOF
' > trusted.conf
keyfile_to_trusted_keys $keyname > trusted.conf