summaryrefslogtreecommitdiffstats
path: root/doc/book-enea-nfv-access-auto-fw-th-user-guide/doc/automation_framework_test_harness.xml
blob: d7771bcd974c2d8358f05c8f273e9b7ae9af3fca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
<?xml version="1.0" encoding="ISO-8859-1"?>
<chapter id="auto_fw_test_harness">
  <title>Automation Framework and Test Harness</title>

  <para>The Automation Framework and Test Harness installation directory is
  structured as follows:</para>

  <programlisting>.
|-- automation_framework
| |-- device
| | |-- addDevice.py
| | |-- getEventsForUcpe.py
| | |-- removeDevice.py
| | `-- waitDeviceUp.py
| |-- eneaUcpeMgr.py
| |-- network
| | |-- bindNetworkInterface.py
| | |-- delNetworkBridge.py
| | |-- getNetworkInterfaces.py
| | |-- newNetworkBridge.py
| | `-- unbindNetworkInterface.py
| |-- unittestSuite
| | |-- config
| | | |-- addDevice.json
| | | |-- bindNetworkInterface.json
| | | |-- controlVNFI.json
| | | |-- delNetworkBridge.json
| | | |-- destroyVNFI.json
| | | |-- instantiateVNFI.json
| | | |-- newNetworkBridge.json
| | | |-- offboardVNF.json
| | | |-- onboardVNF.json
| | | |-- onboardVNFRaw.json
| | | |-- removeDevice.json
| | | |-- unbindNetworkInterface.json
| | | `-- waitDeviceUp.json
| | |-- fortigateCleanup.json
| | |-- fortigateDeploy.json
| | |-- unittestLoader.py
| | `-- unittestSuite.py
| `-- vnf
| |-- controlVNFI.py
| |-- destroyVNFI.py
| |-- instantiateVNFI.py
| |-- offboardVNF.py
| |-- onboardVNF.py
| `-- onboardVNFRaw.py
|-- ansible.cfg
|-- hosts
|-- setup_env.sh
|-- lab_config
| |-- intelc3850-2
| | |-- intelc3850-2.json
| | |-- lan_br.json
| | |-- lan_nic.json
| | |-- wan_br.json
| | `-- wan_nic.json
| |-- inteld1521-1
| | |-- inteld1521-1.json
| | |-- lan_br.json
| | |-- lan_nic.json
| | |-- mgmt_nic.json
| | |-- sfc_br.json
| | |-- vnf_mgmt_br.json
| | |-- wan_br.json
| | `-- wan_nic.json
| `-- inteld1521-2
| |-- inteld1521-2.json
| |-- lan_br.json
| |-- lan_nic.json
| |-- mgmt_nic.json
| |-- sfc_br.json
| |-- vnf_mgmt_br.json
| |-- wan_br.json
| `-- wan_nic.json
|-- playbooks
| |-- addBridge.yml
| |-- addDevice.yml
| |-- bindNIC.yml
| |-- chainedVNFsService
| | |-- chainedVNFsService.yml
| | |-- cleanupChainedVNFsService.yml
| | `-- testChainedVNFsService.yml
| |-- controlVNFI.yml
| |-- deleteBridge.yml
| |-- destroyVNFI.yml
| |-- fortigateFWService
| | |-- cleanupFortigateFWInstance.yml
| | |-- cleanupTestFortigateFWInstance.yml
| | |-- instantiateFortigateFW.yml
| | `-- testFortigateFWInstance.yml
| |-- instantiateVNFI.yml
| |-- offboardVNF.yml
| |-- onboardVNFBundle.yml
| |-- onboardVNFImage.yml
| |-- removeDevice.yml
| |-- setupuCPEManager.yml
| |-- unbindNIC.yml
| `-- unittestSuiteTest
| |-- cleanupFortigateFWScenario.yml
| `-- deployFortigateFWScenario.yml
|-- uCPEM_config
| `-- ucpem01.json
|-- vnf_config
| |-- fortigateFWImage
| | |-- fortigateFWImage.json
| | |-- fortigateFWInstance1.json
| | `-- fortigateFWInstance2.json
| |-- fortigateImage
| | |-- fortigateFWInstance.json
| | `-- fortigateImage.json
| `-- junipervSRXImage
| |-- junipervSRXImage.json
| |-- junipervSRXInstanceAtomC1.json
| |-- junipervSRXInstanceAtomC2.json
| |-- junipervSRXInstanceXeonD1.json
| `-- junipervSRXInstanceXeonD2.json
`-- vnf_image</programlisting>

  <section id="auto_fw">
    <title>Automation Framework</title>

    <para>All Automation Framework sources are under the
    <literal>&lt;AF-TH-install-dir&gt;/automation_framework</literal>
    directory.</para>

    <para>The <literal>/device</literal> folder contains Python scripts for
    adding a uCPE device, receiving uCPE events' reports, removing a uCPE
    device, and waiting for a uCPE device to connect to the uCPE
    Manager.</para>

    <para>The <literal>/network</literal> folder contains Python scripts for
    binding or unbinding a network interface to/from a uCPE device (DPDK or
    SR-IOV), creating or deleting an OVS network bridge, or dumping network
    interface information about the available interfaces.</para>

    <para>The <literal>/unittestSuite</literal> folder contains Python
    unit-test class and loader scripts for generating specific test cases for
    the available Python scripts. The generated test cases are injected into
    the Python unit-test suite class to be run using the Python unit-test
    framework.</para>

    <para>The <literal>/unittestSuite/config</literal> folder contains
    configuration files in JSON format that describe the list of test cases
    for a particular Python script. Each defined test case is a dictionary
    that must contain the test case name and arguments to be passed to the
    Python script for running the test case.</para>

    <para>The <literal>/vnf</literal> folder contains Python scripts for
    onboarding and offboarding a VNF bundle or image, instantiating a VNF,
    controlling a VNF instance or destroying an existing one.</para>

    <para>The <filename>eneaUcpeMgr.py</filename> file acts as a library for
    the (Python) Automation Framework scripts. It contains common functions
    and unit-test configuration options.</para>

    <section id="python_testsuite">
      <title>Python Unit-Test Suite</title>

      <para>The Python unit-test class defined in the
      <filename>unittestSuite.py</filename> script provides a way to automate
      the execution of specific test cases for each supported Python script.
      This class requires a test suite configuration JSON file that contains a
      dictionary list of the Python scripts to be processed. Each dictionary
      must contain the path of the Python script to be loaded and the path to
      the file describing the test cases to be performed against the
      designated script.</para>

      <para>Steps for running the Python unit-test suite onto the uCPE Manager
      are provided below.</para>

      <section id="script_opts">
        <title>Script Options</title>

        <programlisting>$ python unittestSuite.py -h
Usage: unittestSuite.py [options]

Run selected unit-test suite against Enea uCPE Manager.

Options:
 --version show program's version number and exit
 -h, --help show this help message and exit
 -u USERNAME, --username=USERNAME
 Enea uCPE Manager login username
 -p PASSWORD, --password=PASSWORD
 Enea uCPE Manager login password
 -H HOST, --host=HOST Enea uCPE Manager host name or IP address
 -n DEVICENAME, --deviceName=DEVICENAME
 Name of vCPE device (Virtual Infrastructure Manager)
 -s SUITEFILE, --suite=SUITEFILE
 Test suite configuration file in JSON format
 -d DESCRIPTION, --description=DESCRIPTION
 Test suite description

 Mandatory options:
 -H/--host, -n/--deviceName, -s/--suiteFile, -d/--description</programlisting>
      </section>

      <section id="config_ut_json">
        <title>Configuring Unit-Test JSON File<remark>Starting from this
        section onward NOTHING has been proofed</remark></title>

        <para>The unit-test suite JSON configuration file contains a list of
        dictionaries, each dictionary indicating the path of the Python module
        to load and the test cases configuration file to be executed against
        the loaded module.</para>

        <para>Sample unit-test configuration file describing the Fortigate
        deployment scenario, fortigateDeploy.json:</para>

        <para><programlisting>[
 {
 "config": "config/addDevice.json",
 "module": "../device/addDevice.py"
 },
 {
 "config": "config/waitDeviceUp.json",
 "module": "../device/waitDeviceUp.py"
 },
 {
 "config": "config/bindNetworkInterface.json",
 "module": "../network/bindNetworkInterface.py"
 },
 {
 "config": "config/newNetworkBridge.json",
 "module": "../network/newNetworkBridge.py"
 },
 {
 "config": "config/onboardVNFRaw.json",
 "module": "../vnf/onboardVNFRaw.py"
 },
 {
 "config": "config/instantiateVNFI.json",
 "module": "../vnf/instantiateVNFI.py"
 },
 {
 "config": "config/controlVNFI.json",
 "module": "../vnf/controlVNFI.py"
 }
]</programlisting>Sample unit-test configuration file describing the Fortigate
        cleanup scenario, fortigateCleanup.json:</para>

        <programlisting>[
 {
 "config": "config/destroyVNFI.json",
 "module": "../vnf/destroyVNFI.py"
 },
 {
 "config": "config/delNetworkBridge.json",
 "module": "../network/delNetworkBridge.py"
 },
 {
 "config": "config/unbindNetworkInterface.json",
 "module": "../network/unbindNetworkInterface.py"
 },
 {
 "config": "config/offboardVNF.json",
 "module": "../vnf/offboardVNF.py"
 },
 {
 "config": "config/removeDevice.json",
 "module": "../device/removeDevice.py"
 }
]</programlisting>

        <para>"config" key contains the path to the test cases configuration
        file.</para>

        <para>"module" key contains the path to the Python script to be
        executed.</para>
      </section>

      <section id="ut_config_opts">
        <title>Unit-Test Configuration Options</title>

        <para>The unit-test behavior can be tweaked in a number of ways
        through the following options set through the eneaUcpeMgr.py
        file:<programlisting># Defaults for the framework
