@@ -438,6 +438,17 @@ def mock_show_isis_hostname(request):
438
438
'Ethernet116, Ethernet120, Ethernet124, PortChannel0001, PortChannel0002, ' \
439
439
'PortChannel0003, PortChannel0004, PortChannel1001)\n '
440
440
441
+ isis_interface_display_output = \
442
+ "[INTERFACE] options: " \
443
+ "['Ethernet0', 'Ethernet4', 'Ethernet8', 'Ethernet12', 'Ethernet16', " \
444
+ "'Ethernet20', 'Ethernet24', 'Ethernet28', 'Ethernet32', 'Ethernet36', 'Ethernet40', " \
445
+ "'Ethernet44', 'Ethernet48', 'Ethernet52', 'Ethernet56', 'Ethernet60', 'Ethernet64', " \
446
+ "'Ethernet68', 'Ethernet72', 'Ethernet76', 'Ethernet80', 'Ethernet84', 'Ethernet88', " \
447
+ "'Ethernet92', 'Ethernet96', 'Ethernet100', 'Ethernet104', 'Ethernet108', 'Ethernet112', " \
448
+ "'Ethernet116', 'Ethernet120', 'Ethernet124', 'PortChannel0001', 'PortChannel0002', " \
449
+ "'PortChannel0003', 'PortChannel0004', 'PortChannel1001']\n \n "
450
+
451
+
441
452
def mock_show_isis_interface (request ):
442
453
if request .param == 'isis_interface_output' :
443
454
return isis_interface_output
@@ -449,9 +460,35 @@ def mock_show_isis_interface(request):
449
460
return isis_interface_ifname_output
450
461
elif request .param == 'isis_interface_unknown_ifname_output' :
451
462
return isis_interface_unknown_ifname_output
463
+ elif request .param == 'isis_interface_display_output' :
464
+ return ""
452
465
else :
453
466
return ""
454
467
468
+ isis_topology_output = \
469
+ """Area 1:
470
+ IS-IS paths to level-2 routers that speak IP
471
+ Vertex Type Metric Next-Hop Interface Parent
472
+ vlab-01
473
+ 10.0.0.56/31 IP internal 0 vlab-01(4)
474
+ 10.1.0.32/32 IP internal 0 vlab-01(4)
475
+ ARISTA01T1 TE-IS 10 ARISTA01T1 PortChannel101 vlab-01(4)
476
+ 10.0.0.56/31 IP TE 16777225 ARISTA01T1 PortChannel101 ARISTA01T1(4)
477
+
478
+ IS-IS paths to level-2 routers that speak IPv6
479
+ Vertex Type Metric Next-Hop Interface Parent
480
+ vlab-01
481
+ fc00::70/126 IP6 internal 0 vlab-01(4)
482
+ fc00:1::32/128 IP6 internal 0 vlab-01(4)
483
+ """
484
+
485
+ isis_topology_invalid_help_output = \
486
+ """Usage: topology [OPTIONS]
487
+ Try "topology --help" for help.
488
+
489
+ Error: Got unexpected extra argument (?)
490
+ """
491
+
455
492
show_run_isis_output = \
456
493
"""Building configuration...
457
494
@@ -492,6 +529,39 @@ def mock_show_isis_interface(request):
492
529
Error: Got unexpected extra argument (?)
493
530
"""
494
531
532
+ isis_topology_level_1_output = \
533
+ """Area 1:
534
+ """
535
+
536
+ isis_topology_level_2_output = \
537
+ """Area 1:
538
+ IS-IS paths to level-2 routers that speak IP
539
+ Vertex Type Metric Next-Hop Interface Parent
540
+ vlab-01
541
+ 10.0.0.56/31 IP internal 0 vlab-01(4)
542
+ 10.1.0.32/32 IP internal 0 vlab-01(4)
543
+ ARISTA01T1 TE-IS 10 ARISTA01T1 PortChannel101 vlab-01(4)
544
+ 10.0.0.56/31 IP TE 16777225 ARISTA01T1 PortChannel101 ARISTA01T1(4)
545
+
546
+ IS-IS paths to level-2 routers that speak IPv6
547
+ Vertex Type Metric Next-Hop Interface Parent
548
+ vlab-01
549
+ fc00::70/126 IP6 internal 0 vlab-01(4)
550
+ fc00:1::32/128 IP6 internal 0 vlab-01(4)
551
+ """
552
+
553
+ def mock_show_isis_topology (request ):
554
+ if request .param == 'isis_topology_output' :
555
+ return isis_topology_output
556
+ elif request .param == 'isis_topology_invalid_help_output' :
557
+ return isis_topology_invalid_help_output
558
+ elif request .param == 'isis_topology_level_1_output' :
559
+ return isis_topology_level_1_output
560
+ elif request .param == 'isis_topology_level_2_output' :
561
+ return isis_topology_level_2_output
562
+ else :
563
+ return ""
564
+
495
565
def mock_show_run_isis (request ):
496
566
if request .param == 'show_run_isis_output' :
497
567
return show_run_isis_output
@@ -666,6 +736,31 @@ def mock_show_isis_summary(request):
666
736
'rc' : 2 ,
667
737
'rc_output' : isis_interface_unknown_ifname_output
668
738
},
739
+ 'isis_interface_display' : {
740
+ 'args' : ['--display' ],
741
+ 'rc' : 0 ,
742
+ 'rc_output' : isis_interface_display_output
743
+ },
744
+ 'isis_topology' : {
745
+ 'args' : [],
746
+ 'rc' : 0 ,
747
+ 'rc_output' : isis_topology_output
748
+ },
749
+ 'isis_topology_invalid_help' : {
750
+ 'args' : ['?' ],
751
+ 'rc' : 2 ,
752
+ 'rc_output' : isis_topology_invalid_help_output
753
+ },
754
+ 'isis_topology_level_1' : {
755
+ 'args' : ['--level-1' ],
756
+ 'rc' : 0 ,
757
+ 'rc_output' : isis_topology_level_1_output
758
+ },
759
+ 'isis_topology_level_2' : {
760
+ 'args' : ['--level-2' ],
761
+ 'rc' : 0 ,
762
+ 'rc_output' : isis_topology_level_2_output
763
+ },
669
764
'isis_summary' : {
670
765
'args' : [],
671
766
'rc' : 0 ,
@@ -675,6 +770,7 @@ def mock_show_isis_summary(request):
675
770
'args' : ['?' ],
676
771
'rc' : 2 ,
677
772
'rc_output' : isis_summary_invalid_help_output
773
+ },
678
774
'show_run_isis' : {
679
775
'args' : [],
680
776
'rc' : 0 ,
0 commit comments