]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: drop old DS records if present
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 26 Aug 2022 16:40:53 +0000 (18:40 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Sat, 27 Aug 2022 09:27:02 +0000 (11:27 +0200)
This makes the test re-runnable without having to go through the cleanup
and setup phases again.

test/units/testsuite-75.sh

index 43741227e13dc5ccbe1df010550d758fb4fce547..844661538353025f8ca48451dd3bc46b4f677781 100755 (executable)
@@ -72,9 +72,14 @@ resolvectl log-level debug
 # We need to manually propagate the DS records of onlinesign.test. to the parent
 # zone, since they're generated online
 knotc zone-begin test.
+if knotc zone-get test. onlinesign.test. ds | grep .; then
+    # Drop any old DS records, if present (e.g. on test re-run)
+    knotc zone-unset test. onlinesign.test. ds
+fi
+# Propagate the new DS records
 while read -ra line; do
     knotc zone-set test. "${line[@]}"
-done < <(keymgr onlinesign.test ds)
+done < <(keymgr onlinesign.test. ds)
 knotc zone-commit test.
 
 ### SETUP END ###