|
42 | 42 | # See: SeleniumHQ/docker-selenium/issues/14 |
43 | 43 | # Added a non-sudo conditional so this works on non-sudo environments like K8s |
44 | 44 | if [ "${WE_HAVE_SUDO_ACCESS}" == "true" ]; then |
45 | | - sudo haveged |
| 45 | + sudo -E haveged |
46 | 46 | else |
47 | 47 | haveged || true |
48 | 48 | fi |
@@ -112,6 +112,18 @@ export GEOMETRY="${SCREEN_WIDTH}""x""${SCREEN_HEIGHT}""x""${SCREEN_DEPTH}" |
112 | 112 | export DOCKER_HOST_IP=$(netstat -nr | grep '^0\.0\.0\.0' | awk '{print $2}') |
113 | 113 | export CONTAINER_IP=$(ip addr show dev ${ETHERNET_DEVICE_NAME} | grep "inet " | awk '{print $2}' | cut -d '/' -f 1) |
114 | 114 |
|
| 115 | +# if [ "${DOCKER_HOST_IP}" == "" ] || [[ ${DOCKER_HOST_IP} == 127* ]]; then |
| 116 | +# # TODO: Try with an alternative method |
| 117 | +# # die "DOCKER_HOST_IP is '${DOCKER_HOST_IP}'" |
| 118 | +# # export DOCKER_HOST_IP=$(ip route show | awk '/default/ {print $3}') |
| 119 | +# fi |
| 120 | + |
| 121 | +# if [ "${CONTAINER_IP}" == "" ] || [[ ${CONTAINER_IP} == 127* ]]; then |
| 122 | +# # TODO: Try with an alternative method |
| 123 | +# # die "CONTAINER_IP is '${CONTAINER_IP}'" |
| 124 | +# # export CONTAINER_IP=$(hostname -i) |
| 125 | +# fi |
| 126 | + |
115 | 127 | # Common capabilities for both nodes (Chrome/Firefox) |
116 | 128 | export COMMON_CAPS="maxInstances=${MAX_INSTANCES}" |
117 | 129 | export COMMON_CAPS="${COMMON_CAPS},platform=LINUX" |
@@ -400,7 +412,7 @@ ga_track_start () { |
400 | 412 | #-------------------------------- |
401 | 413 | # Improve etc/hosts and fix dirs |
402 | 414 | if [ "${WE_HAVE_SUDO_ACCESS}" == "true" ]; then |
403 | | - sudo improve_etc_hosts.sh |
| 415 | + sudo -E improve_etc_hosts.sh |
404 | 416 | fi |
405 | 417 |
|
406 | 418 | #------------------------- |
@@ -463,6 +475,9 @@ echo "${CUSTOM_SELENIUM_NODE_PROXY_PARAMS}" > CUSTOM_SELENIUM_NODE_PROXY_PARAMS |
463 | 475 | echo "${CUSTOM_SELENIUM_NODE_REGISTER_CYCLE}" > CUSTOM_SELENIUM_NODE_REGISTER_CYCLE |
464 | 476 | echo "${USE_KUBERNETES}" > USE_KUBERNETES |
465 | 477 | echo "${XMANAGER}" > XMANAGER |
| 478 | +echo "${DOCKER_HOST_IP}" > DOCKER_HOST_IP |
| 479 | +echo "${CONTAINER_IP}" > CONTAINER_IP |
| 480 | +echo "${WE_HAVE_SUDO_ACCESS}" > WE_HAVE_SUDO_ACCESS |
466 | 481 | echo "${GRID}" > GRID |
467 | 482 |
|
468 | 483 | # Open a new file descriptor that redirects to stdout: |
|
0 commit comments