spiegel_podman/pkg/machine/e2e
Ashley Cui e412eff33f Clean machine pull cache
Cache cleanups only happen if there is a cache miss, and we need to pull a new image

For quay.io/podman/machine-os, we remove all old images from the cache dir. This means we will delete any file that exists in the cache dir; this should be safe to do since the machine pull code should be the only thing touching this cache dir. OCI machine images will always have a different manifest, and won’t be updated with the same manifest, so if the version moves on, there isn’t a reason to keep the old version in the cache, it really doesn’t change.

For Fedora (WSL), we use the cache, so we go through the cache dir and remove any old cached images, on a cache miss. We also switch to using ~/.local/share/containers/podman/machine/wsl/cache as the cache dir rather than ~/.local/share/containers/podman/machine/wsl. Both these behaviors existed in v4.9, but are now added back into 5.x.

For generic files pulled from a URL or a non-default OCI image, we shouldn’t actually cache, so we delete the pulled file immediately after creating a machine image. This restores the behavior from v4.9.

For generic files from a local path, the original file will never be cleaned up

Unsure how to test, so:
[NO NEW TESTS NEEDED]

Signed-off-by: Ashley Cui <acui@redhat.com>
2024-04-26 12:31:42 -04:00
..
basic_test.go Fix relabeling failures with Z/z volumes on Mac 2024-04-08 10:06:44 -05:00
config_basic_test.go enable linter for pkg/machine/e2e 2022-07-21 18:04:10 +02:00
config_darwin_test.go Enable machine e2e test for applehv 2023-09-25 15:45:26 -05:00
config_info_test.go enable linter for pkg/machine/e2e 2022-07-21 18:04:10 +02:00
config_init_test.go logformatter: fixes for Macintosh 2024-03-04 05:52:00 -07:00
config_inspect_test.go Fix machine inspect test config 2024-01-11 11:42:54 -05:00
config_linux_test.go Enable machine e2e test for applehv 2023-09-25 15:45:26 -05:00
config_list_test.go enable linter for pkg/machine/e2e 2022-07-21 18:04:10 +02: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 Fix typos 2023-02-11 18:23:24 +01:00
config_start_test.go Add --quiet and --no-info flags to podman machine start 2022-11-11 16:14:20 -05:00
config_stop_test.go enable linter for pkg/machine/e2e 2022-07-21 18:04:10 +02:00
config_test.go Replace golang.org/x/exp/slices with slices from std 2024-04-23 11:16:40 +02:00
config_unix_test.go Prune FCOS related code 2024-02-15 21:05:17 -06:00
config_windows_test.go podman machine 5 - hyperv 2024-02-07 09:18:51 -06:00
info_test.go Change image-path to image for tests 2024-02-29 13:38:53 -05:00
init_test.go machine: make more use of strongunits 2024-03-06 16:14:30 +01:00
init_windows_test.go Change image-path to image for tests 2024-02-29 13:38:53 -05:00
inspect_test.go Change API socket to be machine name isolated 2024-03-13 13:28:14 -05:00
list_test.go Replace golang.org/x/exp/slices with slices from std 2024-04-23 11:16:40 +02:00
machine_pull_test.go Clean machine pull cache 2024-04-26 12:31:42 -04:00
machine_test.go Fail on failures to close the file descriptors, and especially the SparseWriter 2024-03-07 14:46:17 +01:00
machine_wsl_test.go Use correct extension in suite 2024-03-19 13:07:45 -05:00
os_test.go Change image-path to image for tests 2024-02-29 13:38:53 -05:00
proxy_test.go Change image-path to image for tests 2024-02-29 13:38:53 -05:00
pull_test.go Prune FCOS related code 2024-02-15 21:05:17 -06:00
README.md Podman Machine AppleHV CI fixes 2024-02-07 09:19:16 -06:00
reset_test.go Change image-path to image for tests 2024-02-29 13:38:53 -05:00
rm_test.go Change image-path to image for tests 2024-02-29 13:38:53 -05:00
set_test.go Change image-path to image for tests 2024-02-29 13:38:53 -05:00
ssh_test.go Change image-path to image for tests 2024-02-29 13:38:53 -05:00
start_test.go pkg/machine: make checkExclusiveActiveVM race free 2024-03-14 11:13:08 +01:00
stop_test.go Change image-path to image for tests 2024-02-29 13:38:53 -05:00

Working README for running the machine tests

Note: you must not have any machines defined before running tests

Linux

QEMU

make localmachine

Microsoft Windows

HyperV

  1. Open a powershell as admin
  2. $env:CONTAINERS_MACHINE_PROVIDER="hyperv"
  3. ./winmake localmachine

Note: To run specific test files, add the test files to the end of the winmake command:

./winmake localmachine "basic_test.go start_test.go"

WSL

  1. Open a powershell as a regular user
  2. Build and copy win-sshproxy into bin/
  3. ./winmake localmachine

Note: To run specific test files, add the test files to the end of the winmake command:

./winmake localmachine "basic_test.go start_test.go"

MacOS

Apple Hypervisor

  1. make podman-remote
  2. make localmachine (Add FOCUS_FILE=basic_test.go to only run basic test)