aboutsummaryrefslogtreecommitdiffstats
path: root/test/mocks/mass-pnf-sim
diff options
context:
space:
mode:
Diffstat (limited to 'test/mocks/mass-pnf-sim')
-rwxr-xr-xtest/mocks/mass-pnf-sim/MassPnfSim.py4
-rw-r--r--test/mocks/mass-pnf-sim/README.md10
2 files changed, 12 insertions, 2 deletions
diff --git a/test/mocks/mass-pnf-sim/MassPnfSim.py b/test/mocks/mass-pnf-sim/MassPnfSim.py
index 1a6ae8a78..97ebafc77 100755
--- a/test/mocks/mass-pnf-sim/MassPnfSim.py
+++ b/test/mocks/mass-pnf-sim/MassPnfSim.py
@@ -34,6 +34,8 @@ def get_parser():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(title='Subcommands', dest='subcommand')
+ # Build command parser
+ subparsers.add_parser('build', help='Build simulator image')
# Bootstrap command parser
parser_bootstrap = subparsers.add_parser('bootstrap', help='Bootstrap the system')
parser_bootstrap.add_argument('--count', help='Instance count to bootstrap', type=int, metavar='INT', default=1)
@@ -152,6 +154,8 @@ class MassPnfSim():
self.logger.info(f'Done setting up instance #{i}')
+ 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}")
diff --git a/test/mocks/mass-pnf-sim/README.md b/test/mocks/mass-pnf-sim/README.md
index 0e6ac0364..fc829f5d1 100644
--- a/test/mocks/mass-pnf-sim/README.md
+++ b/test/mocks/mass-pnf-sim/README.md
@@ -15,7 +15,13 @@ The ipstart should align to a /28 Ip address range start (e.g. 10.11.0.16, 10.11
For debug purposes, you can use your own IP address as VES collector, use "ip" command to determine it.
-Example:
+### Build simulator image
+
+```
+./mass-pnf-sim.py build
+```
+
+### Bootstrap simulator instances
```
./mass-pnf-sim.py bootstrap --count 2 --urlves http://10.148.95.??:10000/eventListener/v7 --ipfileserver 10.148.95.??? --typefileserver sftp --ipstart 10.11.0.16
@@ -74,5 +80,5 @@ python3 -m trace --trace --count -C . ./mass-pnf-sim.py .....
### Cleaning and recovery after incorrect configuration
```
-docker stop $(docker ps -aq); docker rm $(docker ps -aq)
+./clean.sh
```