summaryrefslogtreecommitdiffstats
path: root/doc/book-enea-nfv-access-system-test-specification/doc/sample_test_cases.xml
blob: 30322ac10f269b4e3c81197f192f0a942bf50041 (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
<?xml version="1.0" encoding="ISO-8859-1"?>
<chapter id="sample_testcases">
  <title>Sample Test Cases</title>

  <para>The test cases specified in this chapter are implemented as a Sample
  Test Suite included in the TH.</para>

  <section id="vnf_dev_net_smoke">
    <title>VNF, Device and Network Smoke Test Cases</title>

    <para>The following is an automated test suite that acts as basic smoke
    tests for Enea NFV Access, and as a sanity-check test suite for the AF and
    TH.</para>

    <section id="onb_vnf_image">
      <title>VNF - Onboard_VNF_Image<remark>all titles are formated with
      underscores can this be changed or should it be left as
      is?</remark></title>

      <para><emphasis role="bold">Description: </emphasis>Onboarding a VNF
      Image into the uCPE Manager. For details please refer to:</para>

      <itemizedlist>
        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/onboardVNFImage.yml</filename></para>
        </listitem>

        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/automation_framework/vnf/onboardVNFRaw.py</filename></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Preconditions:</emphasis></para>

      <itemizedlist>
        <listitem>
          <para>Add the VNF Image in the <literal>vnf_image</literal> folder
          in the QCOW2 format: <programlisting>&lt;AF-TH-install-dir&gt;/vnf_image/&lt;VNF-Image-name&gt;.qcow2</programlisting></para>
        </listitem>

        <listitem>
          <para>A VNF Image JSON configuration file is created:
          <programlisting>&lt;AF-TH-install-dir&gt;/vnf_config/&lt;VNF-Descriptor-name&gt;/&lt;VNF-Descriptor-name&gt;.json</programlisting><emphasis
          role="bold">Example:</emphasis><programlisting>&lt;AF-TH-install-dir&gt;/vnf_config/fortigateImage/fortigateImage.json</programlisting></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Action:</emphasis> Run the
      <filename>onboardVNFImage.yml</filename> Ansible Playbook with the
      <literal>&lt;VNF-Image-name&gt;</literal> and the
      <literal>&lt;VNF-Descriptor-name&gt;</literal> as extra-vars:
      <programlisting>ansible-playbook playbooks/onboardVNFImage.yml -e "vnfb=&lt;VNF-Image-name&gt; \
vnfd=&lt;VNF-Descriptor-name&gt;"</programlisting></para>

      <para><emphasis role="bold">Result:</emphasis> Output of the test case
      run using the Test Harness:<programlisting># Onboard VNF Image task result
&lt;VNF-Descriptor-name&gt; successfully onboarded!</programlisting><emphasis
      role="bold">Note:</emphasis> The test will not fail if the VNF Image is
      already onboarded. The output will instead contain: <programlisting># debug &lt;VNF-Descriptor-name&gt; already onboarded!</programlisting></para>
    </section>

    <section id="onb_vnf_bundle">
      <title>VNF - Onboard_VNF_Bundle<remark>since we're removing mention of
      bundles is this section still relevant?</remark></title>

      <para><emphasis role="bold">Description:</emphasis> Onboarding a VNF
      Bundle into the uCPE Manager. For details please refer to:</para>

      <itemizedlist>
        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/onboardVNFBundle.yml</filename></para>
        </listitem>

        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/automation_framework/vnf/onboardVNF.py</filename></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Precondition:</emphasis> Add the VNF Bundle
      in the <literal>vnf_image</literal> folder in the zip format:
      <programlisting><filename>&lt;AF-TH-install-dir&gt;/vnf_image/&lt;VNF-Bundle-name&gt;.zip</filename></programlisting></para>

      <para><emphasis role="bold">Action:</emphasis> Run the
      <filename>onboardVNFBundle.yml</filename> Ansible Playbook with the
      <literal>&lt;VNF-Bundle-name&gt;</literal> as extra-vars:
      <programlisting>ansible-playbook playbooks/onboardVNFBundle.yml -e "vnfb=&lt;VNF-Bundle-name&gt;"</programlisting></para>

      <para><emphasis role="bold">Result:</emphasis> Output of the test case
      run using the Test Harness: <programlisting># Onboard VNF Bundle task result
&lt;VNF-Bundle-name&gt; successfully onboarded!</programlisting><emphasis
      role="bold">Note:</emphasis> The test will not fail if the VNF Bundle is
      already onboarded. The output will instead contain: <programlisting># debug &lt;VNF-Bundle-name&gt; already onboarded!</programlisting></para>
    </section>

    <section id="offb_vnf">
      <title>VNF - Offboard_VNF</title>

      <para><emphasis role="bold">Description:</emphasis> Removing a VNF
      Descriptor from the uCPE Manager. For details please refer to:</para>

      <itemizedlist>
        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/offboardVNF.yml</filename></para>
        </listitem>

        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/automation_framework/vnf/offboardVNF.py</filename></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Precondition:</emphasis> The VNF has been
      previously onboarded in the uCPE Manager instance.</para>

      <para><emphasis role="bold">Action:</emphasis> Run the
      <filename>offboardVNF.yml</filename> Ansible Playbook with the
      <literal>&lt;VNF-Descriptor-name&gt;</literal> as extra-vars:
      <programlisting>ansible-playbook playbooks/offboardVNF.yml -e "vnfd=&lt;VNF-Descriptor-name&gt;"</programlisting></para>

      <para><emphasis role="bold">Result:</emphasis> Output of the test case
      run using the Test Harness: <programlisting># Remove Descriptor task result
&lt;VNF-Descriptor-name&gt; was removed!</programlisting><emphasis
      role="bold">Note:</emphasis> The test will not fail if the VNF
      Descriptor does not exist. The output will instead contain:
      <programlisting># debug No Descriptor with name &lt;VNF-Descriptor-name&gt;!</programlisting></para>
    </section>

    <section id="add_device">
      <title>Device - Add_Device</title>

      <para><emphasis role="bold">Description:</emphasis> Adding a uCPE device
      to the uCPE Manager. For details please refer to:</para>

      <itemizedlist>
        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/addDevice.yml</filename></para>
        </listitem>

        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/automation_framework/device/addDevice.py</filename></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Precondition:</emphasis> A device JSON
      configuration file must be created: <programlisting><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/&lt;Device-name&gt;.json</filename></programlisting></para>

      <para><emphasis role="bold">Example:</emphasis> <programlisting>&lt;AF-TH-install-dir&gt;/lab_config/intelc3850-2/intelc3850-2.json</programlisting></para>

      <para><emphasis role="bold">Action:</emphasis> Run the
      <filename>addDevice.yml</filename> Ansible playbook with the
      <filename>&lt;Device-name&gt;</filename> as extra-vars: <programlisting>ansible-playbook playbooks/addDevice.yml -e "device=&lt;Device-name&gt;"</programlisting></para>

      <para><emphasis role="bold">Result:</emphasis> Output of the test case
      run using the Test Harness: <programlisting># Add Device task result
&lt;Device-name&gt; device was added!</programlisting><emphasis
      role="bold">Note:</emphasis> The test will not fail if the device
      already exists. The output will instead contain: <programlisting># debug
&lt;Device-name&gt; device already exists!</programlisting></para>
    </section>

    <section id="remv_dev">
      <title>Device - Remove_Device</title>

      <para><emphasis role="bold">Description:</emphasis> Removing a uCPE
      device from the uCPE Manager. For details please refer to:</para>

      <itemizedlist>
        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/removeDevice.yml</filename></para>
        </listitem>

        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/automation_framework/device/removeDevice.py</filename></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Preconditions:</emphasis></para>

      <itemizedlist>
        <listitem>
          <para>The device has to be previously added to the uCPE Manager
          instance.</para>
        </listitem>

        <listitem>
          <para>The device JSON configuration file must exist:
          <programlisting>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/&lt;Device-name&gt;.json</programlisting></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Action:</emphasis> Run the
      <filename>removeDevice.yml</filename> Ansible Playbook with the
      <literal>&lt;Device-name&gt;</literal> as extra-vars: <programlisting>ansible-playbook playbooks/removeDevice.yml -e "device=&lt;Device-name&gt;"</programlisting></para>

      <para><emphasis role="bold">Result:</emphasis> Output of the test case
      run using the Test Harness:<programlisting># Remove Device task result
&lt;Device-name&gt; device was removed!</programlisting> <emphasis
      role="bold">Note:</emphasis> The test will not fail if the device does
      not exist. The output will contain: <programlisting># debug
&lt;Device-name&gt; device was not found!</programlisting></para>
    </section>

    <section id="bind_nic">
      <title>Network - Bind_NIC</title>

      <para><emphasis role="bold">Description:</emphasis> Binding a physical
      network interface (NIC) to a device. For details please refer to:</para>

      <itemizedlist>
        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/bindNIC.yml</filename></para>
        </listitem>

        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/automation_framework/network/bindNetworkInterface.py</filename></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Preconditions:</emphasis></para>

      <itemizedlist>
        <listitem>
          <para>A device must have been previously added to the uCPE Manager
          instance.</para>
        </listitem>

        <listitem>
          <para>A NIC JSON configuration file must exist: <programlisting>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/&lt;NIC&gt;.json</programlisting></para>

          <para><emphasis role="bold">Example:</emphasis> <programlisting>&lt;AF-TH-install-dir&gt;/lab_config/intelc3850-2/wan_nic.json
&lt;AF-TH-install-dir&gt;/lab_config/intelc3850-2/lan_nic.json</programlisting></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Action:</emphasis> Run the
      <filename>bindNIC.yml</filename> Ansible Playbook with the
      <literal>&lt;Device-name&gt;</literal> and
      <literal>&lt;NIC&gt;</literal> as extra-vars: <programlisting>ansible-playbook playbooks/bindNIC.yml -e "device=&lt;Device-name&gt; nic=&lt;NIC&gt;"</programlisting></para>

      <para><emphasis role="bold">Result:</emphasis> Output of the test case
      run using the Test Harness:<programlisting># Bind NIC task result
&lt;NIC&gt; binded successfully!</programlisting> <emphasis
      role="bold">Note:</emphasis> The test will not fail if the NIC is
      already bound, it will be unbound and bound again with the provided
      configuration.</para>
    </section>

    <section id="unbind_nic">
      <title>Network - Unbind_NIC</title>

      <para><emphasis role="bold">Description:</emphasis> Unbinding a physical
      network interface (NIC) from a device. For details please refer
      to:</para>

      <itemizedlist>
        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/unbindNIC.yml</filename></para>
        </listitem>

        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/automation_framework/network/unbindNetworkInterface.py</filename></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Preconditions:</emphasis></para>

      <itemizedlist>
        <listitem>
          <para>A NIC is bound to a device in a uCPE Manager instance.</para>
        </listitem>

        <listitem>
          <para>A NIC JSON configuration file exists: <programlisting>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/&lt;NIC&gt;.json</programlisting></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Action:</emphasis> Run the
      <filename>unbindNIC.yml</filename> Ansible Playbook with the
      <literal>&lt;Device-name&gt;</literal> and
      <literal>&lt;NIC&gt;</literal> as extra-vars: <programlisting>ansible-playbook playbooks/unbindNIC.yml -e "device=&lt;Device-name&gt; nic=&lt;NIC&gt;"</programlisting></para>

      <para><emphasis role="bold">Result:</emphasis> Output of the test case
      run using the Test Harness: <programlisting># Unbind NIC task result
&lt;NIC&gt; unbinded!</programlisting> <emphasis role="bold">Note:</emphasis>
      The test will not fail if the NIC is not bound. The output will instead
      contain:<programlisting># debug
&lt;NIC&gt; is not binded!</programlisting></para>
    </section>

    <section id="create_bri">
      <title>Network - Create_Bridge</title>

      <para><emphasis role="bold">Description:</emphasis> Creating an OVS
      network bridge on a uCPE device. For details please refer to:</para>

      <itemizedlist>
        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/addBridge.yml</filename></para>
        </listitem>

        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/automation_framework/network/newNetworkBridge.py</filename></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Preconditions:</emphasis><itemizedlist>
          <listitem>
            <para>A NIC is bound to a device in a uCPE Manager
            instance.</para>
          </listitem>

          <listitem>
            <para>A Bridge JSON configuration file exists:<programlisting>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/&lt;Bridge-name&gt;.json</programlisting></para>

            <para><emphasis role="bold">Example:</emphasis><programlisting>&lt;AF-TH-install-dir&gt;/lab_config/intelc3850-2/wan_br.json
&lt;AF-TH-install-dir&gt;/lab_config/intelc3850-2/lan_br.json</programlisting></para>
          </listitem>
        </itemizedlist></para>

      <para><emphasis role="bold">Action:</emphasis> Run the
      <filename>addBridge.yml</filename> Ansible Playbook with the
      <literal>&lt;Device-name&gt;</literal> and the
      <literal>&lt;Bridge-name&gt;</literal> as extra-vars: <programlisting>ansible-playbook playbooks/addBridge.yml -e "device=&lt;Device-name&gt; bridge=&lt;Bridge-name&gt;"</programlisting></para>

      <para><emphasis role="bold">Result:</emphasis> Output of the test case
      run using the Test Harness: <programlisting># Add Bridge task result
&lt;Bridge-name&gt; network bridge was added!</programlisting><emphasis
      role="bold">Note:</emphasis> The test will not fail if there already
      exists a bridge with the same name. It will be deleted and the bridge
      will be created again with the provided configuration.</para>
    </section>

    <section id="remov_bri">
      <title>Network - Remove_Bridge</title>

      <para><emphasis role="bold">Description:</emphasis> Removing an OVS
      network bridge from a uCPE device. For details please refer to:</para>

      <itemizedlist>
        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/deleteBridge.yml</filename></para>
        </listitem>

        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/automation_framework/network/delNetworkBridge.py</filename></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Preconditions:</emphasis><itemizedlist>
          <listitem>
            <para>A Bridge exists in a uCPE Manager instance.</para>
          </listitem>

          <listitem>
            <para>A Bridge JSON configuration file exists: <programlisting>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/&lt;Bridge-name&gt;.json</programlisting></para>
          </listitem>
        </itemizedlist><emphasis role="bold">Action:</emphasis> Run the
      <filename>deleteBridge.yml</filename> Ansible Playbook with the
      <literal>&lt;Device-name&gt;</literal> and the
      <literal>&lt;Bridge-name&gt;</literal> as extra-vars: <programlisting>ansible-playbook playbooks/deleteBridge.yml -e "device=&lt;Device-name&gt; \
bridge=&lt;Bridge-name&gt;"</programlisting></para>

      <para><emphasis role="bold">Result:</emphasis> Output of the test case
      run using the Test Harness: <programlisting># Delete Bridge task result
&lt;Bridge-name&gt; network bridge was deleted!</programlisting><emphasis
      role="bold">Note:</emphasis> The test will not fail if the bridge does
      not exist: <programlisting># debug
&lt;Bridge-name&gt; bridge not found!</programlisting></para>
    </section>
  </section>

  <section id="vnf_deploy_lifecycle">
    <title>VNF Deployment and Lifecycle</title>

    <para>The following details the automated suite that handles the testing
    of the instantiation, lifecycle and destruction of a VNF for Enea NFV
    Access.</para>

    <section id="inst_vnfi">
      <title>Instantiate_VNFI</title>

      <para><emphasis role="bold">Description:</emphasis> Creating a VNF
      instance on a uCPE device. For details please refer to:</para>

      <itemizedlist>
        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/instantiateVNFI.yml</filename></para>
        </listitem>

        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/automation_framework/vnf/instantiateVNFI.py</filename></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Preconditions:</emphasis> <itemizedlist>
          <listitem>
            <para>A VNF Image is onboarded and a device is added to the uCPE
            Manager. Depending on the VNF, other steps may be required.</para>
          </listitem>

          <listitem>
            <para>A VNFI JSON configuration file exists: <programlisting>&lt;AF-TH-install-dir&gt;/vnf_config/&lt;VNF-Descriptor-name&gt;/&lt;VNFI-name&gt;.json</programlisting></para>

            <para><emphasis role="bold">Example:</emphasis> <programlisting>&lt;AF-TH-install-dir&gt;/vnf_config/fortigateImage/fortigateFWInstance.json</programlisting></para>
          </listitem>
        </itemizedlist></para>

      <para><emphasis role="bold">Action:</emphasis> Run the
      <filename>instantiateVNFI.yml</filename> Ansible Playbook with the
      <literal>&lt;Device-name&gt;</literal>,
      <literal>&lt;VNF-Descriptor-name&gt;</literal> and the
      <literal>&lt;VNFI-name&gt;</literal> as extra-vars: <programlisting>ansible-playbook playbooks/instantiateVNFI.yml -e "device=&lt;Device-name&gt; \
vnfd=&lt;VNF-Descriptor-name&gt; vnfi=&lt;VNFI-name&gt;"</programlisting></para>

      <para><emphasis role="bold">Result:</emphasis> Output of the test case
      run using the Test Harness: <programlisting># Instantiate VNF task result
&lt;VNFI-name&gt; was instantiated!</programlisting><emphasis
      role="bold">Note:</emphasis> The test will not fail if the VNF instance
      already exists. The output will instead contain: <programlisting># debug
&lt;VNFI-name&gt; already exists!</programlisting></para>
    </section>

    <section id="control_vnfi">
      <title>Control_VNFI</title>

      <para><emphasis role="bold">Description:</emphasis> Changing the status
      of a VNF instance (Pause, Resume, Stop, Start). For details please refer
      to:</para>

      <itemizedlist>
        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/controlVNFI.yml</filename></para>
        </listitem>

        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/automation_framework/vnf/controlVNFI.py</filename></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Precondition:</emphasis> A VNF is
      instantiated on a uCPE device.</para>

      <para><emphasis role="bold">Action:</emphasis> Run the
      <filename>controlVNFI.yml</filename> Ansible Playbook with the
      <literal>&lt;Device-name&gt;</literal>,
      <literal>&lt;VNFI-name&gt;</literal> and the
      <literal>&lt;Command&gt;</literal> as extra-vars: <programlisting>ansible-playbook playbooks/controlVNFI.yml -e "device=&lt;Device-name&gt; \
vnfi=&lt;VNFI-name&gt; status=&lt;Command&gt;"</programlisting>Where Command =
      { pause | resume | stop | start }</para>

      <para><emphasis role="bold">Result:</emphasis> Output of the test case
      run using the Test Harness: <programlisting># Change VNFI Status task result
&lt;VNFI-name&gt; status was set to &lt;Command&gt;</programlisting><emphasis
      role="bold">Note:</emphasis> The test will not fail if the VNF instance
      does not exist or if the specified command is not valid. Depending on
      the case, the output will contain: <programlisting># debug
&lt;VNFI-name&gt; was not found!</programlisting>or<programlisting># debug
Invalid VNF Instance control command specified - &lt;Command&gt;</programlisting></para>
    </section>

    <section id="destroy_vnfi">
      <title>Destroy_VNFI</title>

      <para><emphasis role="bold">Description:</emphasis> Destroying a VNF
      instance from a uCPE device. For details please refer to:</para>

      <itemizedlist>
        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/destroyVNFI.yml</filename></para>
        </listitem>

        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/automation_framework/vnf/destroyVNFI.py</filename></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Precondition:</emphasis> A VNF is
      instantiated on a uCPE device.</para>

      <para><emphasis role="bold">Action:</emphasis> Run the
      <filename>destroyVNFI.yml</filename> Ansible Playbook with the
      <literal>&lt;Device-name&gt;</literal> and the
      <filename>&lt;VNFI-name&gt;</filename> as extra-vars: <programlisting>ansible-playbook playbooks/destroyVNFI.yml -e "device=&lt;Device-name&gt; vnfi=&lt;VNFI-name&gt;"</programlisting><emphasis
      role="bold">Result:</emphasis> Output of the test case run using the
      Test Harness:<programlisting># Destroy VNFI task result
&lt;VNFI-name&gt; was destroyed!</programlisting><emphasis
      role="bold">Note:</emphasis> The test will not fail if the VNF instance
      does not exist. The output will instead contain: <programlisting># debug
&lt;VNFI-name&gt; was not found!</programlisting></para>
    </section>
  </section>

  <section id="serv_creat_lifecycle">
    <title>Service Creation and Lifecycle</title>

    <para>This test suite contains more complex test cases designed to verify
    service creation and service lifecycle management. These test cases also
    serve as examples of how different services can be deployed using the
    Automation Framework (AF) and the Test Harness (TH).</para>

    <section id="fortigate_firewall">
      <title>Fortigate VNF as a Firewall</title>

      <para>This test case was implemented in two different ways to exemplify
      both methods supported by the AF and TH to deploy such services.</para>

      <para>Prerequisites needed in order to deploy the FortiGate VNF as a
      Firewall:</para>

      <orderedlist>
        <listitem>
          <para>Onboard the FortiGate VNF Image.</para>
        </listitem>

        <listitem>
          <para>Add a uCPE device.</para>
        </listitem>

        <listitem>
          <para>Bind 2 physical interfaces: <literal>wan_nic</literal> (this
          physical interface has to be connected to the Lab Network) and
          <literal>lan_nic</literal>.</para>
        </listitem>

        <listitem>
          <para>Create 2 bridges: <literal>wan_br</literal> (using the
          <literal>wan_nic</literal> interface) and <literal>lan_br</literal>
          (using the <literal>lan_nic</literal> interface).</para>
        </listitem>

        <listitem>
          <para>Instantiate the FortiGate VNF using the basic Firewall
          configuration and the FortiGate License.</para>
        </listitem>
      </orderedlist>

      <para>For more information please refer to the "FortiGate VNF as a
      Firewall" chapter from the "Enea NFV Access Example Use-cases" manual.
      <remark>olink needed here</remark><note>
          <para>The license and configuration files for the FortiGate VNF are
          not included in the TH and should be obtained from Enea.</para>
        </note></para>

      <section id="fortigate_fw_instance">
        <title>FortigateFWInstance Test</title>

        <para><emphasis role="bold">Description:</emphasis> Instantiate the
        FortiGate VNF as a Firewall and test it using an isolated network
        namespace.</para>

        <para>This example was implemented with the "Test Harness" method,
        based on Ansible Playbooks. For details please refer to:</para>

        <itemizedlist>
          <listitem>
            <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/fortigateFWService/instantiateFortigateFW.yml</filename></para>
          </listitem>

          <listitem>
            <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/fortigateFWService/testFortigateFWInstance.yml</filename></para>
          </listitem>

          <listitem>
            <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/fortigateFWService/cleanupTestFortigateFWInstance.yml</filename></para>
          </listitem>

          <listitem>
            <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/fortigateFWService/cleanupFortigateFWInstance.yml</filename></para>
          </listitem>
        </itemizedlist>

        <para><emphasis role="bold">Preconditions:</emphasis></para>

        <itemizedlist>
          <listitem>
            <para>Add the Fortigate VNF Image
            (<filename>fortios.qcow2</filename>) to the
            <literal>vnf_image</literal> folder.</para>
          </listitem>

          <listitem>
            <para>The device JSON configuration file is created:
            <filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/&lt;Device-name&gt;.json</filename>.</para>
          </listitem>

          <listitem>
            <para>Add device settings in the <literal>hosts</literal> Ansible
            inventory file under <literal>[fortigateFW]</literal> and remove
            the <filename>intelc3850-2</filename> example.</para>

            <para><emphasis role="bold">Example:</emphasis> <programlisting>intelc3850-2 ansible_host=172.24.12.114 ansible_port=22 \
ansible_user=root ansible_pass=root</programlisting></para>
          </listitem>

          <listitem>
            <para>NIC JSON configuration files are created:</para>

            <itemizedlist>
              <listitem>
                <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/wan_nic.json</filename></para>
              </listitem>

              <listitem>
                <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/lan_nic.json</filename></para>
              </listitem>
            </itemizedlist>
          </listitem>

          <listitem>
            <para>Bridge JSON configuration files are created:</para>

            <itemizedlist>
              <listitem>
                <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/wan_br.json</filename></para>
              </listitem>

              <listitem>
                <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/lan_br.json</filename></para>
              </listitem>
            </itemizedlist>
          </listitem>

          <listitem>
            <para>Download the FortiGate VNF Firewall basic configuration file
            from Enea, copy it into the
            <filename>&lt;AF-TH-install-dir&gt;/vnf_config/fortigateImage</filename>
            directory and rename it to
            <filename>fortigateFW.conf</filename>.</para>
          </listitem>

          <listitem>
            <para>Retrieve the FortiGate VNF license file from Fortinet or
            Enea, copy it into the
            <literal>&lt;AF-TH-install-dir&gt;/vnf_config/fortigateImage</literal>
            directory and rename it to
            <filename>fortigateLicense.lic</filename>.</para>

            <para>Please refer to the "FortiGate VNF as a Firewall" chapter
            from the Enea NFV Access Example Use-cases
            manual.<remark>olink</remark></para>
          </listitem>
        </itemizedlist>

        <para><emphasis role="bold">Action:</emphasis> Run the
        <filename>instantiateFortigateFW.yml</filename> Ansible Playbook with
        the <literal>&lt;Device-name&gt;</literal> as
        extra-vars:<programlisting>ansible-playbook playbooks/fortigateFWService/instantiateFortigateFW.yml \
-e "device=&lt;Device-name&gt;"</programlisting></para>

        <para><emphasis role="bold">Result:</emphasis> Output of the test case
        run using the Test Harness: <programlisting># Test FortigateFWInstance task result
FortigateFWInstance tested successfully!</programlisting></para>

        <para><emphasis role="bold">Cleanup:</emphasis> Run the
        <filename>cleanupFortigateFWInstance.yml</filename> Ansible Playbook
        with the <literal>&lt;Device-name&gt;</literal> as extra-vars:
        <programlisting>ansible-playbook playbooks/fortigateFWService/cleanupFortigateFWInstance.yml \
-e "device=&lt;Device-name&gt;"</programlisting></para>
      </section>

      <section id="deploy_fortigate_fw">
        <title>DeployFortigateFW Scenario</title>

        <para><emphasis role="bold">Description:</emphasis> Deploy the
        Fortigate VNF as a Firewall. This example was implemented with the
        "Automation Framework" method, based on the
        <filename>unittestSuite.py</filename> Python module.</para>

        <para>For details please refer to:</para>

        <itemizedlist>
          <listitem>
            <para><literal>&lt;AF-TH-install-dir&gt;/playbooks/unittestSuiteTest/deployFortigateFWScenario.yml</literal></para>
          </listitem>

          <listitem>
            <para><literal>&lt;AF-TH-install-dir&gt;/playbooks/unittestSuiteTest/cleanupFortigateFWScenario.yml</literal></para>
          </listitem>

          <listitem>
            <para><literal>&lt;AF-TH-install-dir&gt;/automation_framework/unittestSuite</literal>
            directory.</para>
          </listitem>
        </itemizedlist>

        <para><emphasis role="bold">Preconditions:</emphasis></para>

        <itemizedlist>
          <listitem>
            <para>Add the FortiGate VNF Image
            (<filename>fortios.qcow2</filename>) to the
            <literal>vnf_image</literal> folder.</para>
          </listitem>

          <listitem>
            <para>The device JSON configuration file is created: </para>

            <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/&lt;Device-name&gt;.json</filename>.</para>
          </listitem>

          <listitem>
            <para>The NIC JSON configuration files are created:</para>

            <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/wan_nic.json</filename></para>

            <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/lan_nic.json</filename></para>
          </listitem>

          <listitem>
            <para>The Bridge JSON configuration files are created:</para>

            <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/wan_br.json</filename></para>

            <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/lan_br.json</filename></para>
          </listitem>

          <listitem>
            <para>Download the FortiGate VNF Firewall basic configuration from
            Enea, copy it into the
            <literal>&lt;AF-TH-install-dir&gt;/vnf_config/fortigateImage</literal>
            directory and rename it to
            <filename>fortigateFW.conf</filename>.</para>
          </listitem>

          <listitem>
            <para>Retrieve the FortiGate VNF license file from Fortinet or
            Enea, copy it into the
            <literal>&lt;AF-TH-install-dir&gt;/vnf_config/fortigateImage</literal>
            directory and rename it to
            <filename>fortigateLicense.lic</filename>.</para>

            <para>For more details, please refer to:</para>

            <itemizedlist>
              <listitem>
                <para>The "FortiGate VNF as a Firewall" chapter from the Enea
                NFV Access Example Use-cases manual.<remark>olink
                needed</remark></para>
              </listitem>

              <listitem>
                <para>The "Python Unit-Test Suite" chapter from the Enea NFV
                Access Automation Framework and Test Harness User
                Guide.</para>
              </listitem>
            </itemizedlist>
          </listitem>
        </itemizedlist>

        <para><emphasis role="bold">Action:</emphasis> Run the
        <filename>deployFortigateFWScenario.yml</filename> Ansible Playbook
        with the <literal>&lt;Device-name&gt;</literal> as extra-vars:
        <programlisting>ansible-playbook playbooks/unittestSuiteTest/deployFortigateFWScenario.yml \
-e "device=&lt;Device-name&gt;"</programlisting></para>

        <para><emphasis role="bold">Result:</emphasis> Output of the test case
        run using the Test Harness: <programlisting># unittestSuite Deploy Test task result
FortigateFW Scenario deployed successfully!</programlisting></para>

        <para><emphasis role="bold">Cleanup:</emphasis> Run the
        <filename>cleanupFortigateFWScenario.yml</filename> Ansible Playbook
        with the <literal>&lt;Device-name&gt;</literal> as extra-vars:
        <programlisting>ansible-playbook playbooks/unittestSuiteTest/cleanupFortigateFWScenario.yml \
-e "device=&lt;Device-name&gt;"</programlisting></para>
      </section>
    </section>

    <section id="chained_vnf">
      <title>chainedVNFsService</title>

      <para><emphasis role="bold">Description:</emphasis> This sample test
      case corresponds to the "VNF Chaining Example Use-case" from the Enea
      NFV Access Example Use-cases manual.</para>

      <para>For details please refer to:</para>

      <itemizedlist>
        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/chainedVNFsService/chainedVNFsService.yml</filename></para>
        </listitem>

        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/chainedVNFsService/testChainedVNFsService.yml</filename></para>
        </listitem>

        <listitem>
          <para><filename>&lt;AF-TH-install-dir&gt;/playbooks/chainedVNFsService/cleanupChainedVNFsService.yml</filename></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Preconditions:</emphasis></para>

      <itemizedlist>
        <listitem>
          <para>Add the Fortigate VNF Image
          (<filename>fortios.qcow2</filename>) to the
          <literal>vnf_image</literal> folder.</para>
        </listitem>

        <listitem>
          <para>Add the Juniper vSRX VNF Image
          (<filename>juniper.qcow2</filename>) to the
          <literal>vnf_image</literal> folder.</para>
        </listitem>

        <listitem>
          <para>The device JSON configuration file(s) is created, e.g.:</para>

          <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/&lt;Device-name&gt;.json</filename>.</para>
        </listitem>

        <listitem>
          <para>Add device settings in the <literal>hosts</literal> Ansible
          inventory file under <literal>[chainedVNFs]</literal>. Keep both
          devices, the "site1" and "site2" entries, and update the values for
          <literal>ansible_host</literal>, <literal>ansible_port</literal>,
          <literal>ansible_user</literal> and <literal>ansible_pass</literal>,
          as applicable.</para>

          <para><emphasis role="bold">Example:</emphasis></para>

          <para><programlisting>site1 ansible_host=172.24.14.157 ansible_port=22 ansible_user=root \
ansible_pass=root</programlisting></para>

          <para><programlisting>site2 ansible_host=172.24.14.50 ansible_port=22 ansible_user=root \
ansible_pass=root</programlisting></para>
        </listitem>

        <listitem>
          <para>NIC JSON configuration files are created for each of the
          devices, where <literal>mgmt_nic</literal> is connected to the DHCP
          from the Lab Network and <literal>wan_nic</literal> is connected
          back to back to the other device:</para>

          <itemizedlist>
            <listitem>
              <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/mgmt_nic.json</filename></para>
            </listitem>

            <listitem>
              <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/wan_nic.json</filename></para>
            </listitem>

            <listitem>
              <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/lan_nic.json</filename></para>
            </listitem>
          </itemizedlist>
        </listitem>

        <listitem>
          <para>Bridge JSON configuration files are created for each of the
          devices:</para>

          <itemizedlist>
            <listitem>
              <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/vnf_mgmt_br.json</filename></para>
            </listitem>

            <listitem>
              <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/sfc_br.json</filename></para>
            </listitem>

            <listitem>
              <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/wan_br.json</filename></para>
            </listitem>

            <listitem>
              <para><filename>&lt;AF-TH-install-dir&gt;/lab_config/&lt;Device-name&gt;/lan_br.json</filename></para>
            </listitem>
          </itemizedlist>

          <para>Note that sample configuration files needed for devices' NICs
          and bridges can be found in:
          <literal>&lt;AF-TH-install-dir&gt;/lab_config/inteld1521-1</literal>
          and
          <literal>&lt;AF-TH-install-dir&gt;/lab_config/inteld1521-2</literal>.</para>
        </listitem>

        <listitem>
          <para>Retrieve the FortiGate VNF Firewall basic configuration files
          from Enea (<filename>FortiFW-Site1.conf</filename> and
          <filename>FortiFW-Site2.conf</filename>), and copy them into the
          <literal>&lt;AF-TH-install-dir&gt;/vnf_config/fortigateFWImage</literal>
          directory.</para>
        </listitem>

        <listitem>
          <para>Retrieve the FortiGate VNF license file from Fortinet or Enea,
          copy it into the
          <literal>&lt;AF-TH-install-dir&gt;/vnf_config/fortigateFWImage</literal>
          directory and rename it to
          <filename>fortigateLicense.lic</filename>.</para>
        </listitem>

        <listitem>
          <para>Retrieve the Juniper vSRX basic configuration files from Enea
          (<filename>vSRX-Site1.iso</filename> and
          <filename>vSRX-Site2.iso</filename>), and copy them into the
          <literal>&lt;AF-TH-install-dir&gt;/vnf_config/junipervSRXImage</literal>
          directory.</para>
        </listitem>

        <listitem>
          <para>Retrieve the <filename>vSRX-domain-update-script</filename>
          from Enea and copy it into the <literal>junipervSRXImage</literal>
          directory.</para>

          <para>Please refer to the "VNF Chaining Example Use-case" chapter
          from the Enea NFV Access Example Use-cases manual for additional
          information about preconditions.<remark>olink to this
          chapter</remark></para>
        </listitem>
      </itemizedlist>

      <para><emphasis role="bold">Action:</emphasis> Run the
      <filename>chainedVNFsService.yml</filename> Ansible Playbook as
      follows:<programlisting>ansible-playbook playbooks/chainedVNFsService/chainedVNFsService.yml \
-e "site1=inteld1521-1 site2=inteld1521-2 arch=XeonD"</programlisting></para>

      <para>Note that "arch" may either be { XeonD | AtomC } depending on the
      target set chosen.</para>

      <para><emphasis role="bold">Result:</emphasis> Output of the test case
      run using the Test Harness: <programlisting># testChainedVNFsService task result
******************************************************************************
 * site1 - changed=False ----------------------------------------------
----
&lt;site1_lan-ip&gt; ---&gt; &lt;site2_lan-ip&gt;
LAN-to-LAN connectivity (through VPN tunnel)tested successfully!</programlisting></para>

      <para><emphasis role="bold">Cleanup:</emphasis> Run the
      <filename>cleanupChainedVNFsService.yml</filename> Ansible Playbook as
      follows: <programlisting>ansible-playbook playbooks/chainedVNFsService/cleanupChainedVNFsService.yml \
-e "site1=inteld1521-1 site2=inteld1521-2 arch=XeonD"</programlisting></para>
    </section>
  </section>
</chapter>