Mass-pnf-sim selective trigger 92/85292/1
authorTamasBakai <tamas.bakai@est.tech>
Mon, 15 Apr 2019 08:38:51 +0000 (08:38 +0000)
committerTamasBakai <tamas.bakai@est.tech>
Mon, 15 Apr 2019 08:38:51 +0000 (08:38 +0000)
Change-Id: I187abf1953843329b5d4b2a424cbcb75a2d906c9
Issue-ID: DCAEGEN2-1434
Signed-off-by: TamasBakai <tamas.bakai@est.tech>
test/mocks/mass-pnf-sim/README.md
test/mocks/mass-pnf-sim/mass-pnf-sim.py

index 7e98256..cbbf075 100644 (file)
@@ -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
index 8a4f390..773b971 100755 (executable)
@@ -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")