Skip to content

Use host network for running tests on Podman#269

Closed
jonkoops wants to merge 1 commit intokeycloak:mainfrom
jonkoops:use-host-network
Closed

Use host network for running tests on Podman#269
jonkoops wants to merge 1 commit intokeycloak:mainfrom
jonkoops:use-host-network

Conversation

@jonkoops
Copy link
Contributor

Uses the --network=host option for Podman when running the tests to force usage of the host network. This allows IPv6 loopbacks to resolve properly.

Closes #268

Closes keycloak#268

Signed-off-by: Jon Koops <jonkoops@gmail.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Playwright integration-test harness to run the Keycloak test container on the host network so localhost/IPv6 loopback behavior is consistent (per #268).

Changes:

  • Switch Podman Keycloak container startup to use --network=host (removing explicit port publishing).
  • Update test documentation to reflect the new Podman command.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/playwright.config.ts Runs the Keycloak test container with host networking for loopback/IPv6 behavior.
test/README.md Documents the updated Podman command used by Playwright to start Keycloak.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

fullyParallel: true,
webServer: [{
command: `podman run -p 8080:8080 -p 9000:9000 -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin -e KC_HEALTH_ENABLED=true --pull=newer quay.io/keycloak/keycloak:${KEYCLOAK_VERSION} start-dev`,
command: `podman run --network=host -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin -e KC_HEALTH_ENABLED=true --pull=newer quay.io/keycloak/keycloak:${KEYCLOAK_VERSION} start-dev`,
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

podman run --network=host is not supported / does not behave as expected on Podman Machine (macOS/Windows) and can break local test runs because ports are no longer published back to the host. Consider making the network mode configurable (e.g., via an env var) or using --network=host only on Linux while keeping -p 8080:8080 -p 9000:9000 as the fallback for other environments.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback


```sh
podman run -p 8080:8080 -p 9000:9000 -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin -e KC_HEALTH_ENABLED=true --pull=newer quay.io/keycloak/keycloak:latest start-dev
podman run --network=host -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin -e KC_HEALTH_ENABLED=true --pull=newer quay.io/keycloak/keycloak:latest start-dev
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The docs now recommend podman run --network=host, but this is Linux-specific and typically won’t expose ports correctly when using Podman Machine on macOS/Windows. Please add a short note (or an alternative command using -p 8080:8080 -p 9000:9000) so developers on those platforms aren’t blocked from running the test suite.

Copilot uses AI. Check for mistakes.
@jonkoops
Copy link
Contributor Author

Superseded by #270

@jonkoops jonkoops closed this Feb 17, 2026
@jonkoops jonkoops deleted the use-host-network branch February 17, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running tests on IPv6 loopback doesn't work

1 participant