[WIFI-10536] Chg: modify Dockerfile to support new library installation

Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
This commit is contained in:
Dmitry Dunaev
2022-09-06 15:16:50 +03:00
parent cbd9237643
commit 7eb288cdd2
2 changed files with 17 additions and 9 deletions

View File

@@ -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"]

16
setup_env.bash Normal file → Executable file
View File

@@ -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/"