username = "admin"
password = "admin"
host = None
deviceName = None
directory = "."
ftpUsername = "ftp"
ftpPassword = "ftp"
ftpPort = "2021"

# Stop the test run on the first error or failure
failfast = True

# Logging levels ordered by the highest severity:
# CRITICAL 50
# ERROR 40
# WARNING 30
# INFO 20
# DEBUG 10
# NOTSET 0
fileLoggingLevel = logging.DEBUG
consoleLoggingLevel = logging.INFO</programlisting>username - user to be used
        when authenticating to uCPE Manager; this can be overwritten by
        setting the Python unit-test suite command line option -u.</para>

        <para>password - password to be used when authenticating to uCPE
        Manager; this can be overwritten by setting the Python unit-test suite
        command line option -p.</para>

        <para>host - IP address of the uCPE Manager host; this can be
        overwritten by setting the Python unit-test suite command line option
        -H.</para>

        <para>devicename - name of the VCPE agent to perform the tests
        against; this can be overwritten by setting the Python unit-test suite
        command line option -n.</para>

        <para>ftpUsername - user to be used for the FTP connection when
        onboarding a VNF bundle/image; this can be overwritten by setting the
        Python script command line option -f.</para>

        <para>ftpPassword - password to be used for the FTP connection when
        onboarding a VNF bundle/image; this can be overwritten by setting the
        Python script command line option -w.</para>

        <para>ftpPort - port to be used for the FTP connection when onboarding
        a VNF bundle/image; this can be overwritten by setting the Python
        script command line option -P.</para>

        <para>failfast - describes the unit-test execution behavior on the
        first error or failure encountered.</para>

        <para>fileLoggingLevel - sets the file logging level.</para>

        <para>consoleLoggingLevel - sets the console logging level.</para>
      </section>

      <section id="ut_suite_log">
        <title>Python Unit-Test Suite Logging</title>

        <para>Logging messages are displayed in the console and also saved to
        the specified log file depending on the chosen logging level.</para>

        <para>Logging messages are ranked by their severity
        level:<programlisting>CRITICAL 50
ERROR 40
WARNING 30
INFO 20
DEBUG 10
NOTSET 0</programlisting>Logging messages which are less severe than the
        logging level set will be ignored.</para>

        <para>Setting console logging level to INFO is done through the
        consoleLoggingLevel option:<programlisting>consoleLoggingLevel = logging.INFO</programlisting>Setting
        file logging level to DEBUG is done through the fileLoggingLevel
        option:<programlisting>fileLoggingLevel = logging.DEBUG</programlisting></para>
      </section>

      <section id="run_ut_suite">
        <title>Running Python Unit-Test Suite</title>

        <para>Sample unit-test command line options for running the Fortigate
        deployment scenario:</para>

        <para><programlisting>$ python unittestSuite.py -u admin -p admin -H localhost -n intelc3850-2 -s
fortigateDeploy.json -d "Fortigate deployment scenario"</programlisting>Setting
        console logging level to DEBUG:<programlisting>consoleLoggingLevel = logging.DEBUG</programlisting><emphasis
        role="bold">Expected Output:</emphasis><programlisting>2019-03-07 18:03:20,791 - DEBUG: Started logging

Running Fortigate deployment scenario...

test 001: Add VCPE Agent device (__main__.UnittestSuite) ...
2019-03-07 18:03:20,795 - INFO: Add uCPE device
2019-03-07 18:03:20,924 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:20,925 - DEBUG: Session token is: 876160c3-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:20,949 - DEBUG: Add new device 'intelc3850-2' to uCPE Manager host
2019-03-07 18:03:21,100 - INFO: Done
2019-03-07 18:03:21,133 - DEBUG: Logging out and exiting...
ok
test 002: Wait VCPE Agent device be up (__main__.UnittestSuite) ...
2019-03-07 18:03:21,133 - INFO: Wait uCPE device
2019-03-07 18:03:21,149 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:21,149 - DEBUG: Session token is: 8785b1a0-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:21,157 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:21,157 - DEBUG: Wait for device 'intelc3850-2' to connect
2019-03-07 18:03:29,356 - DEBUG: Status: Connected
2019-03-07 18:03:29,356 - INFO: Done
2019-03-07 18:03:29,365 - DEBUG: Logging out and exiting...
ok
test 003: Bind lan NIC to DPDK (__main__.UnittestSuite) ...
2019-03-07 18:03:29,366 - INFO: Bind NIC
2019-03-07 18:03:29,406 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:29,406 - DEBUG: Session token is: 8c719cb0-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:29,415 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:29,415 - DEBUG: Bind NIC '0000:01:00.1'
2019-03-07 18:03:30,030 - INFO: Done
2019-03-07 18:03:30,067 - DEBUG: Logging out and exiting...
ok
test 004: Bind wan NIC to DPDK (__main__.UnittestSuite) ...
2019-03-07 18:03:30,068 - INFO: Bind NIC
2019-03-07 18:03:30,086 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:30,087 - DEBUG: Session token is: 8cd95f32-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:30,095 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:30,096 - DEBUG: Bind NIC '0000:03:00.2'
2019-03-07 18:03:30,729 - INFO: Done
2019-03-07 18:03:30,767 - DEBUG: Logging out and exiting...
ok
test 005: Creating network bridge LAN (__main__.UnittestSuite) ...
2019-03-07 18:03:30,768 - INFO: New OVS network bridge
2019-03-07 18:03:30,801 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:30,801 - DEBUG: Session token is: 8d454061-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:30,811 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:30,812 - DEBUG: Create new OVS network bridge 'lan_br'
2019-03-07 18:03:37,358 - INFO: Done
2019-03-07 18:03:37,402 - DEBUG: Logging out and exiting...
ok
test 006: Creating network bridge WAN (__main__.UnittestSuite) ...
2019-03-07 18:03:37,402 - INFO: New OVS network bridge
2019-03-07 18:03:37,461 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:37,461 - DEBUG: Session token is: 913c4420-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:37,485 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:37,485 - DEBUG: Create new OVS network bridge 'wan_br'
2019-03-07 18:03:37,755 - INFO: Done
2019-03-07 18:03:37,792 - DEBUG: Logging out and exiting...
ok
test 007: Onboarding Fortigate VNF (wizard API) (__main__.UnittestSuite) ...
2019-03-07 18:03:37,792 - INFO: Onboard wizard
2019-03-07 18:03:37,859 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:37,859 - DEBUG: Session token is: 91770330-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:37,860 - DEBUG: FTP file '../../vnf_bundles/fortios.qcow2' on host
'localhost', port '2021'
2019-03-07 18:03:38,027 - DEBUG: Onboard VNF raw: fortios.qcow2
2019-03-07 18:03:41,701 - INFO: Done
2019-03-07 18:03:41,748 - DEBUG: Logging out and exiting...
ok
test 008: Instantiate Fortigate VNF (__main__.UnittestSuite) ...
2019-03-07 18:03:41,778 - INFO: Instantiate VNF
2019-03-07 18:03:41,813 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:41,815 - DEBUG: Session token is: 93d69e10-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:41,834 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:41,878 - DEBUG: Found VNF descriptor with name 'fortigateImage'
2019-03-07 18:03:41,888 - DEBUG: Encrypt string content:
cloudInit("vnf_config/fortigateImage/fortigateFW.conf")
2019-03-07 18:03:41,889 - DEBUG: Encrypt string content:
License("vnf_config/fortigateImage/fortigateLicense.lic")
2019-03-07 18:03:41,889 - DEBUG: Instantiate fortigateImage VNF on 'intelc3850-2'
2019-03-07 18:03:49,887 - INFO: Done
2019-03-07 18:03:49,921 - DEBUG: Logging out and exiting...
ok
test 009: Pause Fortigate VNF instance (__main__.UnittestSuite) ...
2019-03-07 18:03:49,923 - INFO: Control VNF
2019-03-07 18:03:49,982 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:49,983 - DEBUG: Session token is: 98b17220-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:49,991 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:50,031 - DEBUG: Found VNF instance with name 'fortigateFWInstance'
2019-03-07 18:03:50,031 - DEBUG: Control VNF instance 'intelc3850-2', command:
pause
2019-03-07 18:03:50,914 - INFO: Done
2019-03-07 18:03:50,933 - DEBUG: Logging out and exiting...
ok
test 010: Resume Fortigate VNF instance (__main__.UnittestSuite) ...
2019-03-07 18:03:50,933 - INFO: Control VNF
2019-03-07 18:03:50,992 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:50,992 - DEBUG: Session token is: 994c0473-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:51,005 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:51,023 - DEBUG: Found VNF instance with name 'fortigateFWInstance'
2019-03-07 18:03:51,024 - DEBUG: Control VNF instance 'intelc3850-2', command:
resume
2019-03-07 18:03:51,963 - INFO: Done
2019-03-07 18:03:51,991 - DEBUG: Logging out and exiting...
ok
test 011: Stop Fortigate VNF instance (__main__.UnittestSuite) ...
2019-03-07 18:03:51,992 - INFO: Control VNF
2019-03-07 18:03:52,031 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:52,031 - DEBUG: Session token is: 99ed9ba3-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:52,046 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:52,073 - DEBUG: Found VNF instance with name 'fortigateFWInstance'
2019-03-07 18:03:52,073 - DEBUG: Control VNF instance 'intelc3850-2', command: stop
2019-03-07 18:03:53,011 - INFO: Done
2019-03-07 18:03:53,047 - DEBUG: Logging out and exiting...
ok
test 012: Start Fortigate VNF instance (__main__.UnittestSuite) ...
2019-03-07 18:03:53,048 - INFO: Control VNF
2019-03-07 18:03:53,080 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:53,080 - DEBUG: Session token is: 9a8d8523-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:53,109 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:53,140 - DEBUG: Found VNF instance with name 'fortigateFWInstance'
2019-03-07 18:03:53,141 - DEBUG: Control VNF instance 'intelc3850-2', command:
start
2019-03-07 18:03:54,087 - INFO: Done
2019-03-07 18:03:54,123 - DEBUG: Logging out and exiting...
ok

