Chad Smith has proposed merging ~chad.smith/cloud-init:fix/cloud-tests-ec2 into 

Commit message:
tests: fix ec2 integration network metadata validation

Fix integraiton test logic for ec2 to look for network and
availability-zone data under the key path
'ds'=>'meta-data' instead of just 'ds' when parsing instance-data.json.

Requested reviews:
  Server Team CI bot (server-team-bot): continuous-integration
  cloud-init commiters (cloud-init-dev)

For more details, see:
Your team cloud-init commiters is requested to review the proposed merge of 
~chad.smith/cloud-init:fix/cloud-tests-ec2 into cloud-init:master.
diff --git a/tests/cloud_tests/testcases/ b/tests/cloud_tests/testcases/
index 324c7c9..05963c7 100644
--- a/tests/cloud_tests/testcases/
+++ b/tests/cloud_tests/testcases/
@@ -149,7 +149,9 @@ class CloudTestCase(unittest.TestCase):
             ['ds/user-data'], instance_data['base64-encoded-keys'])
         ds = instance_data.get('ds', {})
-        macs = ds.get('network', {}).get('interfaces', {}).get('macs', {})
+        v1_data = instance_data.get('v1', {})
+        metadata = ds.get('meta-data', {})
+        macs = metadata.get('network', {}).get('interfaces', {}).get('macs', {})
         if not macs:
             raise AssertionError('No network data from EC2 meta-data')
         # Check meta-data items we depend on
@@ -160,10 +162,8 @@ class CloudTestCase(unittest.TestCase):
             for key in expected_net_keys:
                 self.assertIn(key, mac_data)
-            ds.get('placement', {}).get('availability-zone'),
+            metadata.get('placement', {}).get('availability-zone'),
             'Could not determine EC2 Availability zone placement')
-        ds = instance_data.get('ds', {})
-        v1_data = instance_data.get('v1', {})
             v1_data['availability-zone'], 'expected ec2 availability-zone')
         self.assertEqual('aws', v1_data['cloud-name'])
Mailing list:
Post to     :
Unsubscribe :
More help   :

Reply via email to