-
Notifications
You must be signed in to change notification settings - Fork 368
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
Fix IPv6 e2e test caused by image update #6045
Conversation
/test-all |
test/e2e/util.go
Outdated
// getURL("1.2.3.4", "8080") == "http://1.2.3.4:8080" | ||
// getURL("1.2.3.4", "8080", "clientip") == "http://1.2.3.4:8080/clientip" | ||
// getURL("fd74:ca9b:172::b4e", "8080") == "http://[fd74:ca9b:172::b4e]:8080" | ||
func getURL(ip string, args ...string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a more specific name such as getHttpURLFromIP
may be better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed to getHTTPURLFromIPPort
test/e2e/util.go
Outdated
@@ -56,3 +56,21 @@ func IPFamily(ip string) string { | |||
return "" | |||
} | |||
} | |||
|
|||
// getURL returns a HTTP url based on the IP and the addition port and path if provided. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you meant "additional" and not "addition"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
test/e2e/util.go
Outdated
func getURL(ip string, args ...string) string { | ||
port := "80" | ||
if len(args) > 0 { | ||
port = args[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment to highlight that the port need be the first argument if multiple args are provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made it an explicit argument
test/e2e/flowaggregator_test.go
Outdated
} | ||
cmd := []string{"curl", getURL(testFlow1.dstIP, fmt.Sprint(serverPodPort))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if the port argument is always int or not, if it's always int, maybe add a new parameter to getURL
as the second argument, and then we don't have to call the format converter like fmt.Sprint(serverPodPort)
every time when there is a port, which can be done inside of the getURL
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
wget in toolbox image expects the protocol to be specified when IPv6 address is used in the url, otherwise it would use ftp protocol. This patch fixes it and unifies how we get url from IP, port and path. Signed-off-by: Quan Tian <[email protected]>
/test-e2e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
wget in toolbox image expects the protocol to be specified when IPv6 address is used in the url, otherwise it would use ftp protocol. This patch fixes it and unifies how we get url from IP, port and path.