371bdfaae02de770651d65222ed492b3aa4fedb7
[iec.git] / src / use_cases / seba_on_arm / test / ponsim / docker_run.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2020 Akraino IEC Team.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10 set -ex
11
12 CORD_REPO="${CORD_REPO:-https://github.com/iecedge/cord-tester.git}"
13 CORD_REV="cord-7.0-arm64"
14 VOLTHA_REPO="${VOLTHA_REPO:-https://github.com/opencord/voltha.git}"
15 VOLTHA_REV="master"
16 K8S_MASTER_IP="${K8S_MASTER_IP:-127.0.0.1}"
17 KUBE_DIR="${KUBE_DIR:-/workspace/.kube}"
18 USER="${USER:-ubuntu}"
19
20 # The ssh server must be running since cord-tester does ssh to localhost
21 sudo apt-get update
22 sudo apt-get install httpie -y
23 sudo apt-get install jq -y
24 sudo /etc/init.d/ssh restart
25 ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa 2>/dev/null <<< y >/dev/null
26 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
27 # Make sure ssh localhost works with no interruption
28 ssh-keyscan -H localhost >> ~/.ssh/known_hosts
29 cd "${HOME}"
30 sudo cp -r "${KUBE_DIR}" .kube
31 sudo chown -R "$(id -u)":"$(id -g)" .kube
32
33 git clone "${CORD_REPO}" cord-tester -b "${CORD_REV}"
34 git clone "${VOLTHA_REPO}" voltha -b "${VOLTHA_REV}"
35
36 cd cord-tester/
37 make venv_cord
38 pwd
39 # shellcheck disable=SC1091
40 source venv_cord/bin/activate
41 cd src/test/cord-api
42 # As per documentation, we set the SERVER_IP before anything
43 sed -i "s/SERVER_IP.*=.*'/SERVER_IP = '${K8S_MASTER_IP}'/g" \
44      Properties/RestApiProperties.py
45 cd Tests/WorkflowValidations/
46
47 export SERVER_IP="${K8S_MASTER_IP}"
48
49 TESTTAGS="stable"
50 PYBOT_ARGS="-v SUBSCRIBER_FILENAME:SIABSubscriberLatest -v WHITELIST_FILENAME:SIABWhitelistLatest -v OLT_DEVICE_FILENAME:SIABOLT0Device"
51 robot ${PYBOT_ARGS} --removekeywords wuks -e notready -i ${TESTTAGS} -v VOLTHA_DIR:${HOME}/voltha SIAB.robot