|
127 | 127 | Ethernet124 rs auto
|
128 | 128 | """
|
129 | 129 |
|
| 130 | +show_interfaces_path_tracing_output = """\ |
| 131 | + Interface Alias Oper Admin PT Interface ID PT Timestamp Template |
| 132 | +----------- --------- ------ ------- ----------------- ----------------------- |
| 133 | + Ethernet0 Ethernet0 down up 129 template3 |
| 134 | + Ethernet16 etp5 up up 130 template1 |
| 135 | + Ethernet24 etp6 up up 131 template2 |
| 136 | + Ethernet28 etp8 up up 132 template3 |
| 137 | + Ethernet32 etp9 up up 133 template4 |
| 138 | + Ethernet36 etp10 up up N/A N/A |
| 139 | +Ethernet112 etp29 up up N/A N/A |
| 140 | +Ethernet116 etp30 up up N/A N/A |
| 141 | +Ethernet120 etp31 up up N/A N/A |
| 142 | +Ethernet124 etp32 up up N/A N/A |
| 143 | +""" |
| 144 | + |
| 145 | +show_interfaces_path_tracing_Ethernet0_output = """\ |
| 146 | + Interface Alias Oper Admin PT Interface ID PT Timestamp Template |
| 147 | +----------- --------- ------ ------- ----------------- ----------------------- |
| 148 | + Ethernet0 Ethernet0 down up 129 template3 |
| 149 | +""" |
| 150 | + |
130 | 151 | class TestIntfutil(TestCase):
|
131 | 152 | @classmethod
|
132 | 153 | def setup_class(cls):
|
@@ -360,6 +381,30 @@ def test_show_interfaces_fec_status(self):
|
360 | 381 | assert result.exit_code == 0
|
361 | 382 | assert result.output == show_interface_fec_status_output
|
362 | 383 |
|
| 384 | + def test_show_interfaces_path_tracing_status(self): |
| 385 | + result = self.runner.invoke(show.cli.commands["interfaces"].commands["path-tracing"], []) |
| 386 | + print(result.exit_code) |
| 387 | + print(result.output) |
| 388 | + assert result.exit_code == 0 |
| 389 | + assert result.output == show_interfaces_path_tracing_output |
| 390 | + |
| 391 | + # Test 'intfutil -c path-tracing' |
| 392 | + output = subprocess.check_output(['intfutil', '-c', 'path-tracing'], stderr=subprocess.STDOUT, text=True) |
| 393 | + print(output) |
| 394 | + assert result.output == show_interfaces_path_tracing_output |
| 395 | + |
| 396 | + def test_show_interfaces_path_tracing_Ethernet0_status(self): |
| 397 | + result = self.runner.invoke(show.cli.commands["interfaces"].commands["path-tracing"], ["Ethernet0"]) |
| 398 | + print(result.exit_code) |
| 399 | + print(result.output) |
| 400 | + assert result.exit_code == 0 |
| 401 | + assert result.output == show_interfaces_path_tracing_Ethernet0_output |
| 402 | + |
| 403 | + # Test 'intfutil -c path-tracing' |
| 404 | + output = subprocess.check_output(['intfutil', '-c', 'path-tracing', '-i', 'Ethernet0'], stderr=subprocess.STDOUT, text=True) |
| 405 | + print(output) |
| 406 | + assert result.output == show_interfaces_path_tracing_Ethernet0_output |
| 407 | + |
363 | 408 | @classmethod
|
364 | 409 | def teardown_class(cls):
|
365 | 410 | print("TEARDOWN")
|
|
0 commit comments