----------------------------------------------------------------------
Ran 12 tests in 33.328s

OK</programlisting></para>

        <para>Sample unit-test command line options for running the Fortigate
        cleanup scenario:<programlisting>$ python unittestSuite.py -u admin -p admin -H localhost -n intelc3850-2 -s
fortigateCleanup.json -d "Fortigate cleanup scenario"</programlisting></para>

        <para>Setting console logging level to INFO: <programlisting>consoleLoggingLevel = logging.INFO</programlisting></para>

        <para><emphasis role="bold">Expected
        Output:</emphasis><programlisting>Running Fortigate cleanup scenario...
test 001: Destroying Fortigate VNF (__main__.UnittestSuite) ...
2019-03-07 18:04:55,997 - INFO: Destroy VNF
2019-03-07 18:04:56,668 - INFO: Done
ok
test 002: Deleting network bridge LAN (__main__.UnittestSuite) ...
2019-03-07 18:04:56,739 - INFO: Delete OVS network bridge
2019-03-07 18:04:57,908 - INFO: Done
ok
test 003: Deleting network bridge WAN (__main__.UnittestSuite) ...
2019-03-07 18:04:57,931 - INFO: Delete OVS network bridge
2019-03-07 18:04:59,464 - INFO: Done
ok
test 004: Unbind lan NIC from DPDK uCPE device (__main__.UnittestSuite) ...
2019-03-07 18:04:59,477 - INFO: Unbind NIC
2019-03-07 18:05:00,639 - INFO: Done
ok
test 005: Unbind wan NIC from DPDK uCPE device (__main__.UnittestSuite) ...
2019-03-07 18:05:00,658 - INFO: Unbind NIC
2019-03-07 18:05:01,533 - INFO: Done
ok
test 006: Offboarding Fortigate VNF (__main__.UnittestSuite) ...
2019-03-07 18:05:01,566 - INFO: Offboard VNF
2019-03-07 18:05:01,814 - INFO: Done
ok
test 007: Remove VCPE Agent device (__main__.UnittestSuite) ...
2019-03-07 18:05:01,853 - INFO: Remove uCPE device
2019-03-07 18:05:02,184 - INFO: Done
ok

----------------------------------------------------------------------
Ran 7 tests in 6.198s

OK</programlisting></para>
      </section>
    </section>

    <section id="add_ucpe_device">
      <title>Adding a uCPE Device</title>

      <para>Adds a uCPE device to the uCPE manager.</para>

      <section id="opts_add_device">
        <title>Script Options</title>

        <programlisting>$ python addDevice.py -h
Usage: addDevice.py [options]

Add a uCPE in Enea uCPE Manager.

Options:
 --version show program's version number and exit
 -h, --help show this help message and exit
 -u USERNAME, --username=USERNAME
 Enea uCPE Manager login username
 -p PASSWORD, --password=PASSWORD
 Enea uCPE Manager login password
 -H HOST, --host=HOST Enea uCPE Manager host name or IP address
 -f DEVICEFILE, --file=DEVICEFILE
 File containing uCPE Information in JSON format

 Mandatory options:
 -H/--host, -f/--file</programlisting>
      </section>

      <section id="config_json_adddev">
        <title>Configuring the JSON File</title>

        <para>The add device suite JSON configuration file should contain a
        list of dictionaries, each dictionary indicating the test case name
        and the test case arguments passed to the addDevice Python
        module.</para>

        <para><emphasis role="bold">Sample configuration file in JSON
        format:</emphasis></para>

        <programlisting>[
 {
 "name": "Add VCPE Agent device ",
 "args": "-f ../../lab_config/intelc3850-2/intelc3850-2.json"
 }
]</programlisting>

        <para><emphasis role="bold">Sample intelc3850-2.json configuration
        file:</emphasis></para>

        <programlisting>{
 "name": " intelc3850-2",
 "description": "",
 "address": "192.168.1.100",
 "port": "22",
 "username": "root",
 "password": "root",
 "certificate": null,
 "passphrase": null,
 "maintMode": "false"
}</programlisting>
      </section>

      <section id="run_py_mod">
        <title>Running the Python Module</title>

        <para>The addDevice Python module can be executed individually by
        running the following command line:</para>

        <programlisting>$ python addDevice.py -u admin -p admin -H localhost -f config/device.json
2019-03-07 17:33:10,755 - DEBUG: Started logging
2019-03-07 17:33:10,756 - INFO: Add uCPE device
2019-03-07 17:33:10,975 - DEBUG: Login successful on host 'localhost'
2019-03-07 17:33:10,979 - DEBUG: Session token is: 508b6ea2-40ee-11e9-a81f525400d08e1d
2019-03-07 17:33:11,049 - DEBUG: Add new device 'intelc3850-2' to uCPE Manager host
2019-03-07 17:33:11,483 - INFO: Done
2019-03-07 17:33:11,501 - DEBUG: Logging out and exiting....</programlisting>
      </section>
    </section>

    <section id="remove_ucpe_device">
      <title>Removing a uCPE Device</title>

      <para>Removes a uCPE device from uCPE manager.</para>

      <section id="rem_script_opts">
        <title>Script Options</title>

        <programlisting>$ python removeDevice.py -h
Usage: removeDevice.py [options]

Remove a uCPE from Enea uCPE Manager.

Options:
 --version show program's version number and exit
 -h, --help show this help message and exit
 -u USERNAME, --username=USERNAME
 Enea uCPE Manager login username
 -p PASSWORD, --password=PASSWORD
 Enea uCPE Manager login password
 -H HOST, --host=HOST Enea uCPE Manager host name or IP address
 -f DEVICEFILE, --file=DEVICEFILE
 File containing uCPE Information in JSON format

 Mandatory options:
 -H/--host, -f/--file</programlisting>
      </section>

      <section id="config_json_rem">
        <title>Configuring the JSON File</title>

        <para>The remove device suite JSON configuration file should contain a
        list of dictionaries, each dictionary indicating the test case name
        and the test case arguments passed to the removeDevice Python
        module.</para>

        <para><emphasis role="bold">Sample unit-test JSON file
        format:</emphasis></para>

        <programlisting>[
 {
 "name": "Remove VCPE Agent device ",
 "args": "-f ../../lab_config/intelc3850-2/intelc3850-2.json"
 }
]</programlisting>

        <para><emphasis role="bold">Sample intelc3850-2.json configuration
        file:</emphasis></para>

        <programlisting>{
 "name": "intelc3850-2"
}</programlisting>
      </section>

      <section id="Run_py_mod_rem">
        <title>Running the Python Module</title>

        <para>The removeDevice Python module can be executed individually by
        running the following command line:</para>

        <programlisting>$ python removeDevice.py -u admin -p admin -H localhost -f
