コード例 #1
0
    def test_cluster_minions_add_invalid_ip(self):
        fqdn_ip4 = GrainsManager.get_grain('node1.ceph.com', 'fqdn_ip4')
        GrainsManager.set_grain('node1.ceph.com', 'fqdn_ip4', ['127.0.0.1'])

        self.shell.run_cmdline('/Cluster/Minions add node1.ceph.com')
        self.assertInSysOut(
            "Host 'node1.ceph.com' FQDN resolves to the loopback interface IP "
            "address")
        self.assertIsNone(PillarManager.get('ceph-salt:minions:all'))

        GrainsManager.set_grain('node1.ceph.com', 'fqdn_ip4', fqdn_ip4)
コード例 #2
0
 def setUp(self):
     super(DeployTest, self).setUp()
     self.salt_env.minions = ['node1.ceph.com', 'node2.ceph.com']
     GrainsManager.set_grain('node1.ceph.com', 'ceph-salt', {
         'member': True,
         'roles': ['mon']
     })
     GrainsManager.set_grain('node2.ceph.com', 'ceph-salt', {
         'member': True,
         'roles': ['mgr']
     })
コード例 #3
0
    def setUp(self):
        super(ConfigShellTest, self).setUp()
        self.shell = CephBootstrapConfigShell()
        generate_config_shell_tree(self.shell)

        self.salt_env.minions = [
            'node1.ceph.com', 'node2.ceph.com', 'node3.ceph.com'
        ]
        GrainsManager.set_grain('node1.ceph.com', 'fqdn_ip4', ['10.20.39.201'])
        GrainsManager.set_grain('node2.ceph.com', 'fqdn_ip4', ['10.20.39.202'])
        GrainsManager.set_grain('node3.ceph.com', 'fqdn_ip4', ['10.20.39.203'])
コード例 #4
0
 def test_grains_filter_by(self):
     GrainsManager.set_grain('node1', 'ceph-salt', {
         'member': True,
         'roles': ['mon']
     })
     GrainsManager.set_grain('node2', 'ceph-salt', {
         'member': True,
         'roles': ['mgr']
     })
     GrainsManager.set_grain('node3', 'ceph-salt', {
         'member': True,
         'roles': ['storage']
     })
     result = GrainsManager.filter_by('ceph-salt:member')
     self.assertEqual(set(result), {'node1', 'node2', 'node3'})
コード例 #5
0
 def setUp(self):
     super(GrainsManagerTest, self).setUp()
     GrainsManager.set_grain('test', 'key', 'value')
コード例 #6
0
 def test_grains_del(self):
     GrainsManager.del_grain('test', 'key')
     self.assertNotInGrains('test', 'key')
コード例 #7
0
 def test_grains_get(self):
     value = GrainsManager.get_grain('test', 'key')
     self.assertDictEqual(value, {'test': 'value'})