libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [1/3] Add SSD support to GCE Compute driver
Date Mon, 21 Jul 2014 08:35:22 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk a26da95ef -> e3edf278c


http://git-wip-us.apache.org/repos/asf/libcloud/blob/e3edf278/libcloud/test/compute/fixtures/gce/global_snapshots_lcsnapshot.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/gce/global_snapshots_lcsnapshot.json b/libcloud/test/compute/fixtures/gce/global_snapshots_lcsnapshot.json
index 9b071a9..12c6cf0 100644
--- a/libcloud/test/compute/fixtures/gce/global_snapshots_lcsnapshot.json
+++ b/libcloud/test/compute/fixtures/gce/global_snapshots_lcsnapshot.json
@@ -1,7 +1,7 @@
 {
   "creationTimestamp": "2013-12-16T13:03:51.345-08:00",
   "description": "",
-  "diskSizeGb": "1",
+  "diskSizeGb": "10",
   "id": "17482266715940883688",
   "kind": "compute#snapshot",
   "name": "lcsnapshot",
@@ -9,4 +9,4 @@
   "sourceDisk": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks/lcdisk",
   "sourceDiskId": "-2511816066479461182",
   "status": "READY"
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e3edf278/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks.json
index 68d40fc..fc39c99 100644
--- a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks.json
+++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks.json
@@ -6,8 +6,10 @@
       "id": "08045379695757218000",
       "kind": "compute#disk",
       "name": "lcdisk",
+      "description": "I'm a happy little SSD",
+      "type": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/diskTypes/pd-ssd",
       "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks/lcdisk",
-      "sizeGb": "1",
+      "sizeGb": "10",
       "status": "READY",
       "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a"
     },
@@ -17,6 +19,8 @@
       "id": "0265567475385851075",
       "kind": "compute#disk",
       "name": "node-name",
+      "description": "I'm a happy little disk",
+      "type": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/diskTypes/pd-standard",
       "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks/node-name",
       "sizeGb": "10",
       "sourceImage": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120",
@@ -27,4 +31,4 @@
   ],
   "kind": "compute#diskList",
   "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks"
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e3edf278/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks_lcdisk.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks_lcdisk.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks_lcdisk.json
index d88ba6e..af66fb8 100644
--- a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks_lcdisk.json
+++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks_lcdisk.json
@@ -3,8 +3,10 @@
   "id": "16109451798967042451",
   "kind": "compute#disk",
   "name": "lcdisk",
+  "description": "I'm a happy little SSD",
+  "type": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/diskTypes/pd-ssd",
   "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks/lcdisk",
-  "sizeGb": "1",
+  "sizeGb": "10",
   "status": "READY",
   "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a"
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e3edf278/libcloud/test/compute/test_gce.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_gce.py b/libcloud/test/compute/test_gce.py
index 963675b..7d3855e 100644
--- a/libcloud/test/compute/test_gce.py
+++ b/libcloud/test/compute/test_gce.py
@@ -343,11 +343,19 @@ class GCENodeDriverTest(LibcloudTestCase, TestCaseMixin):
         volume = self.driver.ex_get_volume('lcdisk')
         snapshot = volume.snapshot(snapshot_name)
         self.assertEqual(snapshot.name, snapshot_name)
-        self.assertEqual(snapshot.size, '1')
+        self.assertEqual(snapshot.size, '10')
+
+    def test_create_volume_ssd(self):
+        volume_name = 'lcdisk'
+        size = 10
+        volume = self.driver.create_volume(size, volume_name,
+                                           ex_disk_type='pd-ssd')
+        self.assertTrue(isinstance(volume, StorageVolume))
+        self.assertEqual(volume.extra['type'], 'pd-ssd')
 
     def test_create_volume(self):
         volume_name = 'lcdisk'
-        size = 1
+        size = 10
         volume = self.driver.create_volume(size, volume_name)
         self.assertTrue(isinstance(volume, StorageVolume))
         self.assertEqual(volume.name, volume_name)
@@ -595,15 +603,16 @@ class GCENodeDriverTest(LibcloudTestCase, TestCaseMixin):
         snapshot_name = 'lcsnapshot'
         snapshot = self.driver.ex_get_snapshot(snapshot_name)
         self.assertEqual(snapshot.name, snapshot_name)
-        self.assertEqual(snapshot.size, '1')
+        self.assertEqual(snapshot.size, '10')
         self.assertEqual(snapshot.status, 'READY')
 
     def test_ex_get_volume(self):
         volume_name = 'lcdisk'
         volume = self.driver.ex_get_volume(volume_name)
         self.assertEqual(volume.name, volume_name)
-        self.assertEqual(volume.size, '1')
+        self.assertEqual(volume.size, '10')
         self.assertEqual(volume.extra['status'], 'READY')
+        self.assertEqual(volume.extra['type'], 'pd-ssd')
 
     def test_ex_get_zone(self):
         zone_name = 'us-central1-b'


Mime
View raw message