23 Commits

Author SHA1 Message Date
ec68f07c04 Fix Lint on Windows and enable the job
[NO NEW TESTS NEEDED] Purely refactoring

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-20 08:06:18 -05:00
d221e0b00a Remove log-level from runSystemCommand since wsl does not support it
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2024-02-15 11:54:46 -06:00
144e420bb9 Add testcase for WSL dist conflicts
Signed-off-by: Brent Baude <bbaude@redhat.com>
2024-02-14 15:36:08 -06:00
d3328d4f32 Don't panic on podman4 machine configs
we should not panic podman when it has to deal with a podman4 machine
config.  instead, we throw a soft error for `machine ls` and in all
other cases, we throw a hard error stating that the machine config is
incompatible.

a future PR will provide instructions on how to recover from this.
current idea is something like `podman machine reset` which blows
everything away machine-wise.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2024-02-12 09:10:46 -06:00
72f1617fac Bump Go module to v5
Moving from Go module v4 to v5 prepares us for public releases.

Move done using gomove [1] as with the v3 and v4 moves.

[1] https://github.com/KSubedi/gomove

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-08 09:35:39 -05:00
9bb191df51 [CI:MACHINE]Podman5 QEMU refactor
The following PR is the leading PR for refactoring podman machine with
the following goals:

* less duplication/more re-use
* common configuration file between providers
* more consistentency in how machines are handled by providers

The goal of this PR is the rough refactor.  There are still rough spots
for sure, specifically around the podman socket and pipe.  This
implemention is only for Linux. All other providers are still present
but will not compile or work.  This is why tests for them have been
temporarily suspended.

The ready socket code is another area that needs to be smoothed over.
Right now, the ready socket code is still in QEMU.  Preferably it would
be moved to a generic spot where all three approaches to readiness
socket use can be defined.

It should also be noted:

* all machine related tests pass.
* make validate for Linux passes
* Apple QEMU was largely removed
* More code pruning is possible; will become clearer when other
  providers are complete.

the dir pkg/machine/p5 is not permanent.  i had to seperate this from
machine initially due to circular import problems.  i think when all
providers are done (or nearly done), it can be placed and named
properly.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2024-02-07 09:18:36 -06:00
f6107f6319 Assign separate ports for each appleHV machine
Previously, every machine created using appleHV interacted with VFKit using port 8081. This meant that if multiple machines existed on the machine, starting one would start all the machines. This patch assigns a separate random port for each machine, so machine commands interact with just the specified machine.

Signed-off-by: Ashley Cui <acui@redhat.com>
2024-01-11 12:19:04 -05:00
8bdf77aa20 Refactor: replace StringInSlice with slices.Contains
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2024-01-05 16:25:56 +02:00
c728eeb39e Create pkg/machine/ignition package
Moves all of the ignitionfiles out of the `machine` package and into
its own called `ignition`. This required `VMType` to get moved out of
the `machine` package and into the `define` package in order to prevent
a circular dependency.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2024-01-04 08:51:35 -05:00
e5c726daff Make hyperv pass
It seems CI generally needs a little more of a default timeout to
complete the init and boot process of a machine.  This extends the
timeout from 90 seconds to 240 seconds.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-12-12 08:30:03 -06:00
1ebd507fbf Fix regression in e2e machine test suite
A simple regression was introduced to the test suite that overrode the
default image for hyperv testing.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-12-07 21:06:46 -06:00
3d88f614f7 [CI:DOCS] Machine test timeout env var
Introduce MACHINE_TEST_TIMEOUT, which sets the timeout for machine tests, in seconds.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-11-15 16:00:57 -05:00
78798cab00 Automatic code cleanups - JetBrains
A bunch of cleanups as suggested by linters/etc in JetBrains IDE.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-11-07 14:05:15 -06:00
64f43fed4d lint: fix warnings found by inamedparam
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-20 16:27:41 +02:00
94818f5941 podman machine: disable zincati update service
As explained in #21022, there are all kinds of downsides to a machine
updating itself (via zincati) automatically, like interuption of
service, lost mounts, etc.

disabling zincati will at least allow stop these downsides.  we are
likely to contemplate if podman will take over the update process
externally where interuption of services will not occur etc.

Fixes #20122

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-28 13:01:52 -05:00
d3d5011dc4 wsl machine tests: set
wsl does not support changing the disk size, processor number, or memory
allocation.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-25 19:53:35 -05:00
41e51f4738 hyperv: machine e2e tests for set command
The usermode networking scenario is only for WSL.  Hyperv cannot run it.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-25 09:54:38 -05:00
919dce1315 Plumbing to run machine tests with hyperv
this pr has the basic plumbing that allows the e2e machine tests to run
with the hyperv provider.

it requires a special fcos image right now because gvforwarder was not
in the upstream fcos images for hyperv.

changed the way "provider" is set; moved GetProvider functions to
pkg/machine/provider.  provider is now set at the machine level.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-14 15:57:35 -05:00
b6b300c798 Update machine init/set tests
Init/Set with --rootful
Init/Set  with --user-mode-networking

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-08-25 11:28:07 -04:00
36e09f18bb Update machine list test
check if --format json returns valid json

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-08-17 15:05:48 -04:00
5af4339237 pkg/machine/e2e: switch to GinkgoWriter
Directly writing to stdout/err is not safe when run in parallel.
Ginkgo v2 fixed this buffering the output and syncing the output so it
is not mangled between tests.

This is the same as for the podman integration tests.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-02 12:07:42 +02:00
445815036f update to ginkgo v2
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-02 11:27:35 +02:00
ee35ce86d0 enable linter for pkg/machine/e2e
Rename all files to _test.go and rename the package to e2e_test. This
makes the linter less strict about things like dot imports.

Add some unused nolint directives to silence some warnings, these can be
used to find untested options so someone could add tests for them.

Fixes #14996

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-21 18:04:10 +02:00