Skip to content

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

Draft
zmiklank wants to merge 2 commits into
sclorg:masterfrom
zmiklank:support_rootless_tests
Draft

[WIP] Make tests work also for rootless containers#192
zmiklank wants to merge 2 commits into
sclorg:masterfrom
zmiklank:support_rootless_tests

Conversation

@zmiklank

@zmiklank zmiklank commented Apr 27, 2022

Copy link
Copy Markdown
Contributor
  • 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
Copy Markdown
Contributor Author

[test-all]

@zmiklank

zmiklank commented May 2, 2022

Copy link
Copy Markdown
Contributor Author

[test-all]

2 similar comments
@zmiklank

Copy link
Copy Markdown
Contributor Author

[test-all]

@phracek

phracek commented Jun 20, 2022

Copy link
Copy Markdown
Member

[test-all]

@sclorg sclorg deleted a comment from zmiklank Jun 20, 2022
Comment thread test/run
echo localhost
}

test_port() {

Copy link
Copy Markdown
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
Copy Markdown
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

phracek commented Sep 8, 2022

Copy link
Copy Markdown
Member

[test-all]

@phracek

phracek commented Sep 12, 2022

Copy link
Copy Markdown
Member

[test-openshift]

3 similar comments
@zmiklank

zmiklank commented Mar 9, 2023

Copy link
Copy Markdown
Contributor Author

[test-openshift]

@zmiklank

zmiklank commented Mar 9, 2023

Copy link
Copy Markdown
Contributor Author

[test-openshift]

@zmiklank

Copy link
Copy Markdown
Contributor Author

[test-openshift]

@github-actions

github-actions Bot commented Jun 27, 2024

Copy link
Copy Markdown

Pull Request validation

Failed

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

Success

🟢 CI - All checks have passed


Triggered by Workflow Run

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