|
7 | 7 | format_broker, |
8 | 8 | get_metric_name, |
9 | 9 | get_metric_annotation) |
| 10 | +from modules.iib_api import get_platform_params_for_commands |
10 | 11 |
|
11 | 12 |
|
12 | 13 | class TestGetBrokersStatus(unittest.TestCase): |
13 | 14 | def test_get_brokers_status(self): |
14 | 15 | """Test for `get_brokers_status` function.""" |
15 | | - input_data = "BIP1284I: Broker 'TEST' on queue manager 'TEST' is running.\n" |
16 | | - check_data = [['TEST', 'running', 'TEST']] |
17 | | - self.assertEqual(check_data, get_brokers_status(brokers_data=input_data)) |
| 16 | + input_data = """\ |
| 17 | +BIP1284I: Broker 'TEST' on queue manager 'QM1' is running. |
| 18 | +BIP1285I: Broker 'TEST' on queue manager 'QM1' is stopped. |
| 19 | +BIP1293I: Broker 'TEST' is a multi-instance broker running in standby mode on queue manager 'QM1'. |
| 20 | +BIP1294I: Broker 'TEST' is a multi-instance broker running in standby mode on queue manager 'QM1'.\nMore information will be available when the broker instance is active. |
| 21 | +BIP1295I: Broker 'TEST' is an active multi-instance or High Availability broker that is running on queue manager 'QM1'. |
| 22 | +BIP1296I: Broker 'TEST' is stopped. It is a multi-instance broker and will be started as a WebSphere MQ service by queue manager 'QM1'. |
| 23 | +BIP1297I: Broker 'TEST' is a multi-instance broker running in standby mode on queue manager 'QM1'. |
| 24 | +BIP1298I: Broker 'TEST' is stopped. It will be started as a WebSphere MQ service by queue manager 'QM1'. |
| 25 | +""" |
| 26 | + check_data = [ |
| 27 | + ['TEST', 'running', 'QM1'], |
| 28 | + ['TEST', 'stopped', 'QM1'], |
| 29 | + ['TEST', 'running', 'QM1'], |
| 30 | + ['TEST', 'running', 'QM1'], |
| 31 | + ['TEST', 'running', 'QM1'], |
| 32 | + ['TEST', 'stopped', 'QM1'], |
| 33 | + ['TEST', 'running', 'QM1'], |
| 34 | + ['TEST', 'stopped', 'QM1']] |
| 35 | + bip_codes_brokers = get_platform_params_for_commands (iib_ver='9')[1] |
| 36 | + self.assertEqual(check_data, get_brokers_status(brokers_data=input_data, bip_codes=bip_codes_brokers)) |
| 37 | + |
| 38 | + def test_get_integration_nodes_status(self): |
| 39 | + """Test for `get_brokers_status` function for Integration Bus v10.""" |
| 40 | + input_data = """\ |
| 41 | +BIP1284I: Integration node 'TEST' with default queue manager 'QM1 and administration URI 'http://testhost:4415' is running. |
| 42 | +BIP1285I: Integration node 'TEST' on queue manager 'QM1' is stopped. |
| 43 | +BIP1295I: Integration node 'TEST' is an active multi-instance or High Availability integration node that is running on queue manager 'QM1'. |
| 44 | +BIP1296I: Integration node 'TEST' is stopped. It is a multi-instance integration node and will be started as a WebSphere MQ service by queue manager 'QM1'. |
| 45 | +BIP1298I: Integration node 'TEST' is stopped. It will be started as a WebSphere MQ service by queue manager 'QM1'. |
| 46 | +BIP1325I: Integration node 'TEST' with administration URI 'http://testhost:4415' is running. |
| 47 | +BIP1326I: Integration node 'TEST' is stopped. |
| 48 | +BIP1340I: Integration node 'TEST' is running. |
| 49 | +BIP1353I: Integration node 'TEST' with default queue manager 'QM1' is running. |
| 50 | +BIP1366I: Integration node 'TEST' is an active multi-instance or High Availability integration node that is running on queue manager 'QM1'. The administration URI is 'http://testhost:4415' |
| 51 | +BIP1376I: Integration node 'TEST' is an active multi-instance or High Availability integration node that is running on queue manager 'QM1'. The administration URI is 'http://testhost:4415' |
| 52 | +BIP1377I: Integration node 'TEST' is stopped. It is a multi-instance integration node and will be started as a WebSphere MQ service by queue manager 'QM1'. Web administration will be enabled when the node is active.\n\ |
| 53 | +""" |
| 54 | + check_data = [ |
| 55 | + ['TEST', 'running', 'QM1'], |
| 56 | + ['TEST', 'stopped', 'QM1'], |
| 57 | + ['TEST', 'running', 'QM1'], |
| 58 | + ['TEST', 'stopped', 'QM1'], |
| 59 | + ['TEST', 'stopped', 'QM1'], |
| 60 | + ['TEST', 'running', ''], |
| 61 | + ['TEST', 'stopped', ''], |
| 62 | + ['TEST', 'running', ''], |
| 63 | + ['TEST', 'running', 'QM1'], |
| 64 | + ['TEST', 'running', 'QM1'], |
| 65 | + ['TEST', 'running', 'QM1'], |
| 66 | + ['TEST', 'stopped', 'QM1']] |
| 67 | + bip_codes_integration_nodes = get_platform_params_for_commands (iib_ver='10')[1] |
| 68 | + self.assertEqual(check_data, get_brokers_status(brokers_data=input_data, bip_codes=bip_codes_integration_nodes)) |
18 | 69 |
|
19 | 70 |
|
20 | 71 | class TestGetBrokerItems(unittest.TestCase): |
|
0 commit comments