class GlobalOptionTest(unittest.TestCase): def setUp(self): self.commons = { 'global_plugin_options': { 'test_option': 'foobar', 'baz': None, 'empty_global': True, }, } self.plugin = Plugin(self.commons) self.plugin.optNames = ['baz', 'empty'] self.plugin.optParms = [{'enabled': False}, {'enabled': None}] def test_simple_lookup(self): self.assertEquals(self.plugin.getOption('test_option'), 'foobar') def test_multi_lookup(self): self.assertEquals(self.plugin.getOption(('not_there', 'test_option')), 'foobar') def test_cascade(self): self.assertEquals(self.plugin.getOption(('baz')), False) def test_none_should_cascade(self): self.assertEquals(self.plugin.getOption(('empty', 'empty_global')), True)
class GlobalOptionTest(unittest.TestCase): def setUp(self): self.commons = { 'global_plugin_options': { 'test_option': 'foobar', 'baz': None, 'empty_global': True, }, } self.plugin = Plugin(self.commons) self.plugin.opt_names = ['baz', 'empty'] self.plugin.opt_parms = [{'enabled': False}, {'enabled': None}] def test_simple_lookup(self): self.assertEquals(self.plugin.get_option('test_option'), 'foobar') def test_multi_lookup(self): self.assertEquals(self.plugin.get_option(('not_there', 'test_option')), 'foobar') def test_cascade(self): self.assertEquals(self.plugin.get_option(('baz')), False) def test_none_should_cascade(self): self.assertEquals(self.plugin.get_option(('empty', 'empty_global')), True)
def setUp(self): self.commons = { 'sysroot': '/', 'policy': LinuxPolicy(), } self.plugin = Plugin(self.commons) self.plugin.opt_names = ['baz', 'empty', 'test_option'] self.plugin.opt_parms = [ {'enabled': False}, {'enabled': None}, {'enabled': 'foobar'} ]
def setUp(self): self.commons = { 'global_plugin_options': { 'test_option': 'foobar', 'baz': None, 'empty_global': True, }, } self.plugin = Plugin(self.commons) self.plugin.opt_names = ['baz', 'empty'] self.plugin.opt_parms = [{'enabled': False}, {'enabled': None}]
def setUp(self): self.commons = { 'sysroot': '/', 'policy': LinuxPolicy(), 'global_plugin_options': { 'test_option': 'foobar', 'baz': None, 'empty_global': True }, } self.plugin = Plugin(self.commons) self.plugin.opt_names = ['baz', 'empty'] self.plugin.opt_parms = [{'enabled': False}, {'enabled': None}]
def setUp(self): self.commons = { 'sysroot': '/', 'policy': LinuxPolicy(init=InitSystem()), 'cmdlineopts': MockOptions() } self.plugin = Plugin(self.commons) self.plugin.opt_names = ['baz', 'empty', 'test_option'] self.plugin.opt_parms = [{ 'enabled': False }, { 'enabled': None }, { 'enabled': 'foobar' }]
class GlobalOptionTest(unittest.TestCase): def setUp(self): self.commons = { 'sysroot': '/', 'policy': LinuxPolicy(), } self.plugin = Plugin(self.commons) self.plugin.opt_names = ['baz', 'empty', 'test_option'] self.plugin.opt_parms = [ {'enabled': False}, {'enabled': None}, {'enabled': 'foobar'} ] def test_simple_lookup(self): self.assertEquals(self.plugin.get_option('test_option'), 'foobar') def test_cascade(self): self.assertEquals(self.plugin.get_option(('baz')), False)
def setUp(self): self.commons = { 'global_plugin_options': { 'test_option': 'foobar', 'baz': None, 'empty_global': True, }, } self.plugin = Plugin(self.commons) self.plugin.optNames = ['baz', 'empty'] self.plugin.optParms = [{'enabled': False}, {'enabled': None}]
def checkenabled(self): rhelver = self.policy().rhelVersion() if rhelver == 4: self.packages = [ "ccs", "cman", "cman-kernel", "magma", "magma-plugins", "rgmanager", "fence", "dlm", "dlm-kernel", "gulm", "GFS", "GFS-kernel", "lvm2-cluster" ] elif rhelver == 5: self.packages = [ "rgmanager", "luci", "ricci", "system-config-cluster", "gfs-utils", "gnbd", "kmod-gfs", "kmod-gnbd", "lvm2-cluster", "gfs2-utils" ] elif rhelver == 6: self.packages = [ "ricci", "corosync", "openais", "cman", "clusterlib", "fence-agents" ] self.files = [ "/etc/cluster/cluster.conf" ] return Plugin.checkenabled(self)
def check_enabled(self): rhelver = self.policy().rhel_version() if rhelver == 4: self.packages = [ "ccs", "cman", "cman-kernel", "magma", "magma-plugins", "rgmanager", "fence", "dlm", "dlm-kernel", "gulm", "GFS", "GFS-kernel", "lvm2-cluster" ] elif rhelver == 5: self.packages = [ "rgmanager", "luci", "ricci", "system-config-cluster", "gfs-utils", "gnbd", "kmod-gfs", "kmod-gnbd", "lvm2-cluster", "gfs2-utils" ] elif rhelver == 6: self.packages = [ "ricci", "corosync", "openais", "cman", "clusterlib", "fence-agents" ] self.files = ["/etc/cluster/cluster.conf"] return Plugin.check_enabled(self)
def checkenabled(self): self.packages = [ "EMCpower" ] self.files = [ "/opt/Navisphere/bin", "/proc/emcp" ] return Plugin.checkenabled(self)
def check_enabled(self): self.ipa_server = self.is_installed("ipa-server") self.ipa_client = self.is_installed("ipa-client") return Plugin.check_enabled(self)
def checkenabled(self): self.ipa_server = self.isInstalled("ipa-server") self.ipa_client = self.isInstalled("ipa-client") return Plugin.checkenabled(self)
def check_enabled(self): self.packages = ["EMCpower"] self.files = ["/opt/Navisphere/bin", "/proc/emcp"] return Plugin.check_enabled(self)