'creating secrets with various usage_type.'

@mock.patch.object(fakelibvirt.virConnect, 'secretDefineXML')
def test_create_secret(self, mock_sec):

    self.host.create_secret('rbd', 'rbdvol')
    self.host.create_secret('ceph', 'cephvol')
    self.host.create_secret('iscsi', 'iscsivol')
    self.host.create_secret('volume', 'vol')
    self.assertRaises(exception.NovaException, self.host.create_secret, 'foo', 'foovol')
    secret = mock.MagicMock()
    mock_sec.return_value = secret
    self.host.create_secret('iscsi', 'iscsivol', password='foo')
    secret.setValue.assert_called_once_with('foo')
