diff options
Diffstat (limited to 'csit')
-rw-r--r-- | csit/data/test-tree.json | 6 | ||||
-rwxr-xr-x | csit/prepare-csit.sh | 36 | ||||
-rw-r--r-- | csit/pylibs.txt | 4 | ||||
-rwxr-xr-x | csit/run-csit.sh | 23 | ||||
-rw-r--r-- | csit/tests/cps-data/cps-data.robot | 4 |
5 files changed, 59 insertions, 14 deletions
diff --git a/csit/data/test-tree.json b/csit/data/test-tree.json index 89d6784275..8f4b522799 100644 --- a/csit/data/test-tree.json +++ b/csit/data/test-tree.json @@ -2,11 +2,11 @@ "test-tree": { "branch": [ { - "name": "Left", + "name": "LEFT/left", "nest": { - "name": "Small", + "name": "SMALL/small", "birds": [ - "Sparrow", + "SPARROW/sparrow", "Robin", "Finch" ] diff --git a/csit/prepare-csit.sh b/csit/prepare-csit.sh index b56c3855dd..78f0fbde22 100755 --- a/csit/prepare-csit.sh +++ b/csit/prepare-csit.sh @@ -20,12 +20,29 @@ # Branched from ccsdk/distribution to this repository Feb 23, 2021 # +echo "---> prepare-csit.sh" + if [ -z "$WORKSPACE" ]; then export WORKSPACE=`git rev-parse --show-toplevel` fi TESTPLANDIR=${WORKSPACE}/${TESTPLAN} +# Version should match those used to setup robot-framework in other jobs/stages +# Use pyenv for selecting the python version +if [[ -d "/opt/pyenv" ]]; then + echo "Setup pyenv:" + export PYENV_ROOT="/opt/pyenv" + export PATH="$PYENV_ROOT/bin:$PATH" + pyenv versions + if command -v pyenv 1>/dev/null 2>&1; then + eval "$(pyenv init - --no-rehash)" + # Choose the latest numeric Python version from installed list + version=$(pyenv versions --bare | sed '/^[^0-9]/d' | sort -V | tail -n 1) + pyenv local "${version}" + fi +fi + # Assume that if ROBOT3_VENV is set and virtualenv with system site packages can be activated, # ci-management/jjb/integration/include-raw-integration-install-robotframework.sh has already # been executed @@ -35,17 +52,22 @@ if [ -f ${WORKSPACE}/env.properties ]; then fi if [ -f ${ROBOT3_VENV}/bin/activate ]; then source ${ROBOT3_VENV}/bin/activate -#else -# rm -rf /tmp/ci-management -# rm -f ${WORKSPACE}/env.properties -# cd /tmp -# source ${WORKSPACE}/install-robotframework.sh +else + rm -rf /tmp/ci-management + rm -f ${WORKSPACE}/env.properties + cd /tmp + git clone "https://gerrit.onap.org/r/ci-management" +# source /tmp/ci-management/jjb/integration/include-raw-integration-install-robotframework-py3.sh + source ${WORKSPACE}/install-robotframework.sh fi # install eteutils mkdir -p ${ROBOT3_VENV}/src/onap rm -rf ${ROBOT3_VENV}/src/onap/testsuite -python3 -m pip install --upgrade --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" 'robotframework-onap==0.5.1.*' --pre -pip freeze +python3 -m pip install --upgrade --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" 'robotframework-onap==11.0.0.dev17' --pre +echo "Versioning information:" +python3 --version +pip freeze +python3 -m robot.run --version || :
\ No newline at end of file diff --git a/csit/pylibs.txt b/csit/pylibs.txt index d6250dbab5..9fee634156 100644 --- a/csit/pylibs.txt +++ b/csit/pylibs.txt @@ -5,8 +5,8 @@ netifaces pyhocon requests robotframework-httplibrary -robotframework-requests -robotframework-selenium2library +robotframework-requests==0.9.3 +robotframework-selenium2library==3.0.0 robotframework-extendedselenium2library robotframework-sshlibrary scapy diff --git a/csit/run-csit.sh b/csit/run-csit.sh index 25f5f6a77a..9a344c1ffd 100755 --- a/csit/run-csit.sh +++ b/csit/run-csit.sh @@ -20,8 +20,25 @@ # Branched from ccsdk/distribution to this repository Feb 23, 2021 +echo "---> run-csit.sh" + WORKDIR=$(mktemp -d --suffix=-robot-workdir) +# Version should match those used to setup robot-framework in other jobs/stages +# Use pyenv for selecting the python version +if [[ -d "/opt/pyenv" ]]; then + echo "Setup pyenv:" + export PYENV_ROOT="/opt/pyenv" + export PATH="$PYENV_ROOT/bin:$PATH" + pyenv versions + if command -v pyenv 1>/dev/null 2>&1; then + eval "$(pyenv init - --no-rehash)" + # Choose the latest numeric Python version from installed list + version=$(pyenv versions --bare | sed '/^[^0-9]/d' | sort -V | tail -n 1) + pyenv local "${version}" + fi +fi + # # functions # @@ -190,6 +207,12 @@ SUITES=$( xargs -a testplan.txt ) echo ROBOT_VARIABLES="${ROBOT_VARIABLES}" echo "Starting Robot test suites ${SUITES} ..." relax_set + +echo "Versioning information:" +python3 --version +pip freeze +python3 -m robot.run --version || : + python3 -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} RESULT=$? load_set diff --git a/csit/tests/cps-data/cps-data.robot b/csit/tests/cps-data/cps-data.robot index 2da2b73414..096bd07b79 100644 --- a/csit/tests/cps-data/cps-data.robot +++ b/csit/tests/cps-data/cps-data.robot @@ -44,10 +44,10 @@ Create Data Node Get Data Node by XPath ${uri}= Set Variable ${basePath}/v1/dataspaces/${dataspaceName}/anchors/${anchorName}/node - ${params}= Create Dictionary xpath=/test-tree/branch[@name='Left']/nest + ${params}= Create Dictionary xpath=/test-tree/branch[@name='LEFT/left']/nest ${headers}= Create Dictionary Authorization=${auth} ${response}= Get On Session CPS_URL ${uri} params=${params} headers=${headers} expected_status=200 ${responseJson}= Set Variable ${response.json()['tree:nest']} - Should Be Equal As Strings ${responseJson['name']} Small + Should Be Equal As Strings ${responseJson['name']} SMALL/small |