mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 23:51:09 +03:00
Add unit test for azure inventory.
This commit is contained in:
parent
d5b7be3f4f
commit
dfe4e0c694
@ -2001,6 +2001,19 @@ class InventoryUpdatesTest(BaseTransactionTest):
|
||||
inventory_source = self.update_inventory_source(self.group, source='openstack', credential=credential)
|
||||
self.check_inventory_source(inventory_source)
|
||||
|
||||
def test_update_from_azure(self):
|
||||
source_username = getattr(settings, 'TEST_AZURE_USERNAME', '')
|
||||
source_key_data = getattr(settings, 'TEST_AZURE_KEY_DATA', '')
|
||||
if not all([source_username, source_key_data]):
|
||||
self.skipTest("No test azure credentials defined")
|
||||
self.create_test_license_file()
|
||||
credential = Credential.objects.create(kind='azure',
|
||||
username=source_username,
|
||||
ssh_key_data=source_key_data)
|
||||
inventory_source = self.update_inventory_source(self.group, source='azure', credential=credential)
|
||||
self.check_inventory_source(inventory_source)
|
||||
self.assertFalse(self.group.all_hosts.filter(instance_id='').exists())
|
||||
|
||||
|
||||
class InventoryCredentialTest(BaseTest):
|
||||
def setUp(self):
|
||||
|
@ -491,3 +491,7 @@ TEST_RACKSPACE_REGIONS = 'all'
|
||||
TEST_VMWARE_HOST = ''
|
||||
TEST_VMWARE_USER = ''
|
||||
TEST_VMWARE_PASSWORD = ''
|
||||
|
||||
# Azure credentials.
|
||||
TEST_AZURE_USERNAME = ''
|
||||
TEST_AZURE_KEY_DATA = ''
|
||||
|
Loading…
Reference in New Issue
Block a user