aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functest/odl-sfc/setup_scripts/tacker_client_install.sh
diff options
context:
space:
mode:
authorGeorge Paraskevopoulos <geopar@intracom-telecom.com>2016-12-13 11:27:36 +0200
committerGeorge Paraskevopoulos <geopar@intracom-telecom.com>2016-12-13 11:33:24 +0200
commit8b09f0ad06e5ae941fc497754cc5778fae9018de (patch)
treecac03d63b8b98805bbf001f41a81b35b11223149 /tests/functest/odl-sfc/setup_scripts/tacker_client_install.sh
parentcf27d8c61ee456fdd05f5e7d558bb8fadbff2fdc (diff)
Introduce setup_scripts directory
JIRA: SFC-52 Move every setup script to a separate directory. Change-Id: I99ea937a04d7580c7e85220091fe0c32213c587e Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
Diffstat (limited to 'tests/functest/odl-sfc/setup_scripts/tacker_client_install.sh')
-rwxr-xr-xtests/functest/odl-sfc/setup_scripts/tacker_client_install.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/functest/odl-sfc/setup_scripts/tacker_client_install.sh b/tests/functest/odl-sfc/setup_scripts/tacker_client_install.sh
new file mode 100755
index 00000000..adb9a44b
--- /dev/null
+++ b/tests/functest/odl-sfc/setup_scripts/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