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

[WIP] Make tests work also for rootless containers #192

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zmiklank
Copy link
Contributor

@zmiklank zmiklank commented Apr 27, 2022

  • add -P to docker run when running container tests

Publish all exposed ports to random ports on the host interface.
Add function for getting actual mapped port, and do not use hardcoded
8080. Return 8080, only when port is not published (works in rootfull
configuration in one subnet).

  • return "localhost" as an IP, if container itself does not have any IP
    assigned (when running in rootless state)

  • known issues -> rootfull configuration seem to run only for localhost:published_port combination

  • also needs support from container-common-scripts (WIP)

NOT INTENDED FOR MERGING YET.

- add -P to docker run when running container tests

Publish all exposed ports to random ports on the host interface.
Add function for getting actual mapped port, and do not use hardcoded
8080. Return 8080, only when port is not published (works in rootfull
configuration in one subnet).

- return "localhost" as an IP, if container itself does not have any IP
  assigned (when running in rootless state)
@zmiklank
Copy link
Contributor Author

[test-all]

@zmiklank
Copy link
Contributor Author

zmiklank commented May 2, 2022

[test-all]

2 similar comments
@zmiklank
Copy link
Contributor Author

[test-all]

@phracek
Copy link
Member

phracek commented Jun 20, 2022

[test-all]

@sclorg sclorg deleted a comment from zmiklank Jun 20, 2022
echo localhost
}

test_port() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function could be a part of container-common-scripts.
The first parameter would be port and the second parameter would be a protocol

The results would be echo as you already have it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I will need to make time to get back to this soon and get this PR to a mergeable state.

@zmiklank zmiklank self-assigned this Jul 26, 2022
@zmiklank zmiklank marked this pull request as draft July 26, 2022 11:15
@phracek
Copy link
Member

phracek commented Sep 8, 2022

[test-all]

@phracek
Copy link
Member

phracek commented Sep 12, 2022

[test-openshift]

3 similar comments
@zmiklank
Copy link
Contributor Author

zmiklank commented Mar 9, 2023

[test-openshift]

@zmiklank
Copy link
Contributor Author

zmiklank commented Mar 9, 2023

[test-openshift]

@zmiklank
Copy link
Contributor Author

[test-openshift]

Copy link

github-actions bot commented Jun 27, 2024

Pull Request validation

Failed

🔴 Review - Missing review from a member (2 required)

Success

🟢 CI - All checks have passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants