|
1 | 1 | # Running the machine tests
|
2 | 2 |
|
3 |
| -This document is a quick how-to run machine tests. Not all dependencies, like |
4 |
| -`gvproxy` are documented. You must install `gvproxy` in all cases described below. |
| 3 | +This document is a quick how-to run machine tests. Not all dependencies, like |
| 4 | +`gvproxy` are documented. You must install `gvproxy` in all cases described |
| 5 | +below. |
5 | 6 |
|
6 | 7 | ## General notes
|
7 | 8 |
|
8 | 9 | ### Environment must be clean
|
9 |
| -You must not have any machines defined before running tests. Consider running `podman machine reset` prior to running tests. |
| 10 | + |
| 11 | +You must not have any machines defined before running tests. Consider running |
| 12 | +`podman machine reset` prior to running tests. |
| 13 | + |
| 14 | +### |
10 | 15 |
|
11 | 16 | ### Scoping tests
|
12 |
| -You can scope tests in the machine suite by adding various incantations of `FOCUS=`. For example, add `FOCUS_FILE=basic_test.go` to only run basic test. Or add `FOCUS="simple init with start"` to only run one test case. For windows, the syntax differs slightly. In windows, executing something like following achieves the same result: |
| 17 | + |
| 18 | +You can scope tests in the machine suite by adding various incantations of |
| 19 | +`FOCUS=`. For example, add `FOCUS_FILE=basic_test.go` to only run basic test. Or |
| 20 | +add `FOCUS="simple init with start"` to only run one test case. For windows, the |
| 21 | +syntax differs slightly. In windows, executing something like following achieves |
| 22 | +the same result: |
13 | 23 |
|
14 | 24 | `./winmake localmachine "basic_test.go start_test.go"`
|
15 | 25 |
|
| 26 | +To focus on one specific test on windows, run `ginkgo` manually: |
| 27 | + |
| 28 | +```pwsh |
| 29 | +$remotetags = "remote exclude_graphdriver_btrfs btrfs_noversion exclude_graphdriver_devicemapper containers_image_openpgp" |
| 30 | +$focus_file = "basic_test.go" |
| 31 | +$focus_test = "podman build contexts" |
| 32 | +./test/tools/build/ginkgo.exe ` |
| 33 | + -v --tags "$remotetags" -timeout=90m --trace --no-color ` |
| 34 | + --focus-file $focus_file ` |
| 35 | + --focus "$focus_test" ` |
| 36 | + ./pkg/machine/e2e/. |
| 37 | +``` |
| 38 | + |
| 39 | +Note that ginkgo.exe is built when running the command |
| 40 | +`winmake.ps1 localmachine` so make sure to run it before trying the command |
| 41 | +above. |
| 42 | + |
16 | 43 | ## Linux
|
17 | 44 |
|
18 | 45 | ### QEMU
|
19 |
| -1. `make localmachine` |
20 | 46 |
|
| 47 | +1. `make localmachine` |
21 | 48 |
|
22 | 49 | ## Microsoft Windows
|
23 | 50 |
|
24 | 51 | ### Hyper-V
|
| 52 | + |
25 | 53 | 1. Open a powershell as admin
|
| 54 | +1. `.\winmake.ps1 podman-remote && .\winmake.ps1 win-gvproxy` |
| 55 | +1. `$env:CONTAINERS_HELPER_BINARY_DIR="$pwd\bin\windows"` |
26 | 56 | 1. `$env:CONTAINERS_MACHINE_PROVIDER="hyperv"`
|
27 |
| -1. `./winmake localmachine` |
28 |
| - |
| 57 | +1. `.\winmake localmachine` |
29 | 58 |
|
30 | 59 | ### WSL
|
| 60 | + |
31 | 61 | 1. Open a powershell as a regular user
|
32 |
| -1. Build and copy win-sshproxy into bin/ |
33 |
| -1. `./winmake localmachine` |
| 62 | +1. `.\winmake.ps1 podman-remote && .\winmake.ps1 win-gvproxy` |
| 63 | +1. `$env:CONTAINERS_HELPER_BINARY_DIR="$pwd\bin\windows"` |
| 64 | +1. `$env:CONTAINERS_MACHINE_PROVIDER="wsl"` |
| 65 | +1. `.\winmake localmachine` |
34 | 66 |
|
35 | 67 | ## MacOS
|
36 |
| -Macs now support two different machine providers: `applehv` and `libkrun`. The `applehv` provider is the default. |
37 | 68 |
|
38 |
| -Note: On macOS, an error will occur if the path length of `$TMPDIR` is longer than 22 characters. Please set the appropriate path to `$TMPDIR`. Also, if `$TMPDIR` is empty, `/private/tmp` will be set. |
| 69 | +Macs now support two different machine providers: `applehv` and `libkrun`. The |
| 70 | +`applehv` provider is the default. |
| 71 | + |
| 72 | +Note: On macOS, an error will occur if the path length of `$TMPDIR` is longer |
| 73 | +than 22 characters. Please set the appropriate path to `$TMPDIR`. Also, if |
| 74 | +`$TMPDIR` is empty, `/private/tmp` will be set. |
39 | 75 |
|
40 | 76 | ### Apple Hypervisor
|
| 77 | + |
41 | 78 | 1. `brew install vfkit`
|
42 | 79 | 1. `make podman-remote`
|
43 | 80 | 1. `make localmachine`
|
44 | 81 |
|
45 |
| - |
46 | 82 | ### [Libkrun](https://github.com/containers/libkrun)
|
| 83 | + |
47 | 84 | 1. `brew install krunkit`
|
48 | 85 | 1. `make podman-remote`
|
49 | 86 | 1. `export CONTAINERS_MACHINE_PROVIDER="libkrun"`
|
|
0 commit comments