libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [libcloud] 03/05: Add a test case for it.
Date Sat, 06 Jun 2020 21:00:30 GMT
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 5f0d9f6f2636e138e90a1c86388f0952825133df
Author: Tomaz Muraus <tomaz@tomaz.me>
AuthorDate: Sat Jun 6 22:54:13 2020 +0200

    Add a test case for it.
---
 libcloud/test/compute/test_azure_arm.py | 38 +++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/libcloud/test/compute/test_azure_arm.py b/libcloud/test/compute/test_azure_arm.py
index dcb21f2..1c69adf 100644
--- a/libcloud/test/compute/test_azure_arm.py
+++ b/libcloud/test/compute/test_azure_arm.py
@@ -132,6 +132,44 @@ class AzureNodeDriverTests(LibcloudTestCase):
             'version': image.version
         })
 
+    def test_create_node_storage_account_not_provided_and_not_ex_use_managed_disks(self):
+        location = NodeLocation('any_location', '', '', self.driver)
+        size = NodeSize('any_size', '', 0, 0, 0, 0, driver=self.driver)
+        image = AzureImage('1', '1', 'ubuntu', 'pub', location.id, self.driver)
+        auth = NodeAuthPassword('any_password')
+
+        # ex_storage_account=None and ex_use_managed_disks=False should throw
+        expected_msg = "ex_use_managed_disks is False, must provide ex_storage_account"
+        self.assertRaisesRegex(ValueError, expected_msg, self.driver.create_node,
+            'test-node-1',
+            size,
+            image,
+            auth,
+            location=location,
+            ex_resource_group='000000',
+            ex_storage_account=None,
+            ex_user_name='any_user',
+            ex_network='000000',
+            ex_subnet='000000',
+            ex_use_managed_disks=False
+        )
+
+        # ex_storage_account=None and ex_use_managed_disks=True, should not throw
+        node = self.driver.create_node(
+            'test-node-1',
+            size,
+            image,
+            auth,
+            location=location,
+            ex_resource_group='000000',
+            ex_storage_account=None,
+            ex_user_name='any_user',
+            ex_network='000000',
+            ex_subnet='000000',
+            ex_use_managed_disks=True
+        )
+        self.assertTrue(node)
+
     def test_create_node_ex_disk_size(self):
         location = NodeLocation('any_location', '', '', self.driver)
         size = NodeSize('any_size', '', 0, 0, 0, 0, driver=self.driver)


Mime
View raw message