|
21 | 21 | header_lines = 2 |
22 | 22 | warning_lines = 0 |
23 | 23 |
|
| 24 | +show_chassis_modules_output="""\ |
| 25 | + Name Description Physical-Slot Oper-Status Admin-Status |
| 26 | +------------ --------------- --------------- ------------- -------------- |
| 27 | +FABRIC-CARD0 fabric-card 17 Online up |
| 28 | +FABRIC-CARD1 fabric-card 18 Offline up |
| 29 | + LINE-CARD0 line-card 1 Empty up |
| 30 | + LINE-CARD1 line-card 2 Online down |
| 31 | + SUPERVISOR0 supervisor-card 16 Online up |
| 32 | +""" |
| 33 | + |
| 34 | +show_chassis_midplane_output="""\ |
| 35 | + Name IP-Address Reachability |
| 36 | +----------- ------------- -------------- |
| 37 | + LINE-CARD0 192.168.1.1 True |
| 38 | + LINE-CARD1 192.168.1.2 False |
| 39 | +SUPERVISOR0 192.168.1.100 True |
| 40 | +""" |
| 41 | + |
24 | 42 | class TestChassisModules(object): |
25 | 43 | @classmethod |
26 | 44 | def setup_class(cls): |
27 | 45 | print("SETUP") |
28 | 46 | os.environ["UTILITIES_UNIT_TESTING"] = "1" |
29 | 47 |
|
| 48 | + def test_show_and_verify_output(self): |
| 49 | + runner = CliRunner() |
| 50 | + result = runner.invoke(show.cli.commands["chassis-modules"].commands["status"], []) |
| 51 | + print(result.output) |
| 52 | + assert(result.output == show_chassis_modules_output) |
| 53 | + |
30 | 54 | def test_show_all_count_lines(self): |
31 | 55 | runner = CliRunner() |
32 | 56 | result = runner.invoke(show.cli.commands["chassis-modules"].commands["status"], []) |
@@ -112,6 +136,12 @@ def test_config_incorrect_module(self): |
112 | 136 | print(result.output) |
113 | 137 | assert result.exit_code != 0 |
114 | 138 |
|
| 139 | + def test_show_and_verify_midplane_output(self): |
| 140 | + runner = CliRunner() |
| 141 | + result = runner.invoke(show.cli.commands["chassis-modules"].commands["midplane-status"], []) |
| 142 | + print(result.output) |
| 143 | + assert(result.output == show_chassis_midplane_output) |
| 144 | + |
115 | 145 | def test_midplane_show_all_count_lines(self): |
116 | 146 | runner = CliRunner() |
117 | 147 | result = runner.invoke(show.cli.commands["chassis-modules"].commands["midplane-status"], []) |
|
0 commit comments