Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Add basic e2e test #61

Merged
merged 7 commits into from
Feb 6, 2024
Merged

tests: Add basic e2e test #61

merged 7 commits into from
Feb 6, 2024

Conversation

cfergeau
Copy link
Collaborator

This reuses the puipui linux work from Code-Hex/vz.
The OS is abstracted with a OSProvider interface which will hopefully
be implementable with Fedora CoreOS or other distros.

Tests which are currently implemented:

  • start a VM, and make sure it's possible to connect through ssh (both
    over a regular network interface, and over vsock)
  • for most devices, run lspci to make sure it's present in the VM
  • vsock-listen and vsock-connect
  • file sharing

Makefile Outdated Show resolved Hide resolved
@anjannath
Copy link
Member

one thing i noticed is that the tests are downloading the puipui linux tarball multiple times (one download for each test scenario) which is fine since it is very small in size, but if we do test fedora or some other real distro we need to implement OSProvider to download the image only once

@cfergeau
Copy link
Collaborator Author

/hold
added a commit to try to understand why gh actions don't behave as I expect them to.

@cfergeau
Copy link
Collaborator Author

/unhold
hopefully should be good this time. Tests can run/succeed on macos 12/13, and are skipped on macos 11

@cfergeau
Copy link
Collaborator Author

one thing i noticed is that the tests are downloading the puipui linux tarball multiple times (one download for each test scenario) which is fine since it is very small in size, but if we do test fedora or some other real distro we need to implement OSProvider to download the image only once

Yep, this definitely needs improvements :)

@anjannath
Copy link
Member

/lgtm
/approve

This reuses the puipui linux work from Code-Hex/vz.
The OS is abstracted with a OSProvider interface which will hopefully
be implementable with Fedora CoreOS or other distros.

Tests which are currently implemented:
- start a VM, and make sure it's possible to connect through ssh (both
  over a regular network interface, and over vsock)
- for most devices, run lspci to make sure it's present in the VM
- vsock-listen and vsock-connect
- file sharing

Signed-off-by: Christophe Fergeau <[email protected]>
Signed-off-by: Christophe Fergeau <[email protected]>
In the next commits, we want to avoid running the macOS13-specific tests
on older macOS versions.

Signed-off-by: Christophe Fergeau <[email protected]>
This will solve some test failures on macOS 12. There are likely more
issues to fix on macOS 11.

Signed-off-by: Christophe Fergeau <[email protected]>
The newly added e2e tests will fail on macos 11.
it's 3 major releases behind (macos 14 was released a few months ago),
I prefer not to spend too much time on it for now.

Signed-off-by: Christophe Fergeau <[email protected]>
Running 'make' twice currently results in an error:

```
% make
CGO_ENABLED=1 CGO_CFLAGS=-mmacosx-version-min=11.0 GOOS=darwin GOARCH=amd64 go build -o out/vfkit-amd64 ./cmd/vfkit
codesign --entitlements vf.entitlements -s - out/vfkit-amd64
out/vfkit-amd64: is already signed
make: *** [out/vfkit-amd64] Error 1
```

This commit makes use of "codesign -f" to force the re-generation of a
signature even if the binarie did not change. This works around the
previous error.

Signed-off-by: Christophe Fergeau <[email protected]>
We don't really need the other ones..

Signed-off-by: Christophe Fergeau <[email protected]>
@cfergeau cfergeau force-pushed the puipui branch 2 times, most recently from c0491d3 to 8fbd4dc Compare January 29, 2024 14:45
@openshift-ci openshift-ci bot removed the lgtm label Jan 29, 2024
@anjannath
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jan 31, 2024
@praveenkumar
Copy link
Member

/lgtm

@praveenkumar
Copy link
Member

/approve

2 similar comments
@cfergeau
Copy link
Collaborator Author

cfergeau commented Feb 1, 2024

/approve

@cfergeau
Copy link
Collaborator Author

cfergeau commented Feb 5, 2024

/approve

Copy link

openshift-ci bot commented Feb 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anjannath, cfergeau, praveenkumar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Feb 5, 2024
@cfergeau cfergeau merged commit e69ede2 into crc-org:main Feb 6, 2024
4 checks passed
@cfergeau cfergeau mentioned this pull request Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants