add a test for bad versions of authentication versioning
@@ -19,6 +19,7 @@ import os
import sys
import unittest
import datetime
+import pytest
from libcloud.utils.iso8601 import UTC
try:
@@ -44,7 +45,8 @@ from libcloud.compute.drivers.openstack import (
OpenStack_1_1_NodeDriver, OpenStackSecurityGroup,
OpenStackSecurityGroupRule, OpenStack_1_1_FloatingIpPool,
OpenStack_1_1_FloatingIpAddress, OpenStackKeyPair,
- OpenStack_1_0_Connection
+ OpenStack_1_0_Connection,
+ OpenStackNodeDriver
)
from libcloud.compute.base import Node, NodeImage, NodeSize
from libcloud.pricing import set_pricing, clear_pricing_data
@@ -58,6 +60,17 @@ from libcloud.test.secrets import OPENSTACK_PARAMS
BASE_DIR = os.path.abspath(os.path.split(__file__)[0])
+def test_driver_instantiation_invalid_auth():
+ forced_auth = 'http://x.y.z.y:5000'
+ with pytest.raises(LibcloudError):
+ d = OpenStackNodeDriver(
+ 'user', 'correct_password',
+ ex_force_auth_version='5.0',
+ ex_force_auth_url='http://x.y.z.y:5000',
+ ex_tenant_name='admin')
+ d.list_nodes()
+
+
class OpenStackAuthTests(unittest.TestCase):
def setUp(self):
OpenStack_1_0_NodeDriver.connectionCls = OpenStack_1_0_Connection
