diff options
author | Manuel Buil <manuel.buil@ericsson.com> | 2016-07-05 17:48:08 +0200 |
---|---|---|
committer | Manuel Buil <manuel.buil@ericsson.com> | 2016-07-05 17:50:34 +0200 |
commit | 65a5f65fa06c97456f37ca2434cf9e6fc9b758aa (patch) | |
tree | 35492df58fb303abd1b0e1ba4a3ece22926540ef /testcases/features/sfc/tacker_client_install.sh | |
parent | c3c67fa4f6f57646ac5d0028c794584a6bd3095c (diff) |
Add tacker installation to odl-sfc
A new directory is created and the script which installs tacker added
Change-Id: I5647bf28be6d1dc9b769aa265fe8ae9ec5c90ad2
Signed-off-by: Manuel Buil <manuel.buil@ericsson.com>
Diffstat (limited to 'testcases/features/sfc/tacker_client_install.sh')
-rwxr-xr-x | testcases/features/sfc/tacker_client_install.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/testcases/features/sfc/tacker_client_install.sh b/testcases/features/sfc/tacker_client_install.sh new file mode 100755 index 000000000..295dd262c --- /dev/null +++ b/testcases/features/sfc/tacker_client_install.sh @@ -0,0 +1,41 @@ +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 + chkPPkg stdeb + chkCrudini +} + +# 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}" +} + +envSetup +deployTackerClient |