|
112 | 112 | Ethernet124 N/A N/A up up
|
113 | 113 | """
|
114 | 114 |
|
| 115 | +show_interfaces_path_tracing_output = """\ |
| 116 | + Interface Alias Oper Admin PT Interface ID PT Timestamp Template |
| 117 | +----------- --------- ------ ------- ----------------- ----------------------- |
| 118 | + Ethernet0 Ethernet0 down up 129 template3 |
| 119 | + Ethernet16 etp5 up up 130 template1 |
| 120 | + Ethernet24 etp6 up up 131 template2 |
| 121 | + Ethernet28 etp8 up up 132 template3 |
| 122 | + Ethernet32 etp9 up up 133 template4 |
| 123 | + Ethernet36 etp10 up up N/A N/A |
| 124 | +Ethernet112 etp29 up up N/A N/A |
| 125 | +Ethernet116 etp30 up up N/A N/A |
| 126 | +Ethernet120 etp31 up up N/A N/A |
| 127 | +Ethernet124 etp32 up up N/A N/A |
| 128 | +""" |
| 129 | + |
| 130 | +show_interfaces_path_tracing_Ethernet0_output = """\ |
| 131 | + Interface Alias Oper Admin PT Interface ID PT Timestamp Template |
| 132 | +----------- --------- ------ ------- ----------------- ----------------------- |
| 133 | + Ethernet0 Ethernet0 down up 129 template3 |
| 134 | +""" |
| 135 | + |
115 | 136 | class TestIntfutil(TestCase):
|
116 | 137 | @classmethod
|
117 | 138 | def setup_class(cls):
|
@@ -338,6 +359,30 @@ def test_show_interfaces_link_training_status(self):
|
338 | 359 | assert result.exit_code == 0
|
339 | 360 | assert result.output == show_interface_link_training_status_output
|
340 | 361 |
|
| 362 | + def test_show_interfaces_path_tracing_status(self): |
| 363 | + result = self.runner.invoke(show.cli.commands["interfaces"].commands["path-tracing"], []) |
| 364 | + print(result.exit_code) |
| 365 | + print(result.output) |
| 366 | + assert result.exit_code == 0 |
| 367 | + assert result.output == show_interfaces_path_tracing_output |
| 368 | + |
| 369 | + # Test 'intfutil -c path-tracing' |
| 370 | + output = subprocess.check_output(['intfutil', '-c', 'path-tracing'], stderr=subprocess.STDOUT, text=True) |
| 371 | + print(output) |
| 372 | + assert result.output == show_interfaces_path_tracing_output |
| 373 | + |
| 374 | + def test_show_interfaces_path_tracing_Ethernet0_status(self): |
| 375 | + result = self.runner.invoke(show.cli.commands["interfaces"].commands["path-tracing"], ["Ethernet0"]) |
| 376 | + print(result.exit_code) |
| 377 | + print(result.output) |
| 378 | + assert result.exit_code == 0 |
| 379 | + assert result.output == show_interfaces_path_tracing_Ethernet0_output |
| 380 | + |
| 381 | + # Test 'intfutil -c path-tracing' |
| 382 | + output = subprocess.check_output(['intfutil', '-c', 'path-tracing', '-i', 'Ethernet0'], stderr=subprocess.STDOUT, text=True) |
| 383 | + print(output) |
| 384 | + assert result.output == show_interfaces_path_tracing_Ethernet0_output |
| 385 | + |
341 | 386 | @classmethod
|
342 | 387 | def teardown_class(cls):
|
343 | 388 | print("TEARDOWN")
|
|
0 commit comments