-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I already broke the tutorial way too often. Add a test case.
- Loading branch information
Showing
4 changed files
with
32 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,23 @@ | ||
async def test_tutorial(vms): | ||
async with vms.hub.ssh_task("not-my-board hub", "hub", wait_ready=True): | ||
async with vms.hub.ssh_task( | ||
"python3 -m http.server -d ./src/tests/tutorial -b localhost 8080", | ||
"http_server", | ||
): | ||
async with vms.hub.ssh_task( | ||
"not-my-board export http://localhost:2092 ./src/tests/tutorial/tutorial-tcp-place.toml", | ||
"export", | ||
wait_ready=True, | ||
): | ||
async with vms.hub.ssh_task_root( | ||
"not-my-board agent http://localhost:2092", "agent", wait_ready=True | ||
): | ||
await vms.hub.ssh( | ||
"doas not-my-board attach ./src/tests/tutorial/tutorial-tcp.toml" | ||
) | ||
|
||
await vms.hub.ssh_poll("nc -z localhost 8080") | ||
result = await vms.hub.ssh( | ||
"wget -qO - http://localhost:8081/hello", prefix="wget" | ||
) | ||
assert result.stdout.rstrip() == "Hello, World!" |
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 @@ | ||
Hello, World! |
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,5 @@ | ||
port = 2192 | ||
|
||
[[parts]] | ||
compatible = [ "tutorial-http-server" ] | ||
tcp.http = { host = "localhost", port = 8080 } |
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,3 @@ | ||
[parts.http-server] | ||
compatible = [ "tutorial-http-server" ] | ||
tcp.http = { local_port = 8081 } |