From 7774b179608e5518503493290962b569c3cb68e3 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Thu, 3 Sep 2015 14:05:17 -0400 Subject: [PATCH] Unit test for ec2 credentialless inventory --- awx/main/tests/inventory.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/awx/main/tests/inventory.py b/awx/main/tests/inventory.py index 27590ec988..b38ca13d82 100644 --- a/awx/main/tests/inventory.py +++ b/awx/main/tests/inventory.py @@ -1665,6 +1665,17 @@ class InventoryUpdatesTest(BaseTransactionTest): inventory_source.save() self.check_inventory_source(inventory_source, initial=False) + def test_update_from_ec2_without_credential(self): + self.create_test_license_file() + group = self.group + group.name = 'ec2' + group.save() + self.group = group + cache_path = tempfile.mkdtemp(prefix='awx_ec2_') + self._temp_paths.append(cache_path) + inventory_source = self.update_inventory_source(self.group, source='ec2') + self.check_inventory_update(inventory_source, should_fail=True) + def test_update_from_ec2_with_nested_groups(self): source_username = getattr(settings, 'TEST_AWS_ACCESS_KEY_ID', '') source_password = getattr(settings, 'TEST_AWS_SECRET_ACCESS_KEY', '')