From 01c87ab00fe79188338786cf399591aa5bc5378b Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Sun, 22 Sep 2024 15:33:19 -0400 Subject: [PATCH] mantle/kolet: Use PathChanged instead of PathExists The previous code (changed in 4f4dfe6) copied to a partial file and then renamed which meant PathExists would trigger as soon as the file path exists, which was too soon because the file is still copying. PathChanged seems to work for our purposes here since it will trigger when the file is closed after it is done writing. --- docs/kola/external-tests.md | 5 +++-- mantle/kola/tests/upgrade/basic.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/kola/external-tests.md b/docs/kola/external-tests.md index 6b0b89ace1..4fbf79edc2 100644 --- a/docs/kola/external-tests.md +++ b/docs/kola/external-tests.md @@ -138,7 +138,8 @@ In the following Fedora CoreOS config example, the Ignition config includes a path unit and a service unit. The path unit ensures that the httpd service runs automatically once the Kolet binary is copied to the system. Note that the path unit has a `Before=` dependency on `kola-runext.service` to ensure that the -server is brought up before the test is run. +server is brought up before the test is run. Note also that `PathChanged` will +trigger once the `kolet` binary has finished copying to the system. An HTTP server will be started at `localhost` and serve the files in `/var/www/`. Your test can then do e.g. `curl localhost/hello_world.txt`. @@ -154,7 +155,7 @@ systemd: [Unit] Before=kola-runext.service [Path] - PathExists=/usr/local/bin/kolet + PathChanged=/usr/local/bin/kolet [Install] WantedBy=kola-runext.service - name: kolet-httpd.service diff --git a/mantle/kola/tests/upgrade/basic.go b/mantle/kola/tests/upgrade/basic.go index fa58ba530f..b3eb5bffcf 100644 --- a/mantle/kola/tests/upgrade/basic.go +++ b/mantle/kola/tests/upgrade/basic.go @@ -80,7 +80,7 @@ func init() { { "name": "kolet-httpd.path", "enabled": true, - "contents": "[Path]\nPathExists=/usr/local/bin/kolet\n[Install]\nWantedBy=multi-user.target" + "contents": "[Path]\nPathChanged=/usr/local/bin/kolet\n[Install]\nWantedBy=multi-user.target" }, { "name": "kolet-httpd.service",