Example #1
0
    def test__get_libvirt_connection_socket(self, libvirt_open_mock):
        node = obj_utils.get_test_node(
            self.context,
            driver='fake_libvirt_fake',
            driver_info=_get_test_libvirt_driver_info('socket'))
        power._get_libvirt_connection(node['driver_info'])

        libvirt_open_mock.assert_called_once_with(
            'qemu+unix:///system?socket=/opt/libvirt/run/libvirt-sock')
Example #2
0
    def test__get_libvirt_connection_ssh(self, libvirt_open_mock):
        node = obj_utils.get_test_node(
            self.context,
            driver='fake_libvirt_fake',
            driver_info=_get_test_libvirt_driver_info('ssh_key'))
        power._get_libvirt_connection(node['driver_info'])

        libvirt_open_mock.assert_called_once_with(
            'qemu+ssh://test@test/?keyfile=/test/key/file&no_verify=1')
    def test__get_libvirt_connection_socket(self, libvirt_open_mock):
        node = obj_utils.get_test_node(
            self.context,
            driver='fake_libvirt_fake',
            driver_info=_get_test_libvirt_driver_info('socket'))
        power._get_libvirt_connection(node['driver_info'])

        libvirt_open_mock.assert_called_once_with(
            'qemu+unix:///system?socket=/opt/libvirt/run/libvirt-sock')
    def test__get_libvirt_connection_ssh(self, libvirt_open_mock):
        node = obj_utils.get_test_node(
            self.context,
            driver='fake_libvirt_fake',
            driver_info=_get_test_libvirt_driver_info('ssh_key'))
        power._get_libvirt_connection(node['driver_info'])

        libvirt_open_mock.assert_called_once_with(
            'qemu+ssh://test@test/?keyfile=/test/key/file&no_verify=1')
    def test__get_libvirt_connection_sasl_auth(self, libvirt_open_mock):
        node = obj_utils.get_test_node(
            self.context,
            driver='fake_libvirt_fake',
            driver_info=_get_test_libvirt_driver_info('sasl'))
        power._get_libvirt_connection(node['driver_info'])

        libvirt_open_mock.assert_called_once_with(
            'test+tcp://localhost:5000/test',
            [[power.libvirt.VIR_CRED_AUTHNAME,
              power.libvirt.VIR_CRED_PASSPHRASE],
             mock.ANY,  # Inline cred function
             None], 0)
Example #6
0
    def test__get_libvirt_connection_sasl_auth(self, libvirt_open_mock):
        node = obj_utils.get_test_node(
            self.context,
            driver='fake_libvirt_fake',
            driver_info=_get_test_libvirt_driver_info('sasl'))
        power._get_libvirt_connection(node['driver_info'])

        libvirt_open_mock.assert_called_once_with(
            'test+tcp://localhost:5000/test',
            [
                [
                    power.libvirt.VIR_CRED_AUTHNAME,
                    power.libvirt.VIR_CRED_PASSPHRASE
                ],
                mock.ANY,  # Inline cred function
                None
            ],
            0)