Ver Fonte

Update the type of AWS instance used for tests

Part of this also required updating the aws_instance_data.json file,
which holds all the instance info data.
Enis Afgan há 9 anos atrás
pai
commit
c5cde012ef

+ 10 - 12
cloudbridge/cloud/providers/aws/provider.py

@@ -178,29 +178,27 @@ class MockAWSCloudProvider(AWSCloudProvider, TestMockHelperMixin):
     "family": "General Purpose",
     "enhanced_networking": false,
     "vCPU": 1,
-    "generation": "previous",
+    "generation": "current",
     "ebs_iops": 0,
     "network_performance": "Low",
     "ebs_throughput": 0,
     "vpc": {
-      "ips_per_eni": 4,
+      "ips_per_eni": 2,
       "max_enis": 2
     },
     "arch": [
-      "i386",
       "x86_64"
     ],
-    "linux_virtualization_types": [],
+    "linux_virtualization_types": [
+        "HVM"
+    ],
     "ebs_optimized": false,
-    "storage": {
-      "ssd": false,
-      "devices": 1,
-      "size": 160
-    },
+    "storage": null,
     "max_bandwidth": 0,
-    "instance_type": "t1.micro",
-    "ECU": 1.0,
-    "memory": 1.7
+    "instance_type": "t2.nano",
+    "ECU": "variable,
+    "memory": 0.5,
+    "ebs_max_bandwidth": 0
   }
 ]
 """

+ 9 - 0
cloudbridge/cloud/providers/aws/services.py

@@ -806,6 +806,15 @@ class AWSInstanceTypesService(BaseInstanceTypesService):
     @property
     def instance_data(self):
         """
+        Fetch info about the available instances.
+
+        To update this information, update the file pointed to by the
+        ``AWS_INSTANCE_DATA_DEFAULT_URL`` above. The content for this file
+        should be obtained from this repo
+        https://github.com/powdahound/ec2instances.info (in particular, this
+        file: https://raw.githubusercontent.com/powdahound/ec2instances.info/
+        master/www/instances.json).
+
         TODO: Needs a caching function with timeout
         """
         r = requests.get(self.provider.config.get(

+ 1 - 1
test/helpers.py

@@ -53,7 +53,7 @@ def cleanup_action(cleanup_func):
 TEST_DATA_CONFIG = {
     "AWSCloudProvider": {
         "image": os.environ.get('CB_IMAGE_AWS', 'ami-5ac2cd4d'),
-        "instance_type": os.environ.get('CB_INSTANCE_TYPE_AWS', 't2.micro'),
+        "instance_type": os.environ.get('CB_INSTANCE_TYPE_AWS', 't2.nano'),
         "placement": os.environ.get('CB_PLACEMENT_AWS', 'us-east-1a'),
     },
     "OpenStackCloudProvider": {