def test_generate_ceph_cmd(self, image):
        sub_cmd = ['osd', 'pool']
        args = ['create', 'foo']
        if image:
            expected_cmd = fake_container_cmd
        else:
            expected_cmd = [fake_binary]

        expected_cmd.extend([
            '-n', 'client.admin', '-k', '/etc/ceph/ceph.client.admin.keyring',
            '--cluster', fake_cluster, 'osd', 'pool', 'create', 'foo'
        ])
        assert ca_common.generate_ceph_cmd(
            fake_cluster, sub_cmd, args, container_image=image) == expected_cmd
Esempio n. 2
0
    def test_generate_ceph_cmd_different_cluster_name(self, image):
        sub_cmd = ['osd', 'pool']
        args = ['create', 'foo']
        if image:
            expected_cmd = self.fake_container_cmd
        else:
            expected_cmd = [self.fake_binary]

        expected_cmd.extend([
            '-n', 'client.admin', '-k', '/etc/ceph/foo.client.admin.keyring',
            '--cluster', 'foo', 'osd', 'pool', 'create', 'foo'
        ])
        result = ca_common.generate_ceph_cmd(sub_cmd,
                                             args,
                                             cluster='foo',
                                             container_image=image)
        assert result == expected_cmd