Merge "Compass4NFV add new scenario nosdn-kvm"
[releng.git] / utils / test / testapi / install.sh
1 #!/bin/bash
2
3 usage="
4 Script to install opnfv_tesgtapi automatically.
5 This script should be run under root.
6
7 usage:
8     bash $(basename "$0") [-h|--help] [-t <test_name>]
9
10 where:
11     -h|--help         show this help text"
12
13 # Ref :-  https://openstack.nimeyo.com/87286/openstack-packaging-all-definition-data-files-config-setup
14 if [ -z "$VIRTUAL_ENV" ];
15 then
16     if [[ $(whoami) != "root" ]];
17     then
18         echo "Error: This script must be run as root!"
19         exit 1
20     fi
21 else
22     sed -i -e 's#/etc/opnfv_testapi =#etc/opnfv_testapi =#g' setup.cfg
23 fi
24
25 cp -fr 3rd_party/static opnfv_testapi/static
26 python setup.py install
27 rm -fr opnfv_testapi/static
28 if [ ! -z "$VIRTUAL_ENV" ]; then
29     sed -i -e 's#etc/opnfv_testapi =#/etc/opnfv_testapi =#g' setup.cfg
30 fi