aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2019-04-15 16:11:35 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-15 16:11:35 +0000
commitbb24444954aa1f6235c93103f90157b412121da2 (patch)
tree2629cc7ac492d9fa9ca97499784aecfe9600b3b1 /test
parent6c2e0b6fda6855163ca36961f7509aa7e7728735 (diff)
parent34a6f11443805872a658f176838ec703b13e4d47 (diff)
Merge "Mass-pnf-sim selective trigger"
Diffstat (limited to 'test')
-rw-r--r--test/mocks/mass-pnf-sim/README.md7
-rwxr-xr-xtest/mocks/mass-pnf-sim/mass-pnf-sim.py27
2 files changed, 34 insertions, 0 deletions
diff --git a/test/mocks/mass-pnf-sim/README.md b/test/mocks/mass-pnf-sim/README.md
index 7e98256eb..cbbf07574 100644
--- a/test/mocks/mass-pnf-sim/README.md
+++ b/test/mocks/mass-pnf-sim/README.md
@@ -30,6 +30,13 @@ Define the amount of simulators to be launched
###Trigger
./mass-pnf-sim.py --trigger 2
+###Trigger only a subset of the simulators
+./mass-pnf-sim.py --triggerstart 0 --triggerend 3
+#this will trigger 0,1,2,3
+
+./mass-pnf-sim.py --triggerstart 4 --triggerend 5
+#this will trigger 4,5
+
###Stop and clean
./mass-pnf-sim.py --stop 2
./mass-pnf-sim.py --clean
diff --git a/test/mocks/mass-pnf-sim/mass-pnf-sim.py b/test/mocks/mass-pnf-sim/mass-pnf-sim.py
index 8a4f390aa..773b97193 100755
--- a/test/mocks/mass-pnf-sim/mass-pnf-sim.py
+++ b/test/mocks/mass-pnf-sim/mass-pnf-sim.py
@@ -18,6 +18,17 @@ parser.add_argument(
help='Trigger one single VES event from each simulator',
)
+
+parser.add_argument(
+ '--triggerstart',
+ help='Trigger only a subset of the simulators (note --triggerend)',
+)
+
+parser.add_argument(
+ '--triggerend',
+ help='Last instance to trigger',
+)
+
parser.add_argument(
'--urlves',
help='URL of the VES collector',
@@ -176,6 +187,22 @@ if args.trigger:
"; ./simulator.sh trigger-simulator",
shell=True)
print('Status:', completed.stdout)
+
+if args.triggerstart and args.triggerend:
+ print("Triggering VES sending by a range of simulators:")
+
+ for i in range(int(args.triggerstart), int(args.triggerend)+1):
+ foldername = "pnf-sim-lw-" + str(i)
+ print("Instance being processed:" + str(i))
+
+ completed = subprocess.run(
+ 'cd ' +
+ foldername +
+ "; ./simulator.sh trigger-simulator",
+ shell=True)
+ print('Status:', completed.stdout)
+
+
else:
print("No instruction was defined")