summaryrefslogtreecommitdiffstats
path: root/utils/test
diff options
context:
space:
mode:
authorSerena Feng <feng.xiaowei@zte.com.cn>2017-08-29 01:09:23 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-29 01:09:23 +0000
commitc83ab03b1b81623a8bedb9763b32de01ec492233 (patch)
treedf9431ecfae8f80b9224743fcee4c6f4bdb26d01 /utils/test
parent8c9c9640b1dddda0c228eaf5caf7855ed01fc967 (diff)
parent75f8fd597e060b1775192d581c04e8071cf56293 (diff)
Merge "leverage setup.py directly to install TestAPI"
Diffstat (limited to 'utils/test')
-rw-r--r--utils/test/testapi/.gitignore3
-rw-r--r--utils/test/testapi/docker/Dockerfile2
-rwxr-xr-xutils/test/testapi/install.sh30
-rw-r--r--utils/test/testapi/setup.py9
4 files changed, 12 insertions, 32 deletions
diff --git a/utils/test/testapi/.gitignore b/utils/test/testapi/.gitignore
index c7b63b5b1..00f8a03d0 100644
--- a/utils/test/testapi/.gitignore
+++ b/utils/test/testapi/.gitignore
@@ -1,4 +1,7 @@
AUTHORS
ChangeLog
setup.cfg-e
+opnfv_testapi/static
+build
+*.egg-info
diff --git a/utils/test/testapi/docker/Dockerfile b/utils/test/testapi/docker/Dockerfile
index 5311f35b8..a46fce20a 100644
--- a/utils/test/testapi/docker/Dockerfile
+++ b/utils/test/testapi/docker/Dockerfile
@@ -47,5 +47,5 @@ RUN git clone https://gerrit.opnfv.org/gerrit/releng /home/releng
WORKDIR /home/releng/utils/test/testapi/
RUN pip install -r requirements.txt
-RUN bash install.sh
+RUN python setup.py install
CMD ["bash", "docker/start-server.sh"]
diff --git a/utils/test/testapi/install.sh b/utils/test/testapi/install.sh
deleted file mode 100755
index d470e38c3..000000000
--- a/utils/test/testapi/install.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-
-usage="
-Script to install opnfv_tesgtapi automatically.
-This script should be run under root.
-
-usage:
- bash $(basename "$0") [-h|--help] [-t <test_name>]
-
-where:
- -h|--help show this help text"
-
-# Ref :- https://openstack.nimeyo.com/87286/openstack-packaging-all-definition-data-files-config-setup
-if [ -z "$VIRTUAL_ENV" ];
-then
- if [[ $(whoami) != "root" ]];
- then
- echo "Error: This script must be run as root!"
- exit 1
- fi
-else
- sed -i -e 's#/etc/opnfv_testapi =#etc/opnfv_testapi =#g' setup.cfg
-fi
-
-cp -fr 3rd_party/static opnfv_testapi/static
-python setup.py install
-rm -fr opnfv_testapi/static
-if [ ! -z "$VIRTUAL_ENV" ]; then
- sed -i -e 's#etc/opnfv_testapi =#/etc/opnfv_testapi =#g' setup.cfg
-fi \ No newline at end of file
diff --git a/utils/test/testapi/setup.py b/utils/test/testapi/setup.py
index f689cb30e..dd52373fd 100644
--- a/utils/test/testapi/setup.py
+++ b/utils/test/testapi/setup.py
@@ -1,5 +1,7 @@
-import setuptools
+import os
+import subprocess
+import setuptools
__author__ = 'serena'
@@ -8,6 +10,11 @@ try:
except ImportError:
pass
+dirpath = os.path.dirname(os.path.abspath(__file__))
+subprocess.call(['ln', '-s',
+ '{}/3rd_party/static'.format(dirpath),
+ '{}/opnfv_testapi/static'.format(dirpath)])
+
setuptools.setup(
setup_requires=['pbr==2.0.0'],
pbr=True)