summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorvitikkan <viktor.tikkanen@nokia.com>2016-05-16 08:05:45 +0300
committervitikkan <viktor.tikkanen@nokia.com>2016-05-16 08:28:11 +0300
commit9bdb8955ba266abc34e1ab069ad0ee013dcf57ba (patch)
tree573772f8a5961bda3cbdd1d2a0fec4aa9cac0186 /utils
parent24165377a66c8aeab28872cbc281b863092e1237 (diff)
BGPVPN test case refactored
BGPVPN test case is refactored and moved into bgpvpn.py module. JIRA: FUNCTEST-234 Change-Id: Ib0dd6e11f3c568470d9c3837ca192da767c64843 Signed-off-by: vitikkan <viktor.tikkanen@nokia.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/functest_utils.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/utils/functest_utils.py b/utils/functest_utils.py
index 2d871615a..8ee5346c1 100644
--- a/utils/functest_utils.py
+++ b/utils/functest_utils.py
@@ -18,6 +18,7 @@ import socket
import subprocess
import sys
import urllib2
+import yaml
from git import Repo
@@ -235,3 +236,28 @@ def execute_command(cmd, logger=None,
sys.exit(1)
return p.returncode
+
+
+def get_deployment_dir(logger=None):
+ """
+ Returns current Rally deployment directory
+ """
+ with open(os.environ["CONFIG_FUNCTEST_YAML"]) as f:
+ functest_yaml = yaml.safe_load(f)
+ f.close()
+ deployment_name = functest_yaml.get("rally").get("deployment_name")
+ rally_dir = functest_yaml.get("general").get("directories").get(
+ "dir_rally_inst")
+ cmd = ("rally deployment list | awk '/" + deployment_name +
+ "/ {print $2}'")
+ p = subprocess.Popen(cmd, shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT)
+ deployment_uuid = p.stdout.readline().rstrip()
+ if deployment_uuid == "":
+ if logger:
+ logger.error("Rally deployment not found.")
+ exit(-1)
+ deployment_dir = (rally_dir + "/tempest/for-deployment-" +
+ deployment_uuid)
+ return deployment_dir