def test_get_enabled(self): self._create_test_plugins() cluster = self._create_test_cluster() plugin = ClusterPlugins.get_connected_plugins(cluster).first() ClusterPlugins.set_attributes(cluster.id, plugin.id, enabled=True) enabled_plugin = ClusterPlugins.get_enabled(cluster.id).first() self.assertEqual(plugin.id, enabled_plugin.id)
def test_get_enabled(self): self._create_test_plugins() cluster = self._create_test_cluster() plugin_id = ClusterPlugins.get_connected_plugins(cluster.id)[0][0] ClusterPlugins.set_attributes(cluster.id, plugin_id, enabled=True) enabled_plugin = ClusterPlugins.get_enabled(cluster.id)[0].id self.assertEqual(enabled_plugin, plugin_id)
def test_get_enabled_plugins(self): plugin_a = self._create_plugin(**self._compat_meta) plugin_b = self._create_plugin(**self._compat_meta) ClusterPlugins.set_attributes( self.cluster.id, plugin_a.id, enabled=True) compat_plugins = ClusterPlugins.get_compatible_plugins(self.cluster) self.assertItemsEqual(compat_plugins, [plugin_a, plugin_b]) enabled_plugins = ClusterPlugins.get_enabled(self.cluster.id) self.assertItemsEqual(enabled_plugins, [plugin_a])
def test_enable_plugins_by_component(self): self.env.create_plugin( name='plugin_with_test_storage', package_version='4.0.0', fuel_version=['8.0'], releases=[{ 'repository_path': 'repositories/ubuntu', 'version': '2015.1-8.3', 'os': 'ubuntu', 'mode': ['ha'], 'deployment_scripts_path': 'deployment_scripts/' }], components_metadata=self.env.get_default_components( name='storage:test_storage')) plugin = self.env.create_plugin( version='1.0.0', name='plugin_with_test_storage', package_version='4.0.0', fuel_version=['8.0'], releases=[{ 'repository_path': 'repositories/ubuntu', 'version': '2015.1-8.3', 'os': 'ubuntu', 'mode': ['ha'], 'deployment_scripts_path': 'deployment_scripts/' }], components_metadata=self.env.get_default_components( name='storage:test_storage')) cluster = self.env.create( release_kwargs={ 'operating_system': consts.RELEASE_OS.ubuntu, 'version': '2015.1-8.3' }, cluster_kwargs={ 'mode': consts.CLUSTER_MODES.ha_compact, 'api': False, 'components': ['hypervisor:test_hypervisor', 'storage:test_storage'] }) enabled_plugins = ClusterPlugins.get_enabled(cluster.id) self.assertItemsEqual([plugin], enabled_plugins)
def test_enable_plugins_by_component(self): self.env.create_plugin( name='plugin_with_test_storage', package_version='4.0.0', fuel_version=['8.0'], releases=[{ 'repository_path': 'repositories/ubuntu', 'version': '2015.1-8.3', 'os': 'ubuntu', 'mode': ['ha'], 'deployment_scripts_path': 'deployment_scripts/'}], components_metadata=self.env.get_default_components( name='storage:test_storage')) plugin = self.env.create_plugin( version='1.0.0', name='plugin_with_test_storage', package_version='4.0.0', fuel_version=['8.0'], releases=[{ 'repository_path': 'repositories/ubuntu', 'version': '2015.1-8.3', 'os': 'ubuntu', 'mode': ['ha'], 'deployment_scripts_path': 'deployment_scripts/'}], components_metadata=self.env.get_default_components( name='storage:test_storage')) cluster = self.env.create( release_kwargs={ 'operating_system': consts.RELEASE_OS.ubuntu, 'version': '2015.1-8.3'}, cluster_kwargs={ 'mode': consts.CLUSTER_MODES.ha_compact, 'api': False, 'components': [ 'hypervisor:test_hypervisor', 'storage:test_storage']}) enabled_plugins = ClusterPlugins.get_enabled(cluster.id) self.assertItemsEqual([plugin], enabled_plugins)