Skip to content

Commit

Permalink
Add instructions to use ngrok for migration testing (#25420)
Browse files Browse the repository at this point in the history
Adding some capabilities to test migration locally with ngrok. To test
HTTPS.
  • Loading branch information
lucasmrod authored Jan 14, 2025
1 parent ca15cbe commit f170528
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
15 changes: 14 additions & 1 deletion tools/tuf/test/migration/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# `migration_test.sh`

This script is used to test the migration from one local TUF repository to a new local TUF repository (with new roots).
The "old" TUF will be hosted on port 8081, and the new TUF will be hosted on port 8082.

> Currently supports running on macOS only.
Expand All @@ -15,7 +16,19 @@ LINUX_HOST_HOSTNAME=foobar-ubuntu \
./tools/tuf/test/migration/migration_test.sh
```

To simulate an outage of the TUF during the migration run the above with:
To test TUFs with HTTPS instead of HTTP with two ngrok tunnels that connect to 8081/8082:
```sh
OLD_TUF_URL=https://121e9b4a4dab.ngrok.app \
NEW_TUF_URL=https://12oe8b5b3cc6.ngrok.app \
```

To simulate an outage of the new TUF server during the migration run the above with:
```sh
SIMULATE_NEW_TUF_OUTAGE=1 \
```

To simulate an outage of the new TUF server during the migration and a "need" to patch orbit on the old repository:
```sh
SIMULATE_NEW_TUF_OUTAGE=1 \
ORBIT_PATCH_IN_OLD_TUF=1 \
```
12 changes: 10 additions & 2 deletions tools/tuf/test/migration/migration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,21 @@ sudo orbit/tools/cleanup/cleanup_macos.sh
prompt "Please manually uninstall fleetd from $WINDOWS_HOST_HOSTNAME and $LINUX_HOST_HOSTNAME."

OLD_TUF_PORT=8081
OLD_TUF_URL=http://host.docker.internal:$OLD_TUF_PORT
if [ -z "$OLD_TUF_URL" ]; then
OLD_TUF_URL=http://host.docker.internal:$OLD_TUF_PORT
else
echo "Using the provided URL '$OLD_TUF_URL' for the old TUF server"
fi
OLD_TUF_PATH=test_tuf_old
OLD_FULL_VERSION=1.37.0
OLD_MINOR_VERSION=1.37

NEW_TUF_PORT=8082
NEW_TUF_URL=http://host.docker.internal:$NEW_TUF_PORT
if [ -z "$NEW_TUF_URL" ]; then
NEW_TUF_URL=http://host.docker.internal:$NEW_TUF_PORT
else
echo "Using the provided URL '$NEW_TUF_URL' for the new TUF server"
fi
NEW_TUF_PATH=test_tuf_new
NEW_FULL_VERSION=1.38.0
NEW_MINOR_VERSION=1.38
Expand Down

0 comments on commit f170528

Please sign in to comment.