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

[QE] fix e2e test failure of podman #4424

Closed
lilyLuLiu opened this issue Oct 30, 2024 · 13 comments
Closed

[QE] fix e2e test failure of podman #4424

lilyLuLiu opened this issue Oct 30, 2024 · 13 comments
Assignees

Comments

@lilyLuLiu
Copy link
Contributor

lilyLuLiu commented Oct 30, 2024

Test case Pull image locally, push to registry, deploy sometimes failed:

stderr:
Cannot connect to Podman. Please verify your connection to the Linux system using podman system connection list, or try podman machine init and podman machine start to manage a new Linux VM
Error: unable to connect to Podman socket: failed to connect: dial tcp 192.168.130.11:22: i/o timeout

But this error never appear in nightly run. And I checked the machine, podman work well.

this is b/c somehow it is trying to use podman remote instead of podman.

@praveenkumar
Copy link
Member

this is b/c somehow it is trying to use podman remote instead of podman.

Can you point out the feature file for that? Also I think we want to use podman remote instead podman on system since it is not default available for mac/windows.

@adrianriobo
Copy link
Contributor

Tests should be using podman-remote for win/mac and podman for linux

@lilyLuLiu
Copy link
Contributor Author

@praveenkumar , This failure all happened on tests of Linux.

@praveenkumar
Copy link
Member

Tests should be using podman-remote for win/mac and podman for linux

@adrianriobo Does that mean for win/mac it is using podman socket which is running inside the crc VM or using podman-machine vm?

@adrianriobo
Copy link
Contributor

Yeah, for win and mac any scenario making use of podman is relying on "our" podman (crc-VM)

@praveenkumar
Copy link
Member

Yeah, for win and mac any scenario making use of podman is relying on "our" podman (crc-VM)

@adrianriobo so in this case we should also do same for linux right?

@adrianriobo
Copy link
Contributor

Well, we are not making it for testing our podman setup, but b/c we rely on some container engine. In the end we somehow would like to test the interaction between podman / crc.

I would suggest keep the same strategy, as in future we remove the podman socket or make more tricky to make use of it ..we may end on a situation where we need to use podman machine on win and mac and keep using podman on linux.

dunno...WDYT?

@praveenkumar
Copy link
Member

What we want to have our test case follow same steps on all platform to have reliable metrics in case of this https://github.com/crc-org/crc/blob/main/test/e2e/features/story_openshift.feature#L55-L66 (which is causing issue).

Well, we are not making it for testing our podman setup, but b/c we rely on some container engine. In the end we somehow would like to test the interaction between podman / crc.

In this case I would suggest to have a different test case only for linux which use the podman installed on the system instead using podman-socket from the VM.

@adrianriobo
Copy link
Contributor

Well the intention should be scenario spec should be the same the tech underneath implementing it is controlled by code (in this case use "our" podman socket for win and mac and podman for linux).

And this is fine...what I do not know is why on Linux is not working as expected and it is complaining about the socket. And this should be target of this issue, know why and fix it

@albfan
Copy link
Contributor

albfan commented Nov 4, 2024

From source:

https://github.com/containers/podman/blob/7567cc1fcd0764b60386ecbeacaaf575a067e926/cmd/podman/root.go#L120-L124

https://github.com/containers/podman/blob/9b8b2bf684aeb76199467d351d02a014befdcb0b/cmd/podman/registry/remote.go#L21-L23

If we just call on purpose podman remote, should we avoid that on linux?

@darwin @linux @windows @testdata @story_registry @local-registry @needs_namespace
Scenario: Pull image locally, push to registry, deploy
Given podman command is available
And executing "oc new-project testproj" succeeds
When pulling image "registry.access.redhat.com/ubi8/httpd-24:latest", logging in, and pushing local image to internal registry succeeds
And executing "oc apply -f hello.yaml" succeeds
When executing "oc rollout status deployment hello" succeeds
Then stdout should contain "successfully rolled out"
And executing "oc get pods" succeeds
Then stdout should contain "Running"
When executing "oc logs deployment/hello" succeeds
Then stdout should contain "httpd"

@praveenkumar
Copy link
Member

It is because we have https://github.com/crc-org/crc/blob/main/test/extended/crc/cmd/cmd.go#L214C2-L217C44 logic so what I suspect that on linux since we are running podman-remote command we have to make sure we execute crc podman-env command.

@adrianriobo
Copy link
Contributor

Ohh my bad from top of my head I thought that should be using podman not podman-remote...about the crc podman-env this is kind of executed with line 57 on that scenario: Given podman command is available

That line goes to

func PodmanCommandIsAvailable() error {

@lilyLuLiu
Copy link
Contributor Author

After investigation, the podman-remote command failed because CONTAINER_HOST is set as default network system-mode, but actual network is user-mode.
The network mode is changed to user-mode in @story_microshift case, and didn't change back to default.

@lilyLuLiu lilyLuLiu moved this from Work In Progress to Done in Project planning: crc Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

4 participants