summaryrefslogtreecommitdiffstats
path: root/testapi
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
commitea7706279a99c03181c348d29c157f70037ed217 (patch)
treecd6dad7d2e901c86aa4ddf0578f259614cfb0a8a /testapi
parent09a7b5a431e2f972af350205fc029919bc96195d (diff)
parentdfd85dece56f1b5f1addac121dcd5438f2c3774b (diff)
Merge "leverage setup.py directly to install TestAPI"
Diffstat (limited to 'testapi')
-rw-r--r--testapi/.gitignore3
-rw-r--r--testapi/docker/Dockerfile2
-rwxr-xr-xtestapi/install.sh30
-rw-r--r--testapi/setup.py9
4 files changed, 12 insertions, 32 deletions
diff --git a/testapi/.gitignore b/testapi/.gitignore
index c7b63b5..00f8a03 100644
--- a/testapi/.gitignore
+++ b/testapi/.gitignore
@@ -1,4 +1,7 @@
AUTHORS
ChangeLog
setup.cfg-e
+opnfv_testapi/static
+build
+*.egg-info
diff --git a/testapi/docker/Dockerfile b/testapi/docker/Dockerfile
index 5311f35..a46fce2 100644
--- a/testapi/docker/Dockerfile
+++ b/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/testapi/install.sh b/testapi/install.sh
deleted file mode 100755
index d470e38..0000000
--- a/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/testapi/setup.py b/testapi/setup.py
index f689cb3..dd52373 100644
--- a/testapi/setup.py
+++ b/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)