-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
72f4aec
commit fe9bb9f
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# run.py | ||
|
||
A handy tool to run tests in and interact with Equinix devices. | ||
|
||
Install dependencies: | ||
|
||
```bash | ||
pip3 install -r test/tools/requirements.txt | ||
``` | ||
|
||
Run the tool: | ||
|
||
```bash | ||
./test/tools/run.py | ||
Usage: run.py [OPTIONS] COMMAND [ARGS]... | ||
|
||
General thing doer for flintlock | ||
|
||
Options: | ||
--help Show this message and exit. | ||
|
||
Commands: | ||
create-device | ||
delete-device | ||
run-e2e | ||
``` | ||
|
||
Run `--help` on all those subcommands to see the run options. | ||
|
||
For all commands you will need your Organisation ID and to set your API token | ||
in the environment as `METAL_AUTH_TOKEN`. | ||
|
||
## Running the e2es | ||
|
||
```bash | ||
export METAL_AUTH_TOKEN=<your token> | ||
./test/tools/run.py run-e2e --org-id <your org id> | ||
``` | ||
|
||
This will: | ||
- Create a new project in your org | ||
- Create a new ssh key, saving the files locally for debugging | ||
- Create a new device | ||
- Bootstrap the device with userdata | ||
- Wait for the device to be running | ||
- Wait for the userdata to complete bootstrapping | ||
- Run the e2e tests, streaming the output | ||
- Delete the device, key, and project | ||
|
||
To keep the device around for debugging, add `--skip-delete`. | ||
|
||
To not creating anything new and run the tests in an existing device, set `--existing-device-id <id>`. | ||
|
||
## Creating a device | ||
|
||
```bash | ||
export METAL_AUTH_TOKEN=<your token> | ||
./test/tools/run.py create-device --org-id <your org id> --project-id <existing project-id> | ||
``` | ||
|
||
This will create a device in an existing project bootstrapped with the default userdata. | ||
You can use `--userdata` to override this. | ||
|
||
Nothing will be cleaned up afterwards. | ||
|
||
## Deleting a device | ||
|
||
```bash | ||
export METAL_AUTH_TOKEN=<your token> | ||
./test/tools/run.py delete-device --org-id <your org id> --device-id <existing project-id> | ||
``` | ||
|
||
This will delete the given device. The project will not be deleted. |