]> git.ipfire.org Git - people/ms/network.git/commitdiff
tests: Always dump the environment
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 Jun 2023 09:38:35 +0000 (09:38 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 Jun 2023 09:38:35 +0000 (09:38 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
test/networkd/test.sh

index 7690978d8597710d8a87d4a62aec6026f5fe5e7b..9cecf0a4cba2aac44758c904f42db0cfcb79ae9a 100644 (file)
@@ -64,6 +64,9 @@ launch_networkd() {
 
        echo "networkd launched as PID ${networkd_PID}"
 
+       # Wait until networkd is initialized
+       # XXX Calling sleep(8) is very racy and should be replaced by something that
+       # waits until networkd has connected to dbus
        sleep 1
 }
 
@@ -100,6 +103,9 @@ terminate_networkd() {
        fi
 }
 
+# Collect some status information
+trap dump_status EXIT
+
 main() {
        local test="${1}"
        shift
@@ -128,9 +134,6 @@ main() {
        # Terminate networkd
        terminate_networkd
 
-       # Collect some status information
-       dump_status
-
        # Run cleanup script
        if ! run_script "${test}/cleanup.sh"; then
                return 1