../../lab_config/intelc3850-2/intelc3850-2.json
2019-03-07 17:33:56,834 - DEBUG: Started logging
2019-03-07 17:33:56,835 - INFO: Remove uCPE device
2019-03-07 17:33:56,856 - DEBUG: Login successful on host 'localhost'
2019-03-07 17:33:56,856 - DEBUG: Session token is: 6bebcb43-40ee-11e9-a81f525400d08e1d
2019-03-07 17:33:56,856 - DEBUG: Delete device 'intelc3850-2' from uCPE Manager
host
2019-03-07 17:33:56,875 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 17:33:57,159 - INFO: Done
2019-03-07 17:33:57,171 - DEBUG: Logging out and exiting...</programlisting>
      </section>
    </section>

    <section id="wait_ucpe_device">
      <title>Waiting a uCPE Device</title>

      <para>Wait for uCPE to connect to the Enea uCPE Manager after
      installation.</para>

      <section id="wait_script_opts">
        <title>Script Options</title>

        <programlisting>$ python waitDeviceUp.py -h
Usage: waitDeviceUp.py [options]

Wait for uCPE to connect to the Enea uCPE Manager after installation.

Options:
 --version show program's version number and exit
 -h, --help show this help message and exit
 -u USERNAME, --username=USERNAME
 Enea uCPE Manager login username
 -p PASSWORD, --password=PASSWORD
 Enea uCPE Manager login password
 -H HOST, --host=HOST Enea uCPE Manager host name or IP address
 -f DEVICEFILE, --file=DEVICEFILE
 File containing uCPE Information in JSON format
 -t TIMEOUT, --timeout=TIMEOUT
 Time in seconds for maximum wait period, default =
 instant

 Mandatory options:
 -H/--host, -f/--file</programlisting>
      </section>

      <section id="config_json_wait">
        <title>Configuring the JSON File</title>

        <para>The wait device suite JSON configuration file should contain a
        list of dictionaries, each dictionary indicating the test case name
        and the test case arguments passed to the waitDeviceUp Python
        module.</para>

        <para><emphasis role="bold">Sample unit-test JSON file
        format:</emphasis></para>

        <programlisting>[
 {
 "name": "Wait VCPE Agent device be up",
 "args": "-f ../../lab_config/intelc3850-2/intelc3850-2.json -t 60"
 }
]</programlisting>

        <para><emphasis role="bold">Sample intelc3850-2.json configuration
        file:</emphasis></para>

        <programlisting>{
 "name": "intelc3850-2"
}</programlisting>
      </section>

      <section id="runpy_mod_wait">
        <title>Running the Python Module</title>

        <para>The waitDeviceUp Python module can be executed individually by
        running the following command line:<programlisting>$ python waitDeviceUp.py -u admin -p admin -H localhost -t 60 -f
../../lab_config/intelc3850-2/intelc3850-2.json
2019-03-07 18:03:21,132 - DEBUG: Started logging
2019-03-07 18:03:21,133 - INFO: Wait uCPE device
2019-03-07 18:03:21,149 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:21,149 - DEBUG: Session token is: 8785b1a0-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:21,157 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:21,157 - DEBUG: Wait for device 'intelc3850-2' to connect
2019-03-07 18:03:29,356 - DEBUG: Status: Connected
2019-03-07 18:03:29,356 - INFO: Done
2019-03-07 18:03:29,365 - DEBUG: Logging out and exiting...</programlisting></para>
      </section>
    </section>

        <section id="print_ucpe_log">
          <title>Printing the uCPE Device log</title>

          <para>Print the events log for a specific uCPE device installed in Enea uCPE Manager.</para>

          <section id="print_script_opts">
            <title>Script Options</title>

            <programlisting>
$ python getEventsForUcpe.py -h
Usage: getEventsForUcpe.py [options]

Print the events log for a specific uCPE installed in Enea uCPE Manager.

Options:
--version                          show program's version number and exit
-h, --help                         show this help message and exit
-u USERNAME, --username=USERNAME   Enea uCPE Manager login username
-p PASSWORD, --password=PASSWORD   Enea uCPE Manager login password
-H HOST, --host=HOST               Enea uCPE Manager host name or IP address
-f DEVICEFILE, --file=DEVICEFILE   File containing uCPE Information in JSON format
-s SEVERITY, --severity=SEVERITY   Event severity level (Critical|Major|Minor)

Mandatory options:
-H/--host, -f/--file
            </programlisting>
            </section>
          
            <section id="config_json_log">
              <title>Configuring the JSON File</title>
              
              <para><emphasis role="bold">Sample <filename>intelc3850-2.json</filename> 
                configuration file:</emphasis></para>
              
              <programlisting>{
"name": "intelc3850-2",
"description": "",
"address": "172.24.12.114",
"port": "22",
"username": "root",
"password": "root",
"certificate": null,
"passphrase": null,
"maintMode": "false"
              }</programlisting>
            </section>
          
            <section id="runpy_mod_log">
              <title>Running the Python Module</title>
              
              <para>The <literal>getEventsForUcpe</literal> Python module can be executed 
                individually by running the following command:</para>
                <programlisting>
$ python getEventsForUcpe.py -H localhost -f \
../../lab_config/intelc3850-2/intelc3850-2.json

2019-07-04 13:48:31,289 - DEBUG: Started logging
2019-07-04 13:48:31,290 - INFO: Dump uCPE events
2019-07-04 13:48:31,336 - DEBUG: Login successful on host '172.24.3.108'
2019-07-04 13:48:31,336 - DEBUG: Session token is: a53c68d3-9e51-11e9-a715-5254007632e2
2019-07-04 13:48:31,356 - DEBUG: Found device with name 'intelc3850-2'
2019-07-04 13:48:31,357 - DEBUG:
Events on device: intelc3850-2 and severity: 1000
2019-07-04 13:48:31,450 - DEBUG:  Dumping 1 events
2019-07-04 13:48:31,450 - DEBUG: Device Disconnected | Alarm | Device | None | \
    2019-07-04 09:57:40.042
2019-07-04 13:48:31,469 - DEBUG:  Dumping 0 events
2019-07-04 13:48:31,469 - INFO: Done
2019-07-04 13:48:31,488 - DEBUG: Logging out and exiting...
              </programlisting>
            </section>

        </section>

    <section id="bind_ucpe_device">
      <title>Binding a network interface</title>

      <para>Binds a physical network interface to a DPDK or SR-IOV.
      </para>

      <section id="script_opts_bind">
        <title>Script Options</title>

        <programlisting>$ python bindNetworkInterface.py -h
Usage: bindNetworkInterface.py [options]

Binds a physical network interface to a DPDK or SR-IOV.

Options:
 --version show program's version number and exit
 -h, --help show this help message and exit
 -u USERNAME, --username=USERNAME
 Enea uCPE Manager login username
 -p PASSWORD, --password=PASSWORD
 Enea uCPE Manager login password
 -H HOST, --host=HOST Enea uCPE Manager host name or IP address
 -f NICFILE, --file=NICFILE
File containing network interface Information in JSON
format
 -n DEVICENAME, --device-name=DEVICENAME
 Name of the device

 Mandatory options:
 -H/--host, -f/--file, -n/--device-name</programlisting>
      </section>

      <section id="bind_config">
        <title>Configuring the JSON File</title>

        <para>The bind network interface suite JSON configuration file should
        contain a list of dictionaries, each dictionary indicating the test
        case name and the test case arguments passed to the
        bindNetworkInterface Python module.</para>

        <para><emphasis role="bold">Sample unit-test JSON file
        format:</emphasis><programlisting>[
 {
 "name": "Bind lan NIC to DPDK",
 "args": "-f ../../lab_config/intelc3850-2/lan_nic.json"
 },
 {
 "name": "Bind wan NIC to DPDK ",
 "args": "-f ../../lab_config/intelc3850-2/wan_nic.json"
 }
]</programlisting><emphasis role="bold">Sample lan_nic.json configuration
        file:</emphasis><programlisting>{
 "name": "0000:01:00.1",
 "type": "dpdk",
 "subType": "igb_uio"
}</programlisting><emphasis role="bold">Sample wan_nic.json configuration
        file:</emphasis><programlisting>{
 "name": "0000:03:00.2",
 "type": "dpdk",
 "subType": "igb_uio"
}</programlisting></para>
      </section>

      <section id="runpy_bind">
        <title>Running the Python Module</title>

        <para>The <literal>bindNetworkInterface</literal> Python module can be executed
        individually by running the following command line:</para>

        <programlisting>$ python bindNetworkInterface.py -u admin -p admin -H localhost -f
