mirror of
https://github.com/keycloak/keycloak.git
synced 2025-12-21 06:20:05 -06:00
Hardcode nip.io test hosts to /etc/hosts (#39044)
Closes #38104 Signed-off-by: Václav Muzikář <vmuzikar@redhat.com>
This commit is contained in:
@@ -14,6 +14,10 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
|
- id: update-hosts
|
||||||
|
name: Update /etc/hosts
|
||||||
|
uses: ./.github/actions/update-hosts
|
||||||
|
|
||||||
- id: setup-java
|
- id: setup-java
|
||||||
name: Setup Java
|
name: Setup Java
|
||||||
uses: ./.github/actions/java-setup
|
uses: ./.github/actions/java-setup
|
||||||
|
|||||||
21
.github/actions/update-hosts/action.yml
vendored
Normal file
21
.github/actions/update-hosts/action.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
name: Update /etc/hosts
|
||||||
|
description: Update /etc/hosts file to hardcode known nip.io hostnames. This is to avoid test instability due to DNS resolution issues.
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- id: update-hosts-linux
|
||||||
|
name: Update /etc/hosts
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
printf "\n\n$(cat .github/actions/update-hosts/nipio-hosts)" | sudo tee -a /etc/hosts
|
||||||
|
|
||||||
|
- id: update-hosts-windows
|
||||||
|
name: Update C:\Windows\System32\drivers\etc\hosts
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
"`n`n" | Add-Content C:\Windows\System32\drivers\etc\hosts
|
||||||
|
Get-Content .github/actions/update-hosts/nipio-hosts | Add-Content C:\Windows\System32\drivers\etc\hosts
|
||||||
1
.github/actions/update-hosts/nipio-hosts
vendored
Normal file
1
.github/actions/update-hosts/nipio-hosts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
127.0.0.1 127.0.0.1.nip.io admin.127.0.0.1.nip.io localhost-myapp.127.0.0.1.nip.io localhost-sso.127.0.0.1.nip.io realmFrontend.127.0.0.1.nip.io proxy.kc.127.0.0.1.nip.io
|
||||||
@@ -67,7 +67,7 @@ public class DefaultCookieProviderTest extends AbstractKeycloakTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCookieDefaultsWithInsecureContext() {
|
public void testCookieDefaultsWithInsecureContext() {
|
||||||
KeycloakTestingClient testingInsecure = KeycloakTestingClient.getInstance("http://0.0.0.0:8180/auth");
|
KeycloakTestingClient testingInsecure = KeycloakTestingClient.getInstance("http://127.0.0.1.nip.io:8180/auth");
|
||||||
|
|
||||||
Response response = testingInsecure.server("master").runWithResponse(session -> {
|
Response response = testingInsecure.server("master").runWithResponse(session -> {
|
||||||
CookieProvider cookies = session.getProvider(CookieProvider.class);
|
CookieProvider cookies = session.getProvider(CookieProvider.class);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import org.keycloak.testsuite.arquillian.undertow.lb.SimpleUndertowLoadBalancer;
|
|||||||
|
|
||||||
public class ReverseProxy implements TestRule {
|
public class ReverseProxy implements TestRule {
|
||||||
|
|
||||||
public static String DEFAULT_PROXY_HOST = "127.0.0.1";
|
public static String DEFAULT_PROXY_HOST = "proxy.kc.127.0.0.1.nip.io";
|
||||||
public static final int DEFAULT_HTTP_PORT = 8666;
|
public static final int DEFAULT_HTTP_PORT = 8666;
|
||||||
public static final int DEFAULT_HTTPS_PORT = 8667;
|
public static final int DEFAULT_HTTPS_PORT = 8667;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user