[
https://issues.apache.org/jira/browse/FLINK-9874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16565073#comment-16565073
]
ASF GitHub Bot commented on FLINK-9874:
---------------------------------------
twalthr closed pull request #6453: [FLINK-9874][E2E Tests] Fix set_ssl_conf for
macOS
URL: https://github.com/apache/flink/pull/6453
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/flink-end-to-end-tests/test-scripts/common.sh
b/flink-end-to-end-tests/test-scripts/common.sh
index c78afe74b6d..f428a52c488 100644
--- a/flink-end-to-end-tests/test-scripts/common.sh
+++ b/flink-end-to-end-tests/test-scripts/common.sh
@@ -146,6 +146,27 @@ function create_ha_config() {
EOL
}
+function get_node_ip {
+ local ip_addr
+
+ if [[ ${OS_TYPE} == "linux" ]]; then
+ ip_addr=$(hostname -I)
+ elif [[ ${OS_TYPE} == "mac" ]]; then
+ ip_addr=$(
+ ifconfig |
+ grep -E "([0-9]{1,3}\.){3}[0-9]{1,3}" | # grep IPv4 addresses only
+ grep -v 127.0.0.1 | # do not use 127.0.0.1 (to
be consistent with hostname -I)
+ awk '{ print $2 }' | # extract ip from row
+ paste -sd " " - # combine everything to
one line
+ )
+ else
+ echo "Warning: Unsupported OS_TYPE '${OS_TYPE}' for 'get_node_ip'.
Falling back to 'hostname -I' (linux)"
+ ip_addr=$(hostname -I)
+ fi
+
+ echo ${ip_addr}
+}
+
function set_conf_ssl {
# clean up the dir that will be used for SSL certificates and trust stores
@@ -154,12 +175,15 @@ function set_conf_ssl {
rm -rf "${TEST_DATA_DIR}/ssl"
fi
mkdir -p "${TEST_DATA_DIR}/ssl"
+
NODENAME=`hostname -f`
SANSTRING="dns:${NODENAME}"
- for NODEIP in `hostname -I | cut -d' ' -f1` ; do
+ for NODEIP in $(get_node_ip) ; do
SANSTRING="${SANSTRING},ip:${NODEIP}"
done
+ echo "Using SAN ${SANSTRING}"
+
# create certificates
keytool -genkeypair -alias ca -keystore "${TEST_DATA_DIR}/ssl/ca.keystore"
-dname "CN=Sample CA" -storepass password -keypass password -keyalg RSA -ext
bc=ca:true
keytool -keystore "${TEST_DATA_DIR}/ssl/ca.keystore" -storepass password
-alias ca -exportcert > "${TEST_DATA_DIR}/ssl/ca.cer"
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> set_conf_ssl in E2E tests fails on macOS
> ----------------------------------------
>
> Key: FLINK-9874
> URL: https://issues.apache.org/jira/browse/FLINK-9874
> Project: Flink
> Issue Type: Bug
> Components: Tests
> Affects Versions: 1.6.0
> Reporter: Florian Schmidt
> Assignee: Florian Schmidt
> Priority: Critical
> Labels: pull-request-available, test-stability
> Fix For: 1.6.0
>
>
> Setting up a cluster with SSL support in the end-to-end tests with
> `_set_conf_ssl_` will fail under macOS because in the command
> {code:java}
> hostname -I{code}
> is used, but '_-I'_ is not a supported parameter for the hostname command
> under macOS
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)