Add function for Promise libraries pre-install 45/8045/1
authorjose.lausuch <jose.lausuch@ericsson.com>
Tue, 26 Jan 2016 10:34:14 +0000 (11:34 +0100)
committerMorgan Richomme <morgan.richomme@orange.com>
Tue, 26 Jan 2016 14:28:42 +0000 (14:28 +0000)
Change-Id: I149f87b9edc40435d32e493f771f58de46e2757f
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
(cherry picked from commit c08fa5882b111a65ebcf121b66d5107d481b66fd)

docker/Dockerfile
docker/run_tests.sh
testcases/config_functest.py

index 45aa05c..3c5a2a6 100644 (file)
@@ -54,8 +54,6 @@ libxml2-dev \
 libffi-dev \
 crudini \
 ruby1.9.1-dev \
-npm \
-nodejs \
 --no-install-recommends
 
 
index 50a1296..bf68612 100755 (executable)
@@ -165,7 +165,7 @@ test/csit/suites/vpnservice
       ;;
         "promise")
             info "Running PROMISE test case..."
-            python ${FUNCTEST_REPO_DIR}/testcases/features/promise.py --debug all ${report}
+            python ${FUNCTEST_REPO_DIR}/testcases/features/promise.py --debug ${report}
             clean_openstack
         ;;
         "doctor")
index 973c8a3..d1a1976 100755 (executable)
@@ -133,14 +133,7 @@ def action_start():
         cmd = "/bin/bash -c '" + script + "'"
         functest_utils.execute_command(cmd, logger = logger_debug, exit_on_error=False)
 
-
-        logger.info("Installing dependencies for Promise testcase...")
-        cmd = 'npm install -g yangforge'
-        functest_utils.execute_command(cmd,logger = logger_debug, exit_on_error=False)
-
-        shutil.copy2(REPOS_DIR+'/promise/package.json',FUNCTEST_REPO+'/testcases/features/package.json')
-        cmd = 'npm install'
-        functest_utils.execute_command(cmd,logger = logger_debug, exit_on_error=False)
+        install_promise(logger_debug)
 
         # Create result folder under functest if necessary
         if not os.path.exists(RALLY_RESULT_DIR):
@@ -261,6 +254,24 @@ def install_rally():
 
     return True
 
+def install_promise(logger_debug):
+    logger.info("Installing dependencies for Promise testcase...")
+    current_dir = os.getcwd()
+    os.chdir(REPOS_DIR+'/promise/')
+
+    cmd = 'curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -'
+    functest_utils.execute_command(cmd,logger = logger_debug, exit_on_error=False)
+
+    cmd = 'sudo apt-get install -y nodejs'
+    functest_utils.execute_command(cmd,logger = logger_debug, exit_on_error=False)
+
+    cmd = 'sudo npm -g install npm@latest'
+    functest_utils.execute_command(cmd,logger = logger_debug, exit_on_error=False)
+
+    cmd = 'npm install'
+    functest_utils.execute_command(cmd,logger = logger_debug, exit_on_error=False)
+    os.chdir(current_dir)
+
 
 def check_rally():
     """