From b75e36c81dcb53d6b3f8b9299b16dfbfbd136f1f Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Mon, 23 Dec 2024 14:37:40 +0530 Subject: [PATCH] Docker: set/unset stereotype via env var SE_NODE_PLATFORM_NAME (#2525) Signed-off-by: Viet Nguyen Duc --- NodeBase/Dockerfile | 1 + NodeBase/generate_config | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NodeBase/Dockerfile b/NodeBase/Dockerfile index 0634af46f..0019df3df 100644 --- a/NodeBase/Dockerfile +++ b/NodeBase/Dockerfile @@ -48,6 +48,7 @@ ENV LANG_WHICH=${LANG_WHICH} \ # Setting Selenium Manager to work offline SE_OFFLINE=true \ SE_NODE_BROWSER_VERSION="stable" \ + SE_NODE_PLATFORM_NAME="Linux" \ #============================ # Some configuration options #============================ diff --git a/NodeBase/generate_config b/NodeBase/generate_config index 8aa231dec..54194c165 100755 --- a/NodeBase/generate_config +++ b/NodeBase/generate_config @@ -55,7 +55,7 @@ echo "max-sessions = ${SE_NODE_MAX_CONCURRENCY:-${SE_NODE_MAX_SESSIONS}} if [ -f /opt/selenium/browser_name ]; then SE_NODE_BROWSER_NAME=$(cat /opt/selenium/browser_name) fi -if [ -f /opt/selenium/browser_version ] && [ "${SE_NODE_BROWSER_VERSION}" = "stable" ]; then +if [ -f /opt/selenium/browser_version ] && [ "${SE_NODE_BROWSER_VERSION,,}" = "stable" ]; then SE_NODE_BROWSER_VERSION=$(short_version $(cat /opt/selenium/browser_version)) fi if [ -f /opt/selenium/browser_binary_location ] && [ -z "${SE_BROWSER_BINARY_LOCATION}" ]; then @@ -64,7 +64,7 @@ fi # 'browserName' is mandatory for default stereotype if [[ -z "${SE_NODE_STEREOTYPE}" ]] && [[ -n "${SE_NODE_BROWSER_NAME}" ]]; then - SE_NODE_STEREOTYPE="{\"browserName\": \"${SE_NODE_BROWSER_NAME}\", \"browserVersion\": \"${SE_NODE_BROWSER_VERSION}\", \"platformName\": \"Linux\", ${SE_BROWSER_BINARY_LOCATION}, \"se:containerName\": \"${SE_NODE_CONTAINER_NAME}\"}" + SE_NODE_STEREOTYPE="{\"browserName\": \"${SE_NODE_BROWSER_NAME}\", \"browserVersion\": \"${SE_NODE_BROWSER_VERSION}\", \"platformName\": \"${SE_NODE_PLATFORM_NAME}\", ${SE_BROWSER_BINARY_LOCATION}, \"se:containerName\": \"${SE_NODE_CONTAINER_NAME}\"}" else SE_NODE_STEREOTYPE="${SE_NODE_STEREOTYPE}" fi