This was implemented by containers/netavark #1369; this commit completes the process by wiring it into Podman. We now respect the CLI order for configured networks - if a user passes `--net net1,net2` we guarantee that net1 will be configured before net2. For containers created before this patch, we don't retain enough information to configure networks in CLI order, so we use alphabetical order instead to still guarantee consistency. No breaking API changes have been made, but we do add a new field to supplement the existing map to (optionally) provide ordering information. The Podman CLI will always pass this. Existing applications that do not will, again, receive] deterministic ordering based on an alphabetical sort of network names. This requires the latest version of Netavark to work properly. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Running the machine tests
This document is a quick how-to run machine tests. Not all dependencies, like
gvproxy are documented. You must install gvproxy in all cases described
below.
General notes
Environment must be clean
You must not have any machines defined before running tests. Consider running
podman machine reset prior to running tests.
Scoping tests
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:
./winmake localmachine "basic_test.go start_test.go"
To focus on one specific test on windows, run ginkgo manually:
$remotetags = "remote exclude_graphdriver_btrfs containers_image_openpgp"
$focus_file = "basic_test.go"
$focus_test = "podman build contexts"
./test/tools/build/ginkgo.exe `
-v --tags "$remotetags" -timeout=90m --trace --no-color `
--focus-file $focus_file `
--focus "$focus_test" `
./pkg/machine/e2e/.
Note that ginkgo.exe is built when running the command
winmake.ps1 localmachine so make sure to run it before trying the command
above.
Linux
QEMU
make localmachine
Microsoft Windows
Hyper-V
- Open a powershell as admin
.\winmake.ps1 podman-remote && .\winmake.ps1 win-gvproxy$env:CONTAINERS_HELPER_BINARY_DIR="$pwd\bin\windows"$env:CONTAINERS_MACHINE_PROVIDER="hyperv".\winmake localmachine
WSL
- Open a powershell as a regular user
.\winmake.ps1 podman-remote && .\winmake.ps1 win-gvproxy$env:CONTAINERS_HELPER_BINARY_DIR="$pwd\bin\windows"$env:CONTAINERS_MACHINE_PROVIDER="wsl".\winmake localmachine
MacOS
Macs now support two different machine providers: applehv and libkrun. The
libkrun provider is the default.
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.
Apple Hypervisor
brew install vfkitmake podman-remoteexport CONTAINERS_MACHINE_PROVIDER="applehv"make localmachine
Libkrun
brew install krunkitmake podman-remotemake localmachine