../../lab_config/intelc3850-2/lan_nic.json -n intelc3850-2
2019-03-07 18:03:29,365 - DEBUG: Started logging
2019-03-07 18:03:29,366 - INFO: Bind NIC
2019-03-07 18:03:29,406 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:29,406 - DEBUG: Session token is: 8c719cb0-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:29,415 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:29,415 - DEBUG: Bind NIC '0000:01:00.1'
2019-03-07 18:03:30,030 - INFO: Done
2019-03-07 18:03:30,067 - DEBUG: Logging out and exiting...</programlisting>
      </section>
    </section>

    <section id="unbind_ucpe_device">
      <title>Unbinding a Network Interface</title>

      <para>Unbinds a physical network interface from DPDK or SR-IOV.</para>

      <section id="script_opts_unbind">
        <title>Script Options</title>

        <programlisting>$ python unbindNetworkInterface.py -h
Usage: unbindNetworkInterface.py [options]

Unbinds a physical interface to the DPDK or SR-IOV.

Options:
 --version show program's version number and exit
 -h, --help show this help message and exit
 -u USERNAME, --username=USERNAME
 Enea uCPE Manager login username
 -p PASSWORD, --password=PASSWORD
 Enea uCPE Manager login password
 -H HOST, --host=HOST Enea uCPE Manager host name or IP address
 -f NICFILE, --file=NICFILE
 File containing network interface Information in JSON
 format
 -n DEVICENAME, --device-name=DEVICENAME
 Name of the device

 Mandatory options:
 -H/--host, -f/--file, -n/--device-name</programlisting>
      </section>

      <section id="json_unbind">
        <title>Configuring the JSON File</title>

        <para>The unbind network interface suite JSON configuration file
        should contain a list of dictionaries, each dictionary indicating the
        test case name and the test case arguments passed to the
        unbindNetworkInterface Python module.</para>

        <para><emphasis role="bold">Sample unit-test JSON file
        format:</emphasis><programlisting>[
 {
 "name": "Unbind lan NIC",
 "args": "-f ../../lab_config/intelc3850-2/lan_nic.json"
 },
 {
  name": "Unbind wan NIe",
Unbinds a physical interface to the DPDK or SR-IOV
 "args": "-f ../../lab_config/intelc3850-2/wan_nic.json"
 }
]</programlisting></para>

        <para><emphasis role="bold">Sample lan_nic.json configuration
        file:</emphasis></para>

        <programlisting>{
 "name": "0000:01:00.1",
 "type": "dpdk"
}</programlisting>

        <para><emphasis role="bold">Sample wan_nic.json configuration
        file:</emphasis></para>

        <programlisting>{
 "name": "0000:03:00.2",
 "type": "dpdk",
}
</programlisting>
      </section>

      <section id="pymod_unbind">
        <title>Running the Python Module</title>

        <para>The unbindNetworkInterface Python module can be executed
        individually by running the following command line:</para>

        <programlisting>$ python unbindNetworkInterface.py -u admin -p admin -H localhost -f
../../lab_config/intelc3850-2/lan_nic.json -n intelc3850-2
2019-03-07 17:33:54,377 - DEBUG: Started logging
2019-03-07 17:33:54,378 - INFO: Unbind NIC
2019-03-07 17:33:54,431 - DEBUG: Login successful on host 'localhost'
2019-03-07 17:33:54,432 - DEBUG: Session token is: 6a77a1d1-40ee-11e9-a81f525400d08e1d
2019-03-07 17:33:54,467 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 17:33:54,468 - DEBUG: Unbind NIC '0000:01:00.1'
2019-03-07 17:33:55,616 - INFO: Done
2019-03-07 17:33:55,659 - DEBUG: Logging out and exiting...</programlisting>
      </section>
    </section>

    <section id="get_network_interface">
      <title>Getting a Network Interface</title>
      
      <para>List the network interfaces for a device.</para>

    <section id="script_opts_interface">
      <title>Script Options</title>
      <programlisting>
$ python getNetworkInterfaces.py -h
2019-07-04 16:35:50,496 - DEBUG: Started logging
2019-07-04 16:35:50,496 - INFO: Dump NICs
Usage: getNetworkInterfaces.py [options]

Options:
  --version                               show program's version number and exit
  -h, --help                              show this help message and exit
  -u USERNAME, --username=USERNAME        Enea uCPE Manager login username
  -p PASSWORD, --password=PASSWORD        Enea uCPE Manager login password
  -H HOST, --host=HOST                    Enea uCPE Manager host name or IP address
  -n DEVICENAME, --device-name=DEVICENAME Name of the uCPE to get network interfaces from

  Mandatory options:
    -H/--host, -n/--device-name
      </programlisting>
  </section>

    <section id="runpy_net_interface">
      <title>Running the Python Module</title>
      <para>The <literal>getNetworkInterfaces</literal> Python module can be executed individually 
        by running the following command:</para>
      <programlisting>
$ python getNetworkInterfaces.py -H localhost -n intelc3850-2
2019-07-04 16:03:47,580 - DEBUG: Started logging
2019-07-04 16:03:47,580 - INFO: Dump NICs
2019-07-04 16:03:47,609 - DEBUG: Login successful on host 'localhost'
2019-07-04 16:03:47,610 - DEBUG: Session token is: 8ae9b103-9e64-11e9-a715-5254007632e2
2019-07-04 16:03:47,626 - DEBUG: Found device with name 'intelc3850-2'
2019-07-04 16:03:47,627 - DEBUG:
----------------- External Network Interfaces for intelc3850-2-----------------
2019-07-04 16:03:47,945 - DEBUG: 0000:01:00.0 DpdkTypes: [u'igb_uio', u'vfio-pci'] \
        MacAddress: ac:1f:6b:2d:ee:58sriov(63)
2019-07-04 16:03:47,945 - DEBUG:
2019-07-04 16:03:47,969 - DEBUG:
----------------- Configured External Network Interfaces for intelc3850-2-------------
2019-07-04 16:03:47,969 - DEBUG: 0000:01:00.1 DpdkType: igb_uio ID: \
        41d31385-fafd-48fe-b702-ce72fea85478
2019-07-04 16:03:47,969 - DEBUG: 0000:03:00.2 DpdkType: igb_uio ID: \
        b0a4b919-95cd-48c2-83ad-28ec233546b2
2019-07-04 16:03:47,969 - DEBUG: 0000:03:00.3 DpdkType: igb_uio ID: \
        380ac405-9e51-11e9-a715-5254007632e2
2019-07-04 16:03:47,970 - DEBUG: 0000:03:00.1 DpdkTypes: [u'igb_uio', u'vfio-pci'] \
        MacAddress: 0c:c4:7a:fb:85:ddsriov(7)
2019-07-04 16:03:47,970 - DEBUG:
2019-07-04 16:03:47,991 - DEBUG:
----------------- Configured External Network Interfaces for intelc3850-2-------------
2019-07-04 16:03:47,991 - DEBUG: 0000:01:00.1 DpdkType: igb_uio ID: \
        41d31385-fafd-48fe-b702-ce72fea85478
2019-07-04 16:03:47,992 - DEBUG: 0000:03:00.2 DpdkType: igb_uio ID: \
        b0a4b919-95cd-48c2-83ad-28ec233546b2
2019-07-04 16:03:47,992 - DEBUG: 0000:03:00.3 DpdkType: igb_uio ID: \
        380ac405-9e51-11e9-a715-5254007632e2
2019-07-04 16:03:47,992 - DEBUG: 0000:03:00.0 DpdkTypes: [u'igb_uio', u'vfio-pci'] \
        MacAddress: 0c:c4:7a:fb:85:dcsriov(7)
2019-07-04 16:03:47,992 - DEBUG:
2019-07-04 16:03:48,012 - DEBUG:
----------------- Configured External Network Interfaces for intelc3850-2-------------
2019-07-04 16:03:48,012 - DEBUG: 0000:01:00.1 DpdkType: igb_uio ID: \
        41d31385-fafd-48fe-b702-ce72fea85478
2019-07-04 16:03:48,012 - DEBUG: 0000:03:00.2 DpdkType: igb_uio ID: \
        b0a4b919-95cd-48c2-83ad-28ec233546b2
2019-07-04 16:03:48,012 - DEBUG: 0000:03:00.3 DpdkType: igb_uio ID: \
        380ac405-9e51-11e9-a715-5254007632e2
2019-07-04 16:03:48,013 - DEBUG:
2019-07-04 16:03:48,013 - INFO: Done
2019-07-04 16:03:48,029 - DEBUG: Logging out and exiting...</programlisting>

    </section>

</section>

    <section id="create_ovs_net_bridge">
      <title>Create an OVS Network Bridge</title>

      <para>Create an OVS Bridge on a device.</para>

      <section id="script_opts_creovs">
        <title>Script Options</title>

        <programlisting>$ python newNetworkBridge.py -h
