745 Commits

Author SHA1 Message Date
94f47d6f66 Merge pull request #20141 from baude/wslenablestop
pkg/machine/e2e: wsl stop
2023-09-26 13:37:52 -04:00
f64234969a Merge pull request #20135 from ashley-cui/hypervroot
hyperV: Respect rootful option on machine init
2023-09-26 10:54:46 -04:00
8bad842a45 pkg/machine/e2e: wsl stop
allow the machine stop test to pass.

small change to WSL stop on an already stopped machine to allow for it
to behave like hyperv and qemu

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-26 09:27:51 -05:00
d2d121a389 Merge pull request #20152 from baude/wslenableinspect
wsl: machine tests for inspect
2023-09-26 10:23:15 -04:00
217c4d5468 wsl: machine tests for inspect
small corrections for wsl between sockets and pipe

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-26 07:26:44 -05:00
e4bfcfc254 wsl: machine tests for ssh
a couple of small corrections for the ssh tests on WSL.  we need to
check for a different os type and windows emits a warning in stderr.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-26 07:00:45 -05:00
a2434a9d37 Merge pull request #20144 from baude/wslenableset
wsl machine tests: set
2023-09-26 07:53:58 -04:00
72033cdc6a Merge pull request #20137 from baude/applehvenablee2e
Enable machine e2e test for applehv
2023-09-26 07:22:14 -04:00
a112ee8959 wsl: machine start test
the emitted message for starting a machine that is is already started
needed to be slightly altered for wsl.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-25 19:59:26 -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
aebfde2408 Merge pull request #20142 from baude/wslenablerm
wsl: machine tests for machine rm
2023-09-25 19:55:41 -04:00
cc4917d81d wsl: machine tests
WSL does not use ignition therefore the test for the file is invalid.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-25 16:22:37 -05:00
ec68a74892 Skip proxy test for hyperV
Currently proxys are not supported on hyperV, skip the test and
document it for now.

Opened https://github.com/containers/podman/issues/20129 to track the
issue.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-09-25 16:48:35 -04:00
33a92aa006 Enable machine e2e test for applehv
This PR allows you to run the pkg/machine/e2e tests for the applehv PROVIDER.  This does not mean they pass, only that they can run.  There also appears to be leftover gvproxy processes at the conclusion of a single test.  This will need to be corrected.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-25 15:45:26 -05:00
65ce034863 hyperV: Respect rootful option on machine init
Fixed a bug where the rootful option to the podman machine init command
would not be written to to the machine config, and the rootful docker
sock would not be set.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-09-25 16:13:55 -04: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
9ba0022905 Merge pull request #20115 from baude/hypervstarting
hyperv: set more realistic starting state
2023-09-24 19:24:50 -04:00
7359a2df19 Merge pull request #20116 from baude/hypervremoveforce
hyperv: use StopWithForce with remove
2023-09-24 19:13:03 -04:00
3d5b9e80c6 Merge pull request #20114 from baude/hypervtzfix
Fix setting timezone on HyperV
2023-09-24 17:00:20 -04:00
08936db354 hyperv: set more realistic starting state
the window for hyperv's "Starting" state is very narrow; so to more
mimic qemu, we follow suit.  starting bools are set when the vm boots
and when it communicates back on the read socket.

this allows pkg/machine/init_test.go to pass

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-24 10:13:43 -05:00
2bef573f34 hyperv: use StopWithForce with remove
When doing a machine rm -f (force removal of a machine) or a machine
reset (force removal of all machines), there is no need to use a
"polite/soft" stop.

this will also speed up pkg/machine/e2e tests.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-24 09:49:40 -05:00
cd4f611810 Fix setting timezone on HyperV
the timezone was being set with the wrong path separator for hyperv
because it was being generated on Windows.

Fixes: coreos/fedora-coreos-tracker#1580

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-23 11:04:45 -05:00
d8e3057165 Adjust machine CPU tests
Machine cpu default has changed to cpus/2, so adjust the tests to reflect that.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-09-22 13:11:12 -04:00
c66aa3b7bb fixes for pkg/machine/e2e on hyperv
some problems were found in machine tests on hyperv.

in the case of rootful, it is currently not implemented.  an issue #20092 has been
created for that problem.

there also seems to be a timezone issue between ignition and fcos right
now.  inquiries are in for that but no issue generated for that.  this
problem is not exclusive to hyperv by any means.

both of the above have been skipped or commented out.

otherwise, this fixes machine state reporting for consistency.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-21 16:14:57 -05:00
935a6d1569 Merge pull request #20074 from baude/hypervmachinee2epass1
Various updates for hyperv and machine e2e tests
2023-09-21 11:59:32 -04:00
92f4dcb093 Enable disk resizing for applehv
previous attempts to us os.truncate to resize raw disks did not work because the unit was wrong.  the unit must be in bytes.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-21 09:05:37 -05:00
5b3801776b Various updates for hyperv and machine e2e tests
This PR is a mishmash of updates needed so that the hyperv provider can
begin to passd the machine e2e tests.

