test(windows): make sure files are written to the right paths during smoke tests (#3727)

I will need to set up the same paths for Linux, (#3734) and I want an
automated test to make sure everything gets into the right directories.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
This commit is contained in:
Reactor Scram
2024-02-23 10:14:20 -06:00
committed by GitHub
parent 4ecdde3653
commit 90b2bdb9b1
5 changed files with 34 additions and 11 deletions

View File

@@ -7,9 +7,24 @@ BUNDLE_ID="dev.firezone.client"
DUMP_PATH="$LOCALAPPDATA/$BUNDLE_ID/data/logs/last_crash.dmp"
PACKAGE=firezone-gui-client
if [[ -z "$ProgramData" ]]; then
echo "The env var \$ProgramData should be set to \`C:\ProgramData\` or similar"
exit 1
fi
# Make sure the files we want to check don't exist on the system yet
stat "$LOCALAPPDATA/$BUNDLE_ID" && exit 1
stat "$ProgramData/$BUNDLE_ID" && exit 1
# Run the smoke test normally
cargo run -p "$PACKAGE" -- smoke-test
# Make sure the files were written in the right paths
stat "$LOCALAPPDATA/$BUNDLE_ID/config/advanced_settings.json"
stat "$LOCALAPPDATA/$BUNDLE_ID/data/logs/"connlib*log
stat "$LOCALAPPDATA/$BUNDLE_ID/data/wintun.dll"
stat "$ProgramData/$BUNDLE_ID/config/device_id.json"
# Delete the crash file if present
rm -f "$DUMP_PATH"