Usage: newNetworkBridge.py [options]

Create an OVS Bridge on a device.

Options:
 --version show program's version number and exit
 -h, --help show this help message and exit
 -u USERNAME, --username=USERNAME
 Enea uCPE Manager login username
 -p PASSWORD, --password=PASSWORD
 Enea uCPE Manager login password
 -H HOST, --host=HOST Enea uCPE Manager host name or IP address
 -f OVSFILE, --file=OVSFILE
 File containing OVS bridge Information in JSON format
 -n DEVICENAME, --device-name=DEVICENAME
 Name of the device

 Mandatory options:
 -H/--host, -f/--file, -n/--device-name</programlisting>
      </section>

      <section id="json_creovs">
        <title>Configuring the JSON File</title>

        <para>The new network bridge suite JSON configuration file should
        contain a list of dictionaries, each dictionary indicating the test
        case name and the test case arguments passed to the newNetworkBridge
        Python module.</para>

        <para><emphasis role="bold">Sample unit-test JSON file
        format:</emphasis></para>

        <programlisting>[
 {
 "name": "Creating network bridge LAN ",
 "args": "-f ../../lab_config/intelc3850-2/lan_br.json"
 },
 {
 "name": "Creating network bridge WAN ",
 "args": "-f ../../lab_config/intelc3850-2/wan_br.json"
 }
]</programlisting>

        <para><emphasis role="bold">Sample lan_br.json configuration
        file:</emphasis></para>

        <programlisting>{
 "name": "lan_br",
 "interfaces": ["0000:01:00.1"]
}</programlisting>

        <para><emphasis role="bold">Sample wan_br.json configuration
        file:</emphasis></para>

        <programlisting>{
 "name": "wan_br",
 "interfaces": ["0000:03:00.2"]
}</programlisting>
      </section>

      <section id="pymod_creovs">
        <title>Running the Python Module</title>

        <para>The newNetworkBridge Python module can be executed individually
        by running the following command line:</para>

        <programlisting>$ python newNetworkBridge.py -u admin -p admin -H localhost -f
../../lab_config/intelc3850-2/lan_br.json -n intelc3850-2
2019-03-07 18:03:30,767 - DEBUG: Started logging
2019-03-07 18:03:30,768 - INFO: New OVS network bridge
2019-03-07 18:03:30,801 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:30,801 - DEBUG: Session token is: 8d454061-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:30,811 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:30,812 - DEBUG: Create new OVS network bridge 'lan_br'
2019-03-07 18:03:37,358 - INFO: Done
2019-03-07 18:03:37,402 - DEBUG: Logging out and exiting...</programlisting>
      </section>
    </section>

    <section id="delete_ovs_net_bridge">
      <title>Delete an OVS Network Bridge</title>

      <para>Delete an OVS Bridge from a device.</para>

      <section id="script_opts_delovs">
        <title>Script Options</title>

        <programlisting>$ python delNetworkBridge.py -h
Usage: delNetworkBridge.py [options]

Delete an OVS Bridge from a device.

Options:
 --version show program's version number and exit
 -h, --help show this help message and exit
 -u USERNAME, --username=USERNAME
 Enea uCPE Manager login username
 -p PASSWORD, --password=PASSWORD
 Enea uCPE Manager login password
 -H HOST, --host=HOST Enea uCPE Manager host name or IP address
 -f OVSFILE, --file=OVSFILE
 File containing OVS bridge Information in JSON format
 -n DEVICENAME, --device-name=DEVICENAME
 Name of the device

 Mandatory options:
 -H/--host, -f/--file, -n/--device-name</programlisting>
      </section>

      <section id="json_delovs">
        <title>Configuring the JSON File</title>

        <para>The delete network bridge suite JSON configuration file should
        contain a list of dictionaries, each dictionary indicating the test
        case name and the test case arguments passed to the delNetworkBridge
        Python module.</para>

        <para><emphasis role="bold">Sample unit-test JSON file
        format:</emphasis></para>

        <programlisting>[
 {
 "name": "Deleting network bridge LAN ",
 "args": "-f ../../lab_config/intelc3850-2/lan_br.json"
 },
 {
 "name": "Deleting network bridge WAN ",
 "args": "-f ../../lab_config/intelc3850-2/wan_br.json"
 }
]</programlisting>

        <para><emphasis role="bold">Sample lan_br.json configuration
        file:</emphasis></para>

        <programlisting>{
 "name" : "lan_br"
}</programlisting>

        <para><emphasis role="bold">Sample wan_br.json configuration
        file:</emphasis></para>

        <programlisting>{
 "name" : "wan_br"
}</programlisting>
      </section>

      <section id="pymod_delovs">
        <title>Running the Python Module</title>

        <para>The delNetworkBridge Python module can be executed individually
        by running the following command line:</para>

        <programlisting>$ python delNetworkBridge.py -u admin -p admin -H localhost -f
../../lab_config/intelc3850-2/lan_br.json -n intelc3850-2
2019-03-07 17:33:51,712 - DEBUG: Started logging
2019-03-07 17:33:51,713 - INFO: Delete OVS network bridge
2019-03-07 17:33:51,751 - DEBUG: Login successful on host 'localhost'
2019-03-07 17:33:51,752 - DEBUG: Session token is: 68e08711-40ee-11e9-a81f525400d08e1d
2019-03-07 17:33:51,768 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 17:33:51,768 - DEBUG: Delete OVS network bridge 'lan_br'
2019-03-07 17:33:52,839 - INFO: Done
2019-03-07 17:33:52,872 - DEBUG: Logging out and exiting...</programlisting>
      </section>
    </section>

    <section id="onboard_vnf_bundle">
      <title>Onboard a VNF Bundle</title>

      <para>Onboard a VNF to Enea uCPE Manager.</para>

      <section id="script_opts_onbvnf">
        <title>Script Options</title>

        <programlisting>$ python onboardVNF.py -h
Usage: onboardVNF.py [options]

Onboard a VNF to Enea uCPE Manager.

Options:
 --version show program's version number and exit
 -h, --help show this help message and exit
 -u USERNAME, --username=USERNAME
 Enea uCPE Manager login username
 -p PASSWORD, --password=PASSWORD
 Enea uCPE Manager login password
 -H HOST, --host=HOST Enea uCPE Manager host name or IP address
 -f FTPUSERNAME, --ftpUsername=FTPUSERNAME
 Username for FTP
 -w FTPPASSWORD, --ftpPassword=FTPPASSWORD
 FTP password
 -P FTPPORT, --ftpPort=FTPPORT
 FTP port
 -b VNFBUNDLE, --bundle=VNFBUNDLE
 File name of VNF bundle in ZIP format

 Mandatory options:
 -H/--host, -b/--bundle</programlisting>
      </section>

      <section id="json_onbvnf">
        <title>Configuring the JSON File</title>

        <para>The onboard VNF suite JSON configuration file should contain a
        list of dictionaries, each dictionary indicating the test case name
        and the test case arguments passed to the onboardVNF Python
        module.</para>

        <para><emphasis role="bold">Sample unit-test JSON file
        format:</emphasis><programlisting>[
 {
 "name": "Onboarding Fortigate VNF ",
 "args": "-b ../../vnf_images/Fortigate.zip"
 }
]</programlisting></para>
      </section>

      <section id="pymod_onbvnf">
        <title>Running the Python Module</title>

        <para>The onboardVNF Python module can be executed individually by
        running the following command line:</para>

        <programlisting>$ python onboardVNF.py -u admin -p admin -f ftp -w ftp -H localhost -b
../../vnf_images/Fortigate.zip
2019-02-25 16:00:53,890 - DEBUG: Started logging
2019-02-25 16:00:53,890 - INFO: Onboard VNF
2019-02-25 16:00:53,985 - DEBUG: Login successful on host 'localhost'
2019-02-25 16:00:53,985 - DEBUG: Session token is: c421cd03-3905-11e9-a81f525400d08e1d
2019-02-25 16:00:53,994 - DEBUG: FTP file '../../vnf_images/Fortigate.zip' on host
'localhost', port '2021'
2019-02-25 16:00:54,229 - DEBUG: Onboard VNF: Fortigate
2019-02-25 16:00:56,836 - INFO: Done
2019-02-25 16:00:56,861 - DEBUG: Logging out and exiting...</programlisting>
      </section>
    </section>

    <section id="onboard_vnf_image">
      <title>Onboard a VNF Image</title>

      <para>Onboard a VNF image in Enea uCPE Manager based upon its raw
      constituents.</para>

      <section id="script_opts_image">
        <title>Script Options</title>

        <programlisting>$ python onboardVNFRaw.py -h
Usage: onboardVNFRaw.py [options]

Onboard a VNF in Enea uCPE Manager based upon its raw constituents.

