Пример #1
0
 def test_generate_storm_config(self):
     STORM_092 = '0.9.2'
     STORM_101 = '1.0.1'
     STORM_110 = '1.1.0'
     tested_versions = []
     master_hostname = "s-master"
     zk_hostnames = ["s-zoo"]
     configs_092 = s_config.generate_storm_config(
         master_hostname, zk_hostnames, STORM_092)
     self.assertTrue('nimbus.host' in configs_092.keys())
     self.assertFalse('nimbus.seeds' in configs_092.keys())
     tested_versions.append(STORM_092)
     configs_101 = s_config.generate_storm_config(
         master_hostname, zk_hostnames, STORM_101)
     self.assertFalse('nimbus.host' in configs_101.keys())
     self.assertTrue('nimbus.seeds' in configs_101.keys())
     self.assertTrue('client.jartransformer.class' in configs_101.keys())
     self.assertEqual(configs_101['client.jartransformer.class'],
                      'org.apache.storm.hack.StormShadeTransformer')
     tested_versions.append(STORM_101)
     configs_110 = s_config.generate_storm_config(
         master_hostname, zk_hostnames, STORM_110)
     self.assertFalse('nimbus.host' in configs_110.keys())
     self.assertTrue('nimbus.seeds' in configs_110.keys())
     self.assertTrue('client.jartransformer.class' in configs_110.keys())
     self.assertEqual(configs_110['client.jartransformer.class'],
                      'org.apache.storm.hack.StormShadeTransformer')
     tested_versions.append(STORM_110)
     storm = s_plugin.StormProvider()
     self.assertEqual(storm.get_versions(), tested_versions)
Пример #2
0
 def test_get_open_port(self):
     plugin_storm = pl.StormProvider()
     cluster = mock.Mock()
     ng = mock.Mock()
     ng.node_processes = ['nimbus']
     cluster.node_groups = [ng]
     ng.cluster = cluster
     ports = plugin_storm.get_open_ports(ng)
     self.assertEqual([8080], ports)