podman/pkg/machine/e2e
Kir Kolyshkin f18c917ef8 ci: run golangci-lint on freebsd
This could have been done by simply running

	GOOS=freebsd ./bin/golangci-lint run [options] ./...

on Linux, but some freebsd code is using cgo (i.e. is linked to C
libraries), so real freebsd environment is required.

This also fixes the issue of ignoring linter errors for Windows and
Darwin (exit 0), introduced by commit c9b108d5b3.

Fixes: c9b108d5b3 ("Bump golangci-lint to v2.0.2")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-04-03 09:24:58 -07:00
..
scripts Improve platform specific URL handling in `podman compose` for machines 2024-12-02 20:46:51 +02:00
README.md Remove exclude_graphdriver_devicemapper build tag 2025-03-30 00:30:03 -07:00
api_test.go Implement publishing API UNIX socket on Windows platforms 2024-08-31 17:27:05 +03:00
basic_test.go fix: mounting issue with single character volume on windows 2025-03-26 17:57:52 +01:00
compose_test.go Improve platform specific URL handling in `podman compose` for machines 2024-12-02 20:46:51 +02:00
config_basic_test.go update golangci-lint to v1.62.0 2024-11-11 14:21:17 +01:00
config_compose_test.go Improve platform specific URL handling in `podman compose` for machines 2024-12-02 20:46:51 +02:00
config_cp_test.go Introduce `podman machine cp` command 2025-02-28 09:56:46 -05:00
config_darwin_test.go machine: Add -all-providers flag to machine list 2024-08-28 13:40:50 -04:00
config_freebsd_test.go ci: run golangci-lint on freebsd 2025-04-03 09:24:58 -07:00
config_help_test.go Remove `.exe` suffix if any 2025-01-14 11:53:19 -08:00
config_info_test.go enable linter for pkg/machine/e2e 2022-07-21 18:04:10 +02:00
config_init_test.go pkg/machine: fix various linter warnings 2025-03-31 12:27:55 -07:00
config_inspect_test.go Fix machine inspect test config 2024-01-11 11:42:54 -05:00
config_linux_test.go machine: Add -all-providers flag to machine list 2024-08-28 13:40:50 -04:00
config_list_test.go machine: Add -all-providers flag to machine list 2024-08-28 13:40:50 -04:00
config_os_apply_test.go Introduce podman machine os apply 2023-02-15 14:48:12 -05:00
config_reset_test.go Codespell code 2024-02-19 15:23:56 -05:00
config_rm_test.go Use single persistent ssh key for all machines 2024-01-04 23:47:49 -05:00
config_set_test.go Update machine init/set tests 2023-08-25 11:28:07 -04:00
config_ssh_test.go update golangci-lint to v1.62.0 2024-11-11 14:21:17 +01:00
config_start_test.go update golangci-lint to v1.62.0 2024-11-11 14:21:17 +01:00
config_stop_test.go enable linter for pkg/machine/e2e 2022-07-21 18:04:10 +02:00
config_system_connection_list_test.go update golangci-lint to v1.62.0 2024-11-11 14:21:17 +01:00
config_test.go pkg/machine/e2e: move windows-specific function to windows file 2025-03-31 12:27:55 -07:00
config_unix_test.go Prune FCOS related code 2024-02-15 21:05:17 -06:00
config_windows_test.go pkg/machine/e2e: fix unparam warnings 2025-03-31 12:27:55 -07:00
cp_test.go Fix flake on machine cp e2e test 2025-03-18 14:45:43 +01:00
help_test.go pkg/machine/e2e: improve podman.exe match 2025-01-20 19:50:14 +01:00
info_test.go pkg/machine/e2e: fix broken cleanup 2024-07-01 14:23:11 +02:00
init_test.go pkg/machine/e2e: add missing withImage() 2025-03-26 15:10:04 +01:00
init_windows_test.go pkg/machine/e2e: fix unparam warnings 2025-03-31 12:27:55 -07:00
inspect_test.go Cover Unix socket in inpect test on Windows platform 2024-11-29 18:01:38 +02:00
list_test.go pkg/machine/e2e: improve "list machine from all providers" 2025-01-20 19:50:07 +01:00
machine_pull_test.go Clean machine pull cache 2024-04-26 12:31:42 -04:00
machine_test.go Improve platform specific URL handling in `podman compose` for machines 2024-12-02 20:46:51 +02:00
os_test.go update golangci-lint to v1.62.0 2024-11-11 14:21:17 +01:00
proxy_test.go Quote systemd DefaultEnvironment Proxy values, as documented in systemd.conf man page: 2024-08-26 13:12:47 +02:00
reset_test.go pkg/machine/e2e: fix broken cleanup 2024-07-01 14:23:11 +02:00
rm_test.go Modify machine "Remove machine" test 2024-09-25 10:28:54 -04:00
set_test.go pkg/machine/e2e: fix broken cleanup 2024-07-01 14:23:11 +02:00
ssh_test.go Honor rootfulness when SSH-ing into named Machine 2025-03-14 13:48:49 -04:00
start_test.go Prevent two podman machines running on darwin 2025-01-29 13:24:18 -06:00
stop_test.go pkg/machine/e2e: fix broken cleanup 2024-07-01 14:23:11 +02:00

README.md

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 btrfs_noversion 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

  1. make localmachine

Microsoft Windows

Hyper-V

  1. Open a powershell as admin
  2. .\winmake.ps1 podman-remote && .\winmake.ps1 win-gvproxy
  3. $env:CONTAINERS_HELPER_BINARY_DIR="$pwd\bin\windows"
  4. $env:CONTAINERS_MACHINE_PROVIDER="hyperv"
  5. .\winmake localmachine

WSL

  1. Open a powershell as a regular user
  2. .\winmake.ps1 podman-remote && .\winmake.ps1 win-gvproxy
  3. $env:CONTAINERS_HELPER_BINARY_DIR="$pwd\bin\windows"
  4. $env:CONTAINERS_MACHINE_PROVIDER="wsl"
  5. .\winmake localmachine

MacOS

Macs now support two different machine providers: applehv and libkrun. The applehv 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

  1. brew install vfkit
  2. make podman-remote
  3. make localmachine

Libkrun

  1. brew install krunkit
  2. make podman-remote
  3. export CONTAINERS_MACHINE_PROVIDER="libkrun"
  4. make localmachine