Options:
 --version show program's version number and exit
 -h, --help show this help message and exit
 -u USERNAME, --username=USERNAME
 Enea uCPE Manager login username
 -p PASSWORD, --password=PASSWORD
 Enea uCPE Manager login password
 -H HOST, --host=HOST Enea uCPE Manager host name or IP address
 -f FTPUSERNAME, --ftpUsername=FTPUSERNAME
 Username for FTP
 -w FTPPASSWORD, --ftpPassword=FTPPASSWORD
 FTP password
 -P FTPPORT, --ftpPort=FTPPORT
 FTP port
 -i IMAGEPATH, --imagePath=IMAGEPATH
 VNF image path
 -b IMAGEINFO, --imageInfo=IMAGEINFO
 File name of VNF image information in JSON format

 Mandatory options:
 -H/--host, -b/--imageInfo, -i/--imagePath</programlisting>
      </section>

      <section id="json_image">
        <title>Configuring the JSON File</title>

        <para>The onboard VNF image suite JSON configuration file should
        contain a list of dictionaries, each dictionary indicating the test
        case name and the test case arguments passed to the onboardVNFRaw
        Python module.</para>

        <para><emphasis role="bold">Sample unit-test JSON file
        format:</emphasis></para>

        <programlisting>[
 {
 "name": "Onboarding Fortigate VNF (wizard API)",
 "args": "-b ../../vnf_config/fortigateImage/fortigateImage.json -i
../../vnf_images/fortios.qcow2"
 }
]</programlisting>

        <para><emphasis role="bold">Sample fortigateImage.json configuration
        file:</emphasis><programlisting>{
 "name" : "fortigateImage",
 "version" : "1.0",
 "description" : "Fortigate VNF Image",
 "provider" : "Fortinet, Inc",
 "numVcpus" : 1,
 "imageFormat" : "QCOW2",
 "memoryInMb" : 1024,
 "storageInGb" : 20,
 "image" : "fortios.qcow2",
 "interfaces" : [
 {
 "name" : "external",
 "type" : "PhysicalPort",
 "description" : "External interface"
 },
 {
 "name" : "in",
 "type" : "PhysicalPort",
 "description" : "Incoming interface"
 },
 {
 "name" : "out",
 "type" : "PhysicalPort",
 "description" : "Outgoing interface"
 }
 ],
 "cloudInitDataSource" : "ConfigDrive",
 "cloudInitDriveType" : "cdrom",
 "cloudInitContentParams" : [
 {
 "path" : "License",
 "description" : "Operational license"
 }
 ]
}</programlisting></para>
      </section>

      <section id="pymod_image">
        <title>Running the Python Module</title>

        <para>The onboardVNFRaw Python module can be executed individually by
        running the following command line:</para>

        <programlisting>$ python onboardVNFRaw.py -u admin -p admin -f ftp -w ftp -H localhost -b b
../../vnf_config/fortigateImage/fortigateImage.json -i
../../vnf_images/fortios.qcow2
2019-03-07 18:03:37,791 - DEBUG: Started logging
2019-03-07 18:03:37,792 - INFO: Onboard wizard
2019-03-07 18:03:37,859 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:37,859 - DEBUG: Session token is: 91770330-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:37,860 - DEBUG: FTP file '../../vnf_images/fortios.qcow2' on host
'localhost', port '2021'
2019-03-07 18:03:38,027 - DEBUG: Onboard VNF raw: fortios.qcow2
2019-03-07 18:03:41,701 - INFO: Done
2019-03-07 18:03:41,748 - DEBUG: Logging out and exiting...</programlisting>
      </section>
    </section>

    <section id="offboard_vnf">
      <title>Offboard a VNF</title>

      <para>Offboard a VNF from Enea uCPE Manager.</para>

      <section id="script_opts_offimage">
        <title>Script Options</title>

        <programlisting>$ python offboardVNF.py -h
Usage: offboardVNF.py [options]

Offboard a VNF from Enea uCPE Manager.

Options:
 --version show program's version number and exit
 -h, --help show this help message and exit
 -u USERNAME, --username=USERNAME
 Enea uCPE Manager login username
 -p PASSWORD, --password=PASSWORD
 Enea uCPE Manager login password
 -H HOST, --host=HOST Enea uCPE Manager host name or IP address
 -n VNFDNAME, --vnfdName=VNFDNAME
 Name of VNF descriptor to offboard

 Mandatory options:
 -H/--host, -n/--vnfdName</programlisting>
      </section>

      <section id="json_offimage">
        <title>Configuring the JSON File</title>

        <para>The offboard VNF suite JSON configuration file should contain a
        list of dictionaries, each dictionary indicating the test case name
        and the test case arguments passed to the offboardVNF Python
        module.</para>

        <para><emphasis role="bold">Sample unit-test JSON file
        format:</emphasis></para>

        <programlisting>[
 {
 "name": "Offboarding Fortigate VNF ",
 "args": "-n fortigateImage"
 }
]</programlisting>
      </section>

      <section id="pymod_offimage">
        <title>Running the Python Module</title>

        <para>The offboardVNF Python module can be executed individually by
        running the following command line:</para>

        <programlisting>$ python offboardVNF.py -u admin -p admin -H localhost -n fortigateImage
2019-03-07 17:33:56,523 - DEBUG: Started logging
2019-03-07 17:33:56,524 - INFO: Offboard VNF
2019-03-07 17:33:56,557 - DEBUG: Login successful on host 'localhost'
2019-03-07 17:33:56,557 - DEBUG: Session token is: 6bbe2b90-40ee-11e9-a81f525400d08e1d
2019-03-07 17:33:56,682 - DEBUG: Found VNF descriptor with name 'fortigateImage'
2019-03-07 17:33:56,683 - DEBUG: Offboard VNF: fortigateImage
2019-03-07 17:33:56,811 - INFO: Done
2019-03-07 17:33:56,834 - DEBUG: Logging out and exiting...</programlisting>
      </section>
    </section>

    <section id="instantiate_vnf">
      <title>Instantiate a VNF</title>

      <para>Instantiate a VNF via Enea uCPE Manager.</para>

      <section id="script_opts_inst">
        <title>Script Options</title>

        <programlisting>$ python instantiateVNFI.py -h
Usage: instantiateVNFI.py [options]

Instantiate a VNF via Enea uCPE Manager.

Options:
 --version show program's version number and exit
 -h, --help show this help message and exit
 -u USERNAME, --username=USERNAME
 Enea uCPE Manager login username
 -p PASSWORD, --password=PASSWORD
 Enea uCPE Manager login password
 -H HOST, --host=HOST Enea uCPE Manager host name or IP address
 -t VNFTYPE, --vnfType=VNFTYPE
 VNF Type (Name of VNF descriptor)
 -n VIMDEVICENAME, --device-name=VIMDEVICENAME
 Name of the device
 -f PROPSFILE, --file=PROPSFILE
 File containing VNF instance properties in JSON format

 Mandatory options:
 -H/--host, -t/--vnfType, -n/--device-name, -f/--file</programlisting>
      </section>

      <section id="json_inst">
        <title>Configuring the JSON File</title>

        <para>The instantiate VNF suite JSON configuration file should contain
        a list of dictionaries, each dictionary indicating the test case name
        and the test case arguments passed to the instantiateVNFI Python
        module.</para>

        <para><emphasis role="bold">Sample unit-test JSON file
        format:</emphasis></para>

        <programlisting>[
 {
 "name": "Instantiate Fortigate VNF ",
 "args": "-t fortigateImage -f
../../vnf_config/fortigateImage/fortigateFWInstance.json"
 }
]</programlisting>

        <para>The VNF instance JSON configuration file is specific to each
        VNF.</para>
      </section>

      <section id="pymod_inst">
        <title>Running the Python Module</title>

        <para>The instantiateVNFI Python module can be executed individually
        by running the following command line:</para>

        <programlisting>$ python instantiateVNFI.py -u admin -p admin -H localhost -n intelc3850-2 -t
fortigateImage -f ../../vnf_config/fortigateImage/fortigateFWInstance.json
2019-03-07 18:03:41,777 - DEBUG: Started logging
2019-03-07 18:03:41,778 - INFO: Instantiate VNF
2019-03-07 18:03:41,813 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:41,815 - DEBUG: Session token is: 93d69e10-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:41,834 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:41,878 - DEBUG: Found VNF descriptor with name 'fortigateImage'
2019-03-07 18:03:41,888 - DEBUG: Encrypt string content:
cloudInit("vnf_config/fortigateImage/fortigateFW.conf")
2019-03-07 18:03:41,889 - DEBUG: Encrypt string content:
License("vnf_config/fortigateImage/fortigateLicense.lic")
2019-03-07 18:03:41,889 - DEBUG: Instantiate fortigateImage VNF on 'intelc3850-2'
2019-03-07 18:03:49,887 - INFO: Done
2019-03-07 18:03:49,921 - DEBUG: Logging out and exiting...</programlisting>
      </section>
    </section>

    <section id="control_vnf_inst">
      <title>Control a VNF Instance</title>

      <para>Controls a VNF instance from Enea uCPE Manager.</para>

      <section id="script_opts_control">
        <title>Script Options</title>

        <programlisting>$ python controlVNFI.py -h
