From 107e61635c2ab1feb5263380ea63e21cf2e6e65b Mon Sep 17 00:00:00 2001 From: Morgan Richomme Date: Tue, 8 Nov 2016 14:18:12 +0100 Subject: Repo structure modification - create functest subdirectory - rename unit tests - adapt path in exec and config files JIRA: FUNCTEST-525 Change-Id: Ifd5c6edfb5bda1b09f82848e2269ad5fbeb84d0a Signed-off-by: Morgan Richomme --- .../features/sfc/tacker_client_install.sh | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 functest/opnfv_tests/features/sfc/tacker_client_install.sh (limited to 'functest/opnfv_tests/features/sfc/tacker_client_install.sh') diff --git a/functest/opnfv_tests/features/sfc/tacker_client_install.sh b/functest/opnfv_tests/features/sfc/tacker_client_install.sh new file mode 100755 index 00000000..adb9a44b --- /dev/null +++ b/functest/opnfv_tests/features/sfc/tacker_client_install.sh @@ -0,0 +1,43 @@ +MYDIR=$(dirname $(readlink -f "$0")) +CLIENT=$(echo python-python-tackerclient_*_all.deb) +CLIREPO="tacker-client" + +# Function checks whether a python egg is available, if not, installs +function chkPPkg() { + PKG="$1" + IPPACK=$(python - <<'____EOF' +import pip +from os.path import join +for package in pip.get_installed_distributions(): + print(package.location) + print(join(package.location, *package._get_metadata("top_level.txt"))) +____EOF +) + echo "$IPPACK" | grep -q "$PKG" + if [ $? -ne 0 ];then + pip install "$PKG" + fi +} + +function envSetup() { + apt-get install -y python-all debhelper fakeroot + #pip install --upgrade python-keystoneclient==1.7.4 + chkPPkg stdeb +} + +# Function installs python-tackerclient from github +function deployTackerClient() { + cd $MYDIR + git clone -b 'SFC_refactor' https://github.com/trozet/python-tackerclient.git $CLIREPO + cd $CLIREPO + python setup.py --command-packages=stdeb.command bdist_deb + cd "deb_dist" + CLIENT=$(echo python-python-tackerclient_*_all.deb) + cp $CLIENT $MYDIR + dpkg -i "${MYDIR}/${CLIENT}" + apt-get -f -y install + dpkg -i "${MYDIR}/${CLIENT}" +} + +envSetup +deployTackerClient -- cgit 1.2.3-korg