From 7eb288cdd2d12792e0047fed8ae19f7bd433d999 Mon Sep 17 00:00:00 2001 From: Dmitry Dunaev Date: Tue, 6 Sep 2022 15:16:50 +0300 Subject: [PATCH] [WIFI-10536] Chg: modify Dockerfile to support new library installation Signed-off-by: Dmitry Dunaev --- docker/Dockerfile | 10 +++++++++- setup_env.bash | 16 ++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) mode change 100644 => 100755 setup_env.bash diff --git a/docker/Dockerfile b/docker/Dockerfile index 86fa1c166..b382768e4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,8 @@ FROM python:3.8 +# Version of cloudsdk to be tested +ARG CLOUDSDK_LIBRARY=tip_2x +ARG TEST_DEVICE_NAME=all + RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ tshark \ && rm -rf /var/lib/apt/lists/* @@ -10,5 +14,9 @@ COPY requirements.txt requirements.txt RUN pip3 install -r requirements.txt COPY tests /wlan-testing/tests COPY libs /wlan-testing/libs +COPY setup_env.bash /wlan-testing/setup_env.bash +ENV PYTHON=/usr/local/bin/python3 +ENV PIP=/usr/local/bin/pip3 +RUN /wlan-testing/setup_env.bash -t $CLOUDSDK_LIBRARY -d $TEST_DEVICE_NAME -n "TIP Automation" -o TIP -e tip-automation@telecominfraproject.com -i "TIP OpenWIFI Library" WORKDIR /wlan-testing -ENTRYPOINT ["bash"] +ENTRYPOINT ["/bin/bash"] diff --git a/setup_env.bash b/setup_env.bash old mode 100644 new mode 100755 index 1c7f284a3..78bfa7d1a --- a/setup_env.bash +++ b/setup_env.bash @@ -1,8 +1,10 @@ -#!/usr/bin/bash +#!/bin/bash # Setup python environment variable and pip environment variable like # export PYTHON=/usr/bin/python3 # export PIP=/usr/bin/pip3 #sh setup_env.bash -t tip_2x -d all -n "Shivam Thakur" -o TIP -e shivam.thakur@candelatech.com -i "TIP OpenWIFI 2.X Library" +set -e + helpFunction() { echo "Open Wifi CICD Test Automation Installation" @@ -99,7 +101,7 @@ then Email:$email description:$description \"\"\"" >> tests/imports.py - echo -e " + echo -e " try: target = importlib.import_module(\"tip_2x\") target = target.tip_2x @@ -117,7 +119,7 @@ except ImportError as e: Email:$email description:Candela LANforge Based Library \"\"\"" >> tests/imports.py - echo -e " + echo -e " try: lanforge_libs = importlib.import_module(\"lanforge_scripts.lf_libs.lf_libs\") lf_libs = lanforge_libs.lf_libs @@ -128,7 +130,7 @@ except ImportError as e: print(e) sys.exit(\"Python Import Error: \" + str(e)) " >> tests/imports.py - echo -e "########################################################################################################################" >> tests/imports.py + echo -e "########################################################################################################################" >> tests/imports.py cd libs/perfecto_interop $PYTHON setup.py bdist_wheel $PIP install dist/*.whl --force-reinstall @@ -142,7 +144,7 @@ except ImportError as e: Email:$email description:Perfecto Based Interop Library \"\"\"" >> tests/imports.py - echo -e " + echo -e " try: perfecto_interop = importlib.import_module(\"perfecto_interop\") android_tests = perfecto_interop.android_tests @@ -151,9 +153,7 @@ except ImportError as e: print(e) sys.exit(\"Python Import Error: \" + str(e)) " >> tests/imports.py - echo -e "########################################################################################################################" >> tests/imports.py - - + echo -e "########################################################################################################################" >> tests/imports.py fi fi WLAN_TESTING_PATH=$(pwd)"/tests/"