Usage: controlVNFI.py [options]

Controls a VNF instance from Enea uCPE Manager.

Options:
 --version show program's version number and exit
 -h, --help show this help message and exit
 -u USERNAME, --username=USERNAME
 Enea uCPE Manager login username
 -p PASSWORD, --password=PASSWORD
 Enea uCPE Manager login password
 -H HOST, --host=HOST Enea uCPE Manager host name or IP address
 -i VNFINSTANCENAME, --vnfInstanceName=VNFINSTANCENAME
 Name of VNF instance
 -n VIMDEVICENAME, --device-name=VIMDEVICENAME
 Name of the device
 -c COMMAND, --command=COMMAND
 Control command (stop, start, pause or resume)

 Mandatory options:
 -H/--host, -i/--vnfInstanceName, -n/--device-name, -c/--command</programlisting>
      </section>

      <section id="json_control">
        <title>Configuring the JSON File</title>

        <para>The control VNF instance suite JSON configuration file should
        contain a list of dictionaries, each dictionary indicating the test
        case name and the test case arguments passed to the controlVNFI Python
        module.</para>

        <para><emphasis role="bold">Sample unit-test JSON file
        format:</emphasis></para>

        <programlisting>[
 {
 "name": "Pause Fortigate VNF instance",
 "args": "-i fortigateFWInstance -c pause"
 },
 {
 "name": "Resume Fortigate VNF instance",
 "args": "-i fortigateFWInstance -c resume"
 },
 {
 "name": "Stop Fortigate VNF instance ",
 "args": "-i fortigateFWInstance -c stop"
 },
 {
 "name": "Start Fortigate VNF instance",
 "args": "-i fortigateFWInstance -c start"
 }
]</programlisting>
      </section>

      <section id="pymod_control">
        <title>Running the Python Module</title>

        <para>The controlVNFI Python module can be executed individually by
        running the following command line:</para>

        <programlisting>$ python controlVNFI.py -u admin -p admin -H localhost -n intelc3850-2 -i
fortigateFWInstance -c stop
2019-03-07 18:03:51,991 - DEBUG: Started logging
2019-03-07 18:03:51,992 - INFO: Control VNF
2019-03-07 18:03:52,031 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:52,031 - DEBUG: Session token is: 99ed9ba3-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:52,046 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:52,073 - DEBUG: Found VNF instance with name 'fortigateFWInstance'
2019-03-07 18:03:52,073 - DEBUG: Control VNF instance 'intelc3850-2', command: stop
2019-03-07 18:03:53,011 - INFO: Done
2019-03-07 18:03:53,047 - DEBUG: Logging out and exiting...</programlisting>
      </section>
    </section>

    <section id="destroy_vnf_inst">
      <title>Destroy a VNF Instance</title>

      <para>Destroys a VNF instance from Enea uCPE Manager.</para>

      <section id="script_opts_destroy">
        <title>Script Options</title>

        <programlisting>$ python destroyVNFI.py -h
Usage: destroyVNFI.py [options]

Destroys a VNF instance from Enea uCPE Manager.

Options:
 --version show program's version number and exit
 -h, --help show this help message and exit
 -u USERNAME, --username=USERNAME
 Enea uCPE Manager login username
 -p PASSWORD, --password=PASSWORD
 Enea uCPE Manager login password
 -H HOST, --host=HOST Enea uCPE Manager host name or IP address
 -i VNFINSTANCENAME, --vnfInstanceName=VNFINSTANCENAME
 Name of VNF instance
 -n VIMDEVICENAME, --device-name=VIMDEVICENAME
 Name of the device

 Mandatory options:
 -H/--host, -i/--vnfInstanceName, -n/--device-name</programlisting>
      </section>

      <section id="json_destroy">
        <title>Configuring the JSON File</title>

        <para>The destroy VNF instance suite JSON configuration file should
        contain a list of dictionaries, each dictionary indicating the test
        case name and the test case arguments passed to the destroyVNFI Python
        module.</para>

        <para><emphasis role="bold">Sample unit-test JSON file
        format:</emphasis><programlisting>[
 {
 "name": "Destroying Fortigate VNF ",
 "args": "-i fortigateFWInstance"
 }
]</programlisting></para>
      </section>

      <section id="pymod_destory">
        <title>Running the Python Module</title>

        <para>The destroyVNFI Python module can be executed individually by
        running the following command line:</para>

        <programlisting>$ python destroyVNFI.py -u admin -p admin -H localhost -n intelc3850-2 -i
fortigateFWInstance
2019-03-07 17:33:51,025 - DEBUG: Started logging
2019-03-07 17:33:51,026 - INFO: Destroy VNF
2019-03-07 17:33:51,119 - DEBUG: Login successful on host 'localhost'
2019-03-07 17:33:51,119 - DEBUG: Session token is: 68803ea5-40ee-11e9-a81f525400d08e1d
2019-03-07 17:33:51,128 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 17:33:51,148 - DEBUG: Found VNF instance with name 'fortigateFWInstance'
2019-03-07 17:33:51,149 - DEBUG: Destroy VNF: fortigateFWInstance
2019-03-07 17:33:51,655 - INFO: Done
2019-03-07 17:33:51,712 - DEBUG: Logging out and exiting...</programlisting>
      </section>
    </section>
  </section>

  <section id="test_harness">
    <title>Test Harness</title>

    <para>All Test Harness sources are under &lt;AF-TH-install-dir&gt;
    directory, except under the automation_framework sub-directory. See
    chapter 4 for a complete tree listing.</para>

    <para>The Ansible based Test Harness represents an example of how to
    structure all the files needed for creating automated test cases using the
    AF and provides a way to implement them. The ansible.cfg file contains an
    example of the Ansible default configuration. It offers the possibility to
    display the Ansible console output in different ways, by setting the
    stdout_callback to selective or debug. Default is set to selective to
    print only certain tasks. It is recommended to switch on debug when a test
    fails. By setting any_errors_fatal to True, task failures will be
    considered fatal errors (the play execution will stop). The hosts file is
    the Ansible inventory file.</para>

    <para>All the Playbooks that are executing AF python modules are run on
    localhost. New entries have to be created for direct communication over
    SSH with the boards, like [fortigateFW] example. The setup_env.sh script
    sets up the "testHarness" test environment by creating testHarness-venv
    python virtualenv, installing requests needed by Automation Framework
    python modules and installing Ansible. The playbooks directory contains
    all the implemented Ansible Playbooks. For details please refer to chapter
    "Sample Test Cases" from the Enea NFV Access System Test Specification
    document.</para>

    <para>The uCPEM_config directory stores JSON configuration files needed
    for the setup of the uCPE Manager used by TH. One configuration file is
    needed per uCPE Manager installation to be used in the TH. The vnf_image
    directory stores the VNF Images needed by the Ansible Playbooks (i.e. the
    sample test cases).</para>

    <para>The lab_config directory stores the JSON configuration files related
    to a device (devices, NICs and bridges). Each subfolder should be named
    exactly like the device name and should contain all the related
    configuration files needed for the test cases to be run on it.</para>

    <para>The vnf_config directory stores the configuration files related to a
    VNF Descriptor. Typically these include a VNF Image JSON, VNF Instance
    JSON, VNF license and any other files required by the type of the VNF.
    Each subfolder should be named exactly like the name of the VNF Descriptor
    and should contain all the related configuration files needed for test
    cases to be run using this VNF.</para>

    <para>The log directory is created when the setup_env.sh is run. When test
    cases are ran, the Ansible and the Python logs are stored in ansible.log
    and debug.log files, respectively.</para>

    <section id="test_suites">
      <title>Extending functionality - Test Suites</title>

      <para>To extend the functionality of the Test Harness it is typically
      needed that the functionlity of the Automation Framework be also
      extended to cover additional uCPE Manager REST Northbound APIs. The
      extension of the Automation Framework will result in new Python modules
      that have to be created.</para>

      <para>Additional Python modules, that are not related to the
      functionality of the Automation Framework, could be easily integrated
      into Test Harness to aid in the creation of more complex test cases.
      Using the TH one can implement test cases that are run directly on the
      boards with Enea NFV Access, over SSH.</para>

      <para>For a better understanding of the Test Harness functionality and
      how to extend the test suites, please refer to the chapter "Sample Test
      Cases" from the Enea NFV Access System Test Specification document and
      the TH code source.</para>
    </section>
  </section>
</chapter>