Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
 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'}
     ]
Ejemplo n.º 4
0
 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}]
Ejemplo n.º 5
0
 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}]
Ejemplo n.º 6
0
 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'
     }]
Ejemplo n.º 7
0
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)
Ejemplo n.º 8
0
 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}]
Ejemplo n.º 9
0
    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)
Ejemplo n.º 10
0
    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)
Ejemplo n.º 11
0
 def checkenabled(self):
     self.packages = [ "EMCpower" ]
     self.files = [ "/opt/Navisphere/bin", "/proc/emcp" ]
     return Plugin.checkenabled(self)
Ejemplo n.º 12
0
 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)
Ejemplo n.º 13
0
 def checkenabled(self):
     self.ipa_server = self.isInstalled("ipa-server")
     self.ipa_client = self.isInstalled("ipa-client")
     return Plugin.checkenabled(self)
Ejemplo n.º 14
0
 def check_enabled(self):
     self.packages = ["EMCpower"]
     self.files = ["/opt/Navisphere/bin", "/proc/emcp"]
     return Plugin.check_enabled(self)