blob: ef46535f5719d1dfbcef2d46fa0b874391705db7 [file] [log] [blame]
TamasBakai9b780332019-02-15 08:38:16 +00001import argparse
2import os
3from werkzeug import secure_filename
4from flask import Flask, render_template, request
5from time import sleep
6import sys
7import json
8from flask import Flask
9app = Flask(__name__)
10
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +000011#Server info
12HOST_IP = "0.0.0.0"
13HOST_PORT = 2222
TamasBakai9b780332019-02-15 08:38:16 +000014
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +000015#Test function to check server running
16@app.route('/',
17 methods=['GET'])
18def index():
19 return 'Hello world'
TamasBakai9b780332019-02-15 08:38:16 +000020
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +000021#Returns number of polls
22@app.route('/ctr_requests',
23 methods=['GET'])
24def counter_requests():
25 global ctr_requests
26 return str(ctr_requests)
27
28#Returns number of replies
29@app.route('/ctr_responses',
30 methods=['GET'])
31def counter_responses():
32 global ctr_responses
33 return str(ctr_responses)
34
35#Returns number of unique files
36@app.route('/ctr_unique_files',
37 methods=['GET'])
38def counter_uniquefiles():
39 global fileMap
40 return str(len(fileMap))
41
42#Returns tc info
43@app.route('/tc_info',
44 methods=['GET'])
45def testcase_info():
46 global tc_num
47 return tc_num
48
49#Messages polling function
TamasBakai9b780332019-02-15 08:38:16 +000050@app.route(
51 "/events/unauthenticated.VES_NOTIFICATION_OUTPUT/OpenDcae-c12/C12",
52 methods=['GET'])
53def MR_reply():
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +000054 global ctr_requests
55 global args
TamasBakai9b780332019-02-15 08:38:16 +000056
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +000057 ctr_requests = ctr_requests + 1
58 print("MR: poll request#: " + str(ctr_requests))
TamasBakai9b780332019-02-15 08:38:16 +000059
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +000060 if args.tc100:
61 return tc100("sftp")
62 elif args.tc101:
63 return tc101("sftp")
64 elif args.tc102:
65 return tc102("sftp")
TamasBakai9b780332019-02-15 08:38:16 +000066
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +000067 elif args.tc110:
68 return tc110("sftp")
69 elif args.tc111:
70 return tc111("sftp")
71 elif args.tc112:
72 return tc112("sftp")
73 elif args.tc113:
74 return tc113("sftp")
TamasBakai9b780332019-02-15 08:38:16 +000075
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +000076 elif args.tc120:
77 return tc120("sftp")
78 elif args.tc121:
79 return tc121("sftp")
80 elif args.tc122:
81 return tc122("sftp")
TamasBakai9b780332019-02-15 08:38:16 +000082
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +000083 elif args.tc1000:
84 return tc1000("sftp")
85 elif args.tc1001:
86 return tc1001("sftp")
TamasBakai9b780332019-02-15 08:38:16 +000087
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +000088 elif args.tc510:
89 return tc510("sftp")
TamasBakai9b780332019-02-15 08:38:16 +000090
91
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +000092 elif args.tc200:
93 return tc200("ftps")
94 elif args.tc201:
95 return tc201("ftps")
96 elif args.tc202:
97 return tc202("ftps")
TamasBakai9b780332019-02-15 08:38:16 +000098
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +000099 elif args.tc210:
100 return tc210("ftps")
101 elif args.tc211:
102 return tc211("ftps")
103 elif args.tc212:
104 return tc212("ftps")
105 elif args.tc213:
106 return tc213("ftps")
TamasBakai9b780332019-02-15 08:38:16 +0000107
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000108 elif args.tc220:
109 return tc220("ftps")
110 elif args.tc221:
111 return tc221("ftps")
112 elif args.tc222:
113 return tc222("ftps")
114
115 elif args.tc2000:
116 return tc2000("ftps")
117 elif args.tc2001:
118 return tc2001("ftps")
119
120 elif args.tc610:
121 return tc510("ftps")
122
123
124#### Test case functions
125
126
127def tc100(ftptype):
128 global ctr_responses
129 global ctr_unique_files
130
131 ctr_responses = ctr_responses + 1
132
133 if (ctr_responses > 1):
134 return buildOkResponse("[]")
135
136 seqNr = (ctr_responses-1)
137 msg = getEventHead() + getEventName("1MB_" + str(seqNr) + ".tar.gz",ftptype,"onap","pano","localhost",1022) + getEventEnd()
138 fileMap[seqNr] = seqNr
139 return buildOkResponse("["+msg+"]")
140
141def tc101(ftptype):
142 global ctr_responses
143 global ctr_unique_files
144
145 ctr_responses = ctr_responses + 1
146
147 if (ctr_responses > 1):
148 return buildOkResponse("[]")
149
150 seqNr = (ctr_responses-1)
151 msg = getEventHead() + getEventName("5MB_" + str(seqNr) + ".tar.gz",ftptype,"onap","pano","localhost",1022) + getEventEnd()
152 fileMap[seqNr] = seqNr
153
154 return buildOkResponse("["+msg+"]")
155
156def tc102(ftptype):
157 global ctr_responses
158 global ctr_unique_files
159
160 ctr_responses = ctr_responses + 1
161
162 if (ctr_responses > 1):
163 return buildOkResponse("[]")
164
165 seqNr = (ctr_responses-1)
166 msg = getEventHead() + getEventName("50MB_" + str(seqNr) + ".tar.gz",ftptype,"onap","pano","localhost",1022) + getEventEnd()
167 fileMap[seqNr] = seqNr
168
169 return buildOkResponse("["+msg+"]")
170
171def tc110(ftptype):
172 global ctr_responses
173 global ctr_unique_files
174
175 ctr_responses = ctr_responses + 1
176
177 if (ctr_responses > 100):
178 return buildOkResponse("[]")
179
180 seqNr = (ctr_responses-1)
181 msg = getEventHead() + getEventName("1MB_" + str(seqNr) + ".tar.gz",ftptype,"onap","pano","localhost",1022) + getEventEnd()
182 fileMap[seqNr] = seqNr
183
184 return buildOkResponse("["+msg+"]")
185
186def tc111(ftptype):
187 global ctr_responses
188 global ctr_unique_files
189
190 ctr_responses = ctr_responses + 1
191
192 if (ctr_responses > 100):
193 return buildOkResponse("[]")
194
195 msg = getEventHead()
196
197 for i in range(100):
198 seqNr = i+(ctr_responses-1)
199 if i != 0: msg = msg + ","
200 msg = msg + getEventName("1MB_" + str(seqNr) + ".tar.gz",ftptype,"onap","pano","localhost",1022)
201 fileMap[seqNr] = seqNr
202
203 msg = msg + getEventEnd()
204
205 return buildOkResponse("["+msg+"]")
206
207def tc112(ftptype):
208 global ctr_responses
209 global ctr_unique_files
210
211 ctr_responses = ctr_responses + 1
212
213 if (ctr_responses > 100):
214 return buildOkResponse("[]")
215
216 msg = getEventHead()
217
218 for i in range(100):
219 seqNr = i+(ctr_responses-1)
220 if i != 0: msg = msg + ","
221 msg = msg + getEventName("5MB_" + str(seqNr) + ".tar.gz",ftptype,"onap","pano","localhost",1022)
222 fileMap[seqNr] = seqNr
223
224 msg = msg + getEventEnd()
225
226 return buildOkResponse("["+msg+"]")
227
228def tc113(ftptype):
229 global ctr_responses
230 global ctr_unique_files
231
232 ctr_responses = ctr_responses + 1
233
234 if (ctr_responses > 1):
235 return buildOkResponse("[]")
236
237 msg = ""
238
239 for evts in range(100): # build 100 evts
240 if (evts > 0):
241 msg = msg + ","
242 msg = msg + getEventHead()
243 for i in range(100): # build 100 files
244 seqNr = i+evts+100*(ctr_responses-1)
245 if i != 0: msg = msg + ","
246 msg = msg + getEventName("1MB_" + str(seqNr) + ".tar.gz",ftptype,"onap","pano","localhost",1022)
247 fileMap[seqNr] = seqNr
248
249 msg = msg + getEventEnd()
250
251 return buildOkResponse("["+msg+"]")
252
253
254def tc120(ftptype):
255 global ctr_responses
256 global ctr_unique_files
257
258 ctr_responses = ctr_responses + 1
259
260 if (ctr_responses > 100):
261 return buildOkResponse("[]")
262
263 if (ctr_responses % 10 == 2):
264 return # Return nothing
265
266 if (ctr_responses % 10 == 3):
267 return buildOkResponse("") # Return empty message
268
269 if (ctr_responses % 10 == 4):
270 return buildOkResponse(getEventHead()) # Return part of a json event
271
272 if (ctr_responses % 10 == 5):
273 return buildEmptyResponse(404) # Return empty message with status code
274
275 if (ctr_responses % 10 == 6):
276 sleep(60)
277
278
279 msg = getEventHead()
280
281 for i in range(100):
282 seqNr = i+(ctr_responses-1)
283 if i != 0: msg = msg + ","
284 msg = msg + getEventName("1MB_" + str(seqNr) + ".tar.gz",ftptype,"onap","pano","localhost",1022)
285 fileMap[seqNr] = seqNr
286
287 msg = msg + getEventEnd()
288
289 return buildOkResponse("["+msg+"]")
290
291def tc121(ftptype):
292 global ctr_responses
293 global ctr_unique_files
294
295 ctr_responses = ctr_responses + 1
296
297 if (ctr_responses > 100):
298 return buildOkResponse("[]")
299
300 msg = getEventHead()
301
302 for i in range(100):
303 seqNr = i+(ctr_responses-1)
304 if (seqNr%10 == 0): # Every 10th file is "missing"
305 fn = "MissingFile_" + str(seqNr) + ".tar.gz"
306 else:
307 fn = "1MB_" + str(seqNr) + ".tar.gz"
308 fileMap[seqNr] = seqNr
309
310 if i != 0: msg = msg + ","
311 msg = msg + getEventName(fn,ftptype,"onap","pano","localhost",1022)
312
313
314 msg = msg + getEventEnd()
315
316 return buildOkResponse("["+msg+"]")
317
318def tc122(ftptype):
319 global ctr_responses
320 global ctr_unique_files
321
322 ctr_responses = ctr_responses + 1
323
324 if (ctr_responses > 100):
325 return buildOkResponse("[]")
326
327 msg = getEventHead()
328
329 for i in range(100):
330 fn = "1MB_0.tar.gz" # All files identical names
331 if i != 0: msg = msg + ","
332 msg = msg + getEventName(fn,ftptype,"onap","pano","localhost",1022)
333
334 fileMap[0] = 0
335 msg = msg + getEventEnd()
336
337 return buildOkResponse("["+msg+"]")
338
339
340def tc1000(ftptype):
341 global ctr_responses
342 global ctr_unique_files
343
344 ctr_responses = ctr_responses + 1
345
346 msg = getEventHead()
347
348 for i in range(100):
349 seqNr = i+(ctr_responses-1)
350 if i != 0: msg = msg + ","
351 msg = msg + getEventName("1MB_" + str(seqNr) + ".tar.gz",ftptype,"onap","pano","localhost",1022)
352 fileMap[seqNr] = seqNr
353
354 msg = msg + getEventEnd()
355
356 return buildOkResponse("["+msg+"]")
357
358def tc1001(ftptype):
359 global ctr_responses
360 global ctr_unique_files
361
362 ctr_responses = ctr_responses + 1
363
364 msg = getEventHead()
365
366 for i in range(100):
367 seqNr = i+(ctr_responses-1)
368 if i != 0: msg = msg + ","
369 msg = msg + getEventName("5MB_" + str(seqNr) + ".tar.gz",ftptype,"onap","pano","localhost",1022)
370 fileMap[seqNr] = seqNr
371
372 msg = msg + getEventEnd()
373
374 return buildOkResponse("["+msg+"]")
375
376def tc510(ftptype):
377 global ctr_responses
378 global ctr_unique_files
379
380 ctr_responses = ctr_responses + 1
381
382 if (ctr_responses > 5):
383 return buildOkResponse("[]")
384
385 msg = ""
386
387 for evts in range(700): # build events for 5 MEs
388 if (evts > 0):
389 msg = msg + ","
390 msg = msg + getEventHeadNodeName("PNF"+str(evts))
391 seqNr = (ctr_responses-1)
392 msg = msg + getEventName("1MB_" + str(seqNr) + ".tar.gz",ftptype,"onap","pano","localhost",1022)
393 seqNr = seqNr + evts*1000000 #Create unique id for this node and file
394 fileMap[seqNr] = seqNr
395 msg = msg + getEventEnd()
396
397 return buildOkResponse("["+msg+"]")
398
399#Mapping FTPS TCs
400def tc200(ftptype):
401 return tc100(ftptype)
402def tc201(ftptype):
403 return tc101(ftptype)
404def tc202(ftptype):
405 return tc102(ftptype)
406
407def tc210(ftptype):
408 return tc110(ftptype)
409def tc211(ftptype):
410 return tc111(ftptype)
411def tc212(ftptype):
412 return tc112(ftptype)
413def tc213(ftptype):
414 return tc113(ftptype)
415
416def tc220(ftptype):
417 return tc120(ftptype)
418def tc221(ftptype):
419 return tc121(ftptype)
420def tc222(ftptype):
421 return tc122(ftptype)
422
423def tc2000(ftptype):
424 return tc1000(ftptype)
425def tc2001(ftptype):
426 return tc1001(ftptype)
427
428#### Functions to build json messages and respones ####
429
430# Function to build fixed beginning of an event
431def getEventHead():
432 return getEventHeadNodeName("oteNB5309")
433
434def getEventHeadNodeName(nodename):
435 headStr = """
436 {
TamasBakai9b780332019-02-15 08:38:16 +0000437 "event": {
438 "commonEventHeader": {
439 "startEpochMicrosec": 8745745764578,
440 "eventId": "FileReady_1797490e-10ae-4d48-9ea7-3d7d790b25e1",
441 "timeZoneOffset": "UTC+05.30",
442 "internalHeaderFields": {
443 "collectorTimeStamp": "Tue, 09 18 2018 10:56:52 UTC"
444 },
445 "priority": "Normal",
446 "version": "4.0.1",
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000447 "reportingEntityName": \"""" + nodename + """",
TamasBakai9b780332019-02-15 08:38:16 +0000448 "sequence": 0,
449 "domain": "notification",
450 "lastEpochMicrosec": 8745745764578,
451 "eventName": "Noti_RnNode-Ericsson_FileReady",
452 "vesEventListenerVersion": "7.0.1",
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000453 "sourceName": \"""" + nodename + """"
TamasBakai9b780332019-02-15 08:38:16 +0000454 },
455 "notificationFields": {
456 "notificationFieldsVersion": "2.0",
457 "changeType": "FileReady",
458 "changeIdentifier": "PM_MEAS_FILES",
459 "arrayOfNamedHashMap": [
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000460 """
461 return headStr
462
463# Function to build the variable part of an event
464def getEventName(fn,type,user,passwd,ip,port):
465 nameStr = """{
466 "name": \"""" + fn + """",
TamasBakai9b780332019-02-15 08:38:16 +0000467 "hashMap": {
468 "fileFormatType": "org.3GPP.32.435#measCollec",
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000469 "location": \"""" + type + """://""" + user + """:""" + passwd + """@""" + ip + """:""" + str(port) + """/""" + fn + """",
TamasBakai9b780332019-02-15 08:38:16 +0000470 "fileFormatVersion": "V10",
471 "compression": "gzip"
472 }
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000473 } """
474 return nameStr
475
476# Function to build fixed end of an event
477def getEventEnd():
478 endStr = """
TamasBakai9b780332019-02-15 08:38:16 +0000479 ]
480 }
481 }
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000482 }
483 """
484 return endStr
TamasBakai9b780332019-02-15 08:38:16 +0000485
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000486# Function to build an OK reponse from a message string
487def buildOkResponse(msg):
488 response = app.response_class(
489 response=str.encode(msg),
490 status=200,
491 mimetype='application/json')
492 return response
TamasBakai9b780332019-02-15 08:38:16 +0000493
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000494# Function to build an empty message with status
495def buildEmptyResponse(status_code):
496 response = app.response_class(
497 response=str.encode(""),
498 status=status_code,
499 mimetype='application/json')
500 return response
TamasBakai9b780332019-02-15 08:38:16 +0000501
502
503if __name__ == "__main__":
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000504
505 #Counters
506 ctr_responses = 0
507 ctr_requests = 0
508 ctr_unique_files = 0
509
510 #Keeps all reponded file names
511 fileMap = {}
512
513 tc_num = "Not set"
514 tc_help = "Not set"
TamasBakai9b780332019-02-15 08:38:16 +0000515
516 parser = argparse.ArgumentParser()
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000517
518#SFTP TCs with single ME
TamasBakai9b780332019-02-15 08:38:16 +0000519 parser.add_argument(
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000520 '--tc100',
TamasBakai9b780332019-02-15 08:38:16 +0000521 action='store_true',
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000522 help='TC100 - One ME, SFTP, 1 1MB file, 1 event')
TamasBakai9b780332019-02-15 08:38:16 +0000523 parser.add_argument(
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000524 '--tc101',
TamasBakai9b780332019-02-15 08:38:16 +0000525 action='store_true',
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000526 help='TC101 - One ME, SFTP, 1 5MB file, 1 event')
TamasBakai9b780332019-02-15 08:38:16 +0000527 parser.add_argument(
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000528 '--tc102',
TamasBakai9b780332019-02-15 08:38:16 +0000529 action='store_true',
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000530 help='TC102 - One ME, SFTP, 1 50MB file, 1 event')
531
TamasBakai9b780332019-02-15 08:38:16 +0000532 parser.add_argument(
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000533 '--tc110',
TamasBakai9b780332019-02-15 08:38:16 +0000534 action='store_true',
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000535 help='TC110 - One ME, SFTP, 1MB files, 1 file per event, 100 events, 1 event per poll.')
536 parser.add_argument(
537 '--tc111',
538 action='store_true',
539 help='TC111 - One ME, SFTP, 1MB files, 100 files per event, 100 events, 1 event per poll.')
540 parser.add_argument(
541 '--tc112',
542 action='store_true',
543 help='TC112 - One ME, SFTP, 5MB files, 100 files per event, 100 events, 1 event per poll.')
544 parser.add_argument(
545 '--tc113',
546 action='store_true',
547 help='TC113 - One ME, SFTP, 1MB files, 100 files per event, 100 events. All events in one poll.')
548
549 parser.add_argument(
550 '--tc120',
551 action='store_true',
552 help='TC120 - One ME, SFTP, 1MB files, 100 files per event, 100 events, 1 event per poll. 10% of replies each: no response, empty message, slow response, 404-error, malformed json')
553 parser.add_argument(
554 '--tc121',
555 action='store_true',
556 help='TC121 - One ME, SFTP, 1MB files, 100 files per event, 100 events, 1 event per poll. 10% missing files')
557 parser.add_argument(
558 '--tc122',
559 action='store_true',
560 help='TC122 - One ME, SFTP, 1MB files, 100 files per event, 100 events. 1 event per poll. All files with identical name. ')
561
562 parser.add_argument(
563 '--tc1000',
564 action='store_true',
565 help='TC1000 - One ME, SFTP, 1MB files, 100 files per event, endless number of events, 1 event per poll')
566 parser.add_argument(
567 '--tc1001',
568 action='store_true',
569 help='TC1001 - One ME, SFTP, 5MB files, 100 files per event, endless number of events, 1 event per poll')
570
571# SFTP TCs with multiple MEs
572 parser.add_argument(
573 '--tc510',
574 action='store_true',
575 help='TC510 - 5 MEs, SFTP, 1MB files, 1 file per event, 100 events, 1 event per poll.')
576
577
578
579# FTPS TCs with single ME
580 parser.add_argument(
581 '--tc200',
582 action='store_true',
583 help='TC200 - One ME, FTPS, 1 1MB file, 1 event')
584 parser.add_argument(
585 '--tc201',
586 action='store_true',
587 help='TC201 - One ME, FTPS, 1 5MB file, 1 event')
588 parser.add_argument(
589 '--tc202',
590 action='store_true',
591 help='TC202 - One ME, FTPS, 1 50MB file, 1 event')
592
593 parser.add_argument(
594 '--tc210',
595 action='store_true',
596 help='TC210 - One ME, FTPS, 1MB files, 1 file per event, 100 events, 1 event per poll.')
597 parser.add_argument(
598 '--tc211',
599 action='store_true',
600 help='TC211 - One ME, FTPS, 1MB files, 100 files per event, 100 events, 1 event per poll.')
601 parser.add_argument(
602 '--tc212',
603 action='store_true',
604 help='TC212 - One ME, FTPS, 5MB files, 100 files per event, 100 events, 1 event per poll.')
605 parser.add_argument(
606 '--tc213',
607 action='store_true',
608 help='TC213 - One ME, FTPS, 1MB files, 100 files per event, 100 events. All events in one poll.')
609
610 parser.add_argument(
611 '--tc220',
612 action='store_true',
613 help='TC220 - One ME, FTPS, 1MB files, 100 files per event, 100 events, 1 event per poll. 10% of replies each: no response, empty message, slow response, 404-error, malformed json')
614 parser.add_argument(
615 '--tc221',
616 action='store_true',
617 help='TC221 - One ME, FTPS, 1MB files, 100 files per event, 100 events, 1 event per poll. 10% missing files')
618 parser.add_argument(
619 '--tc222',
620 action='store_true',
621 help='TC222 - One ME, FTPS, 1MB files, 100 files per event, 100 events. 1 event per poll. All files with identical name. ')
622
623 parser.add_argument(
624 '--tc2000',
625 action='store_true',
626 help='TC2000 - One ME, FTPS, 1MB files, 100 files per event, endless number of events, 1 event per poll')
627 parser.add_argument(
628 '--tc2001',
629 action='store_true',
630 help='TC2001 - One ME, FTPS, 5MB files, 100 files per event, endless number of events, 1 event per poll')
631
632 parser.add_argument(
633 '--tc610',
634 action='store_true',
635 help='TC510 - 5 MEs, FTPS, 1MB files, 1 file per event, 100 events, 1 event per poll.')
TamasBakai9b780332019-02-15 08:38:16 +0000636
637 args = parser.parse_args()
638
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000639
640
641 if args.tc100:
642 tc_num = "TC# 100"
643 elif args.tc101:
644 tc_num = "TC# 101"
645 elif args.tc102:
646 tc_num = "TC# 102"
647
648 elif args.tc110:
649 tc_num = "TC# 110"
650 elif args.tc111:
651 tc_num = "TC# 111"
652 elif args.tc112:
653 tc_num = "TC# 112"
654 elif args.tc113:
655 tc_num = "TC# 113"
656
657 elif args.tc120:
658 tc_num = "TC# 120"
659 elif args.tc121:
660 tc_num = "TC# 121"
661 elif args.tc122:
662 tc_num = "TC# 122"
663
664 elif args.tc1000:
665 tc_num = "TC# 1000"
666 elif args.tc1001:
667 tc_num = "TC# 1001"
668
669 elif args.tc510:
670 tc_num = "TC# 510"
671
672 elif args.tc200:
673 tc_num = "TC# 200"
674 elif args.tc201:
675 tc_num = "TC# 201"
676 elif args.tc202:
677 tc_num = "TC# 202"
678
679 elif args.tc210:
680 tc_num = "TC# 210"
681 elif args.tc211:
682 tc_num = "TC# 211"
683 elif args.tc212:
684 tc_num = "TC# 212"
685 elif args.tc213:
686 tc_num = "TC# 213"
687
688 elif args.tc220:
689 tc_num = "TC# 220"
690 elif args.tc221:
691 tc_num = "TC# 221"
692 elif args.tc222:
693 tc_num = "TC# 222"
694
695 elif args.tc2000:
696 tc_num = "TC# 2000"
697 elif args.tc2001:
698 tc_num = "TC# 2001"
699
700 elif args.tc610:
701 tc_num = "TC# 610"
TamasBakai9b780332019-02-15 08:38:16 +0000702
703 else:
704 print("No TC was defined")
705 print("use --help for usage info")
706 sys.exit()
BjornMagnussonXAf8b34f02019-03-22 09:48:38 +0000707
708 print(tc_num)
709
710 app.run(port=HOST_PORT, host=HOST_IP)