Mass-pnf-simulator publishing ports
Change-Id: If43f505967bd542c88956e11aef4cd4e52626255
Issue-ID: DCAEGEN2-1225
Signed-off-by: TamasBakai <tamas.bakai@est.tech>
diff --git a/test/mocks/mass-pnf-sim/mass-pnf-sim.py b/test/mocks/mass-pnf-sim/mass-pnf-sim.py
index ba05986..898cd65 100755
--- a/test/mocks/mass-pnf-sim/mass-pnf-sim.py
+++ b/test/mocks/mass-pnf-sim/mass-pnf-sim.py
@@ -14,11 +14,21 @@
)
parser.add_argument(
+ '--trigger',
+ help='Trigger one single VES event from each simulator',
+)
+
+parser.add_argument(
'--ipves',
help='IP of the VES collector',
)
parser.add_argument(
+ '--ipfileserver',
+ help='Visible IP of the file server (SFTP/FTPS) to be included in the VES event',
+)
+
+parser.add_argument(
'--ipstart',
help='IP address range beginning',
)
@@ -49,6 +59,8 @@
if args.bootstrap and args.ipstart and args.ipves:
print("Bootstrap:")
+ start_port=2000
+
for i in range(int(args.bootstrap)):
print("PNF simulator instance: " + str(i) + ".")
@@ -63,9 +75,15 @@
IpPnfSim = ipaddress.ip_address(args.ipstart) + int(2 + (i * 16))
print("\tIp Pnf SIM:" + str(IpPnfSim))
+ IpFileServer = args.ipfileserver
+
+
+ PortSftp=start_port +1
+ PortFtps=start_port +2
+ start_port +=2
IpFtps = ipaddress.ip_address(args.ipstart) + int(3 + (i * 16))
print("\tIp Ftps: " + str(IpFtps))
-
+
IpSftp = ipaddress.ip_address(args.ipstart) + int(4 + (i * 16))
print("\tIp Sftp:" + str(IpSftp))
@@ -84,6 +102,9 @@
str(i) + " " +\
str(args.ipves) + " " +\
str(IpPnfSim) + " " +\
+ str(IpFileServer) + " " +\
+ str(PortSftp) + " " +\
+ str(PortFtps) + " " +\
str(IpFtps) + " " +\
str(IpSftp)
@@ -139,6 +160,20 @@
shell=True)
print('Stopping:', completed.stdout)
+
+if args.trigger:
+ print("Triggering VES sending:")
+
+ for i in range(int(args.trigger)):
+ foldername = "pnf-sim-lw-" + str(i)
+
+ completed = subprocess.run(
+ 'cd ' +
+ foldername +
+ "; ./simulator.sh trigger-simulator",
+ shell=True)
+ print('Status:', completed.stdout)
+
else:
print("No instruction was defined")
sys.exit()