libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1082805 - in /incubator/libcloud/trunk: libcloud/data/pricing.json test/compute/test_ec2.py
Date Fri, 18 Mar 2011 02:50:24 GMT
Author: tomaz
Date: Fri Mar 18 02:50:24 2011
New Revision: 1082805

URL: http://svn.apache.org/viewvc?rev=1082805&view=rev
Log:
Forgot to commit this files.

Modified:
    incubator/libcloud/trunk/libcloud/data/pricing.json
    incubator/libcloud/trunk/test/compute/test_ec2.py

Modified: incubator/libcloud/trunk/libcloud/data/pricing.json
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/data/pricing.json?rev=1082805&r1=1082804&r2=1082805&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/data/pricing.json (original)
+++ incubator/libcloud/trunk/libcloud/data/pricing.json Fri Mar 18 02:50:24 2011
@@ -1,4 +1,11 @@
 {
+    "bluebox": {
+       "1gb": 0.15,
+       "2gb": 0.25,
+       "4gb": 0.35,
+       "8gb": 0.45
+    },
+
     "rackspace": {
         "1": 0.015,
         "2": 0.030,

Modified: incubator/libcloud/trunk/test/compute/test_ec2.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/test_ec2.py?rev=1082805&r1=1082804&r2=1082805&view=diff
==============================================================================
--- incubator/libcloud/trunk/test/compute/test_ec2.py (original)
+++ incubator/libcloud/trunk/test/compute/test_ec2.py Fri Mar 18 02:50:24 2011
@@ -17,6 +17,7 @@ import unittest
 import httplib
 
 from libcloud.compute.drivers.ec2 import EC2NodeDriver, EC2APSENodeDriver
+from libcloud.compute.drivers.ec2 import NimbusNodeDriver
 from libcloud.compute.drivers.ec2 import EC2APNENodeDriver, IdempotentParamError
 from libcloud.compute.base import Node, NodeImage, NodeSize, NodeLocation
 
@@ -275,5 +276,43 @@ class EC2APNETests(EC2Tests):
         EC2MockHttp.type = None
         self.driver = EC2APNENodeDriver(EC2_ACCESS_ID, EC2_SECRET)
 
+class NimbusTests(EC2Tests):
+    def setUp(self):
+        NimbusNodeDriver.connectionCls.conn_classes = (None, EC2MockHttp)
+        EC2MockHttp.use_param = 'Action'
+        EC2MockHttp.type = None
+        self.driver = NimbusNodeDriver(EC2_ACCESS_ID, EC2_SECRET,
+                host="some.nimbuscloud.com")
+
+    def test_ex_describe_addresses_for_node(self):
+        # overridden from EC2Tests -- Nimbus doesn't support elastic IPs.
+        node = Node('i-4382922a', None, None, None, None, self.driver)
+        ip_addresses = self.driver.ex_describe_addresses_for_node(node)
+        self.assertEqual(len(ip_addresses), 0)
+
+    def test_ex_describe_addresses(self):
+        # overridden from EC2Tests -- Nimbus doesn't support elastic IPs.
+        node = Node('i-4382922a', None, None, None, None, self.driver)
+        nodes_elastic_ips = self.driver.ex_describe_addresses([node])
+
+        self.assertEqual(len(nodes_elastic_ips), 1)
+        self.assertEqual(len(nodes_elastic_ips[node.id]), 0)
+
+    def test_list_sizes(self):
+        sizes = self.driver.list_sizes()
+
+        ids = [s.id for s in sizes]
+        self.assertTrue('m1.small' in ids)
+        self.assertTrue('m1.large' in ids)
+        self.assertTrue('m1.xlarge' in ids)
+
+    def test_list_nodes(self):
+        # overridden from EC2Tests -- Nimbus doesn't support elastic IPs.
+        node = self.driver.list_nodes()[0]
+        public_ips = node.public_ip
+        self.assertEqual(node.id, 'i-4382922a')
+        self.assertEqual(len(node.public_ip), 1)
+        self.assertEqual(public_ips[0], '1.2.3.5')
+
 if __name__ == '__main__':
     sys.exit(unittest.main())



Mime
View raw message