Summary as follows:
* Added custom error handling for machine errors so that all providers
  can generate the same formatted error messages.  The ones implemented
  thus far are needed for the basic and init tests.  More will come as
  they are identified.
* Vendored new libhvee for better memory inspection.  The memory type
  changed from uint32 to uint64.
* Some machine e2e tests used linux-specific utilities to check various
  error conditions and messages (like pgrep).  Those were made into
  functions and implemented on an operating system level.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-21 08:52:02 -05:00
53e6a4435f Merge pull request #20031 from ashley-cui/winmake
Makefile equiv Powershell script
2023-09-20 22:57:59 -04:00
f3e9a6369c windows cannot "do" extra files
if you use the extra files function on exec commands, windows loses it's
mind.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-20 15:14:08 -05:00
38f5ead331 Enable machine e2e tests for WSL
this pr allows us to run the machine e2e tests with the wsl provider.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-19 17:16:45 -05:00
113b41b6f5 Buildtag out unix commands for common OS files
Unix only code crept into shared portions of the machine codebase,
preventing builds on Windows. Move them into unix-only files.

[NO NEW TESTS NEEDED]

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-09-19 12:19:24 -04:00
289e59ee1f Implement gvproxy networking using cmdline wrapper
Converts the host networking code in `podman machine` to use the
`GvproxyCommand` type introduced in containers/gvisor-tap-vsock#258

[NO NEW TESTS NEEDED]

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-09-19 09:20:26 -04:00
348f9fe0d9 Merge pull request #19988 from baude/wslrmdashf
Add ability for machine rm -f for WSL
2023-09-15 10:36:35 +02:00
8a9f778e23 Add ability for machine rm -f for WSL
When passing the force flag to machine rm, wsl needs to stop the VM if
it is running before attempting to remove it.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-14 17:18:01 -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
dbfc3e7e00 Restrict fcos_test to amd64, arm64
Allows tests to pass on i386 again

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2023-09-05 21:50:52 -04:00
681b6db3f3 machine: increase max number of inotify instances
increase the number of inotify instances to 524288 instead of using
the default value of 128.

Closes: https://github.com/containers/podman/issues/19848

[NO NEW TESTS NEEDED]

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-09-04 14:02:57 +02:00
1361fa2304 Merge pull request #19820 from ashley-cui/gvproxytest
Add port forwarding and gvproxy machine test
2023-09-02 16:19:21 +02:00
fe7bafb83c Add port forwarding and gvproxy machine test
Added a test that checks that gvproxy properly starts and stops when running podman machine, and that containers properly forward ports to the host when running podman using machine.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-08-31 10:19:35 -04:00
a62abfe3d6 Tweaks and cleanups to prepare hyperv for CI
Small fixes for bugs in the hyperv code that were made obvious when
manually preparing to run pkg/machine/e2e with windows and hyperv.

Also includes vendoring a new libhvee and solves bug where json config
was not being removed.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-08-30 12:44:50 -05:00
1085177fee hyperv ignition: use gvforwarder instead of vm
in gvisor-vsock-tap upstream, there is a binary called 'vm' which is
used for routing traffic from a tap over something like vsock.  In
Fedora, the binary is named 'gvforwarder'.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-08-29 09:34:40 -05:00
2a8e6acecb Set remote username earlier for hyperv
the remote username was being set too "late" for hyperv and the username
for ssh connections was blank.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-08-29 09:34:40 -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
da81bc13a1 Add rootful status to machine inspect
Podman machine inspect now shows if the machine is rootful

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-08-25 11:27:08 -04:00
c3ac109f17 Merge pull request #19734 from baude/acquireimage
Dedup and refactor image acquisition
2023-08-25 15:00:47 +02:00
d3618719b1 Dedup and refactor image acquisition
As promised in #19596, this pr deduplicates and refactors image
acquisition.  All virt providers that use FCOS as its default now use
the same code.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-08-24 20:52:03 -05:00
adf34cbd79 Share podman sock bindings with other WSL distros
Registers a rootless and rootful socket underneath /mnt/wsl/podman-sockets/[machine name]/
This allows podman remote clients on other Linux distributions to access podman.

This also registers the podman root socket under the wheel group, to allow for rootful
linking against /var/run/docker.sock, a use case expected by some clients and APIs.
While this is not recommended practice on a Linux host, a WSL guest is user-isolated
and already enables escalation trivially.

[NO NEW TESTS NEEDED]

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-08-24 16:23:50 -05:00
db95e678ad Fix user-mode validation check
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-08-24 16:23:50 -05:00
a9c98770e6 Merge pull request #19557 from n1hility/automatic-ports
Implement automatic port reassignment on Windows
2023-08-23 06:49:11 -02:30
9e680cbc63 Fixups for stopping gvproxy
Paul found logic errors in my earlier code for finding processes and
sending signals.  Some of the logic errors are associated with how
methods behave on different operating systems.  Created a darwin and
linux approach and a windows approach.

Signed-off-by: Brent Baude <bbaude@redhat.com>

[NO NEW TESTS NEEDED]
2023-08-22 16:00:15 -05:00