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):
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():
"""