Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TrustedHostClientRegistrationPolicyTest#testGithubDomain failing in clean checkout #29271

@Jamstah

Description

@Jamstah

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

testsuite

Describe the bug

https://github.com/keycloak/keycloak/blob/main/services/src/test/java/org/keycloak/services/clientregistration/policy/impl/TrustedHostClientRegistrationPolicyTest.java#L110

This test seems to get the IP of www.github.com, convert it to a string, then attempt to verify that the IP address matches *.github.com.

For me, the test fails. This seems to be because reverse DNS lookup of github.com fails.

I think the test is broken (and probably shouldn't rely on external infrastructure anyway)

jammy@ibm007470:~$ dig www.github.com

; <<>> DiG 9.18.26 <<>> www.github.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30996
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;www.github.com.			IN	A

;; ANSWER SECTION:
www.github.com.		341	IN	CNAME	github.com.
github.com.		18	IN	A	20.26.156.215

;; AUTHORITY SECTION:
github.com.		341	IN	SOA	ns-1707.awsdns-21.co.uk. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400

;; Query time: 1 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Fri May 03 15:44:06 BST 2024
;; MSG SIZE  rcvd: 157

jammy@ibm007470:~$ nslookup 20.26.156.215
** server can't find 215.156.26.20.in-addr.arpa: NXDOMAIN

Version

main

Regression

  • The issue is a regression

Expected behavior

Tests pass on clean checkout

Actual behavior

Test fails on clean checkout

How to Reproduce?

Run ./mvnw clean install on a clean checkout. May get different results in different geos depending on how the github domain is configured.

Anything else?

I'd be happy to make a PR, but I don't know the importance of the test and what its doing, so would need some direction on how it should be changed.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions