aboutsummaryrefslogtreecommitdiffstats
path: root/test/mocks
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2020-05-15 07:38:04 -0700
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2020-05-15 07:38:04 -0700
commit5422700691d0c8c2f9f100b3d1599230b627de91 (patch)
tree24fcf513757c19a5d8dcab3ce71329ad689550c3 /test/mocks
parentbe79e4d2c5e9acacead38c264d356d4c82234342 (diff)
Run Maven directly
Maven will be run directly from MassPnfSim module, not through wrapper shell script. Change-Id: Ib2936391ace3cbd31c3b5bba4ad6d776cfb890d8 Issue-ID: INT-1577 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'test/mocks')
-rwxr-xr-xtest/mocks/mass-pnf-sim/MassPnfSim.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/mocks/mass-pnf-sim/MassPnfSim.py b/test/mocks/mass-pnf-sim/MassPnfSim.py
index 980be1535..f38da71e3 100755
--- a/test/mocks/mass-pnf-sim/MassPnfSim.py
+++ b/test/mocks/mass-pnf-sim/MassPnfSim.py
@@ -5,7 +5,7 @@ import time
import argparse
import ipaddress
from sys import exit
-from os import chdir, getcwd
+from os import chdir, getcwd, path
from shutil import copytree
from json import dumps
from requests import get
@@ -82,6 +82,7 @@ class MassPnfSim():
self.logger = logging.getLogger(__name__)
self.logger.setLevel(self.log_lvl)
self.sim_dirname_pattern = "pnf-sim-lw-"
+ self.mvn_build_cmd = 'mvn clean package docker:build -Dcheckstyle.skip'
def _run_cmd(self, cmd, dir_context='.'):
if self.args.verbose == 'debug':
@@ -165,8 +166,11 @@ class MassPnfSim():
def build(self):
self.logger.info("Building simulator image")
- completed = subprocess.run('set -x; cd pnf-sim-lightweight; ./simulator.sh build ', shell=True)
- self.logger.info(f"Build docker image: {completed.stdout}")
+ if path.isfile('pnf-sim-lightweight/pom.xml'):
+ self._run_cmd(self.mvn_build_cmd, 'pnf-sim-lightweight')
+ else:
+ self.logger.error('POM file was not found, Maven cannot run')
+ exit(1)
def clean(self):
self.logger.info('Cleaning simulators workdirs')