You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by an...@apache.org on 2017/04/02 11:38:43 UTC
[01/16] libcloud git commit: create integration folder
Repository: libcloud
Updated Branches:
refs/heads/trunk 623fa89be -> 4a3cc7b56
create integration folder
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/9c0e0a02
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/9c0e0a02
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/9c0e0a02
Branch: refs/heads/trunk
Commit: 9c0e0a02d85123beed12862ef067c81ab2eac7bf
Parents: 80b17fa
Author: Anthony Shaw <an...@apache.org>
Authored: Mon Jan 9 16:07:28 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Mon Jan 9 16:07:28 2017 +1100
----------------------------------------------------------------------
integration/__main__.py | 0
1 file changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/9c0e0a02/integration/__main__.py
----------------------------------------------------------------------
diff --git a/integration/__main__.py b/integration/__main__.py
new file mode 100644
index 0000000..e69de29
[15/16] libcloud git commit: remove pylint from the integration
directory, have py3/2 compatible dict key search
Posted by an...@apache.org.
remove pylint from the integration directory, have py3/2 compatible dict key search
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/e807b39d
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/e807b39d
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/e807b39d
Branch: refs/heads/trunk
Commit: e807b39df90c8a02e1b2fbf6abd91a2c5987d708
Parents: 9aee8e7
Author: Anthony Shaw <an...@apache.org>
Authored: Sun Apr 2 20:50:28 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Sun Apr 2 20:50:28 2017 +1000
----------------------------------------------------------------------
integration/api/util.py | 2 +-
tox.ini | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e807b39d/integration/api/util.py
----------------------------------------------------------------------
diff --git a/integration/api/util.py b/integration/api/util.py
index 5b5e1f1..679ff98 100644
--- a/integration/api/util.py
+++ b/integration/api/util.py
@@ -22,7 +22,7 @@ from integration.config import EXPECTED_AUTH
def secure(f):
@wraps(f)
def secure_route(*args, **kwargs):
- if 'Authorization' not in request.headers.keys():
+ if 'Authorization' not in request.headers:
raise Exception('Argghhhh')
else:
auth = request.headers['Authorization']
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e807b39d/tox.ini
----------------------------------------------------------------------
diff --git a/tox.ini b/tox.ini
index 00c76cc..6447b79 100644
--- a/tox.ini
+++ b/tox.ini
@@ -89,7 +89,6 @@ commands = pylint -E --rcfile=./.pylintrc libcloud/common/
pylint -E --rcfile=./.pylintrc libcloud/storage/
pylint -E --rcfile=./.pylintrc libcloud/utils/
pylint -E --rcfile=./.pylintrc demos/
- pylint -E --rcfile=./.pylintrc integration/
pylint -E --rcfile=./.pylintrc contrib/
[testenv:lint]
[02/16] libcloud git commit: add API directory
Posted by an...@apache.org.
add API directory
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/e36c9b9d
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/e36c9b9d
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/e36c9b9d
Branch: refs/heads/trunk
Commit: e36c9b9d7eb1a4c729b3b7748fe404511d555e9e
Parents: 9c0e0a0
Author: Anthony Shaw <an...@apache.org>
Authored: Mon Jan 9 16:13:33 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Mon Jan 9 16:13:33 2017 +1100
----------------------------------------------------------------------
integration/api/__main__.py | 18 ++++++++++++++++++
integration/api/routes.py | 18 ++++++++++++++++++
2 files changed, 36 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e36c9b9d/integration/api/__main__.py
----------------------------------------------------------------------
diff --git a/integration/api/__main__.py b/integration/api/__main__.py
new file mode 100644
index 0000000..7724165
--- /dev/null
+++ b/integration/api/__main__.py
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from bottle import route, run, template
+
+run(host='localhost', port=9898)
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e36c9b9d/integration/api/routes.py
----------------------------------------------------------------------
diff --git a/integration/api/routes.py b/integration/api/routes.py
new file mode 100644
index 0000000..6e92298
--- /dev/null
+++ b/integration/api/routes.py
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+@route('/hello/<name>')
+def index(name):
+ return template('<b>Hello {{name}}</b>!', name=name)
[14/16] libcloud git commit: Merge branch 'trunk' into
integration_testing
Posted by an...@apache.org.
Merge branch 'trunk' into integration_testing
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/9aee8e72
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/9aee8e72
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/9aee8e72
Branch: refs/heads/trunk
Commit: 9aee8e72bae8c2158546f1ffbfb7e963c3980d80
Parents: 040067b 1a6987d
Author: Anthony Shaw <an...@apache.org>
Authored: Sat Apr 1 15:54:05 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Sat Apr 1 15:54:05 2017 +1100
----------------------------------------------------------------------
CHANGES.rst | 83 ++-
contrib/scrape-ec2-prices.py | 12 +
docs/compute/_supported_providers.rst | 4 +-
docs/compute/drivers/cloudscale.rst | 4 +-
docs/compute/drivers/dimensiondata.rst | 22 +
.../Nodes_Create_mcp2_Uncustomised.py | 57 ++
docs/examples/compute/onapp/functionality.py | 2 +-
docs/other/changes_in_2_0.rst | 131 ++++
docs/other/ssl-certificate-validation.rst | 4 +-
docs/other/using-http-proxy.rst | 4 +-
libcloud/__init__.py | 2 +-
libcloud/common/aws.py | 4 +-
libcloud/common/base.py | 11 +-
libcloud/compute/drivers/azure_arm.py | 4 +-
libcloud/compute/drivers/cloudscale.py | 8 +-
libcloud/compute/drivers/dimensiondata.py | 1 -
libcloud/compute/drivers/ec2.py | 336 +++++++++-
libcloud/compute/drivers/gce.py | 94 ++-
libcloud/compute/drivers/linode.py | 50 +-
libcloud/compute/drivers/profitbricks.py | 2 +-
libcloud/compute/types.py | 4 +
libcloud/data/pricing.json | 630 ++++++++++++++-----
libcloud/dns/drivers/route53.py | 17 +-
libcloud/httplib_ssl.py | 65 +-
libcloud/security.py | 2 +-
libcloud/storage/base.py | 10 +-
libcloud/storage/drivers/s3.py | 352 +++++++++--
.../2.4/deploy_customised_server.xml | 7 +
.../compute/fixtures/ec2/allocate_address.xml | 2 +-
.../fixtures/ec2/allocate_vpc_address.xml | 2 +-
.../compute/fixtures/ec2/associate_address.xml | 2 +-
.../fixtures/ec2/associate_vpc_address.xml | 2 +-
.../fixtures/ec2/attach_internet_gateway.xml | 2 +-
.../fixtures/ec2/attach_network_interface.xml | 2 +-
.../test/compute/fixtures/ec2/attach_volume.xml | 2 +-
.../ec2/authorize_security_group_egress.xml | 2 +-
.../ec2/authorize_security_group_ingress.xml | 2 +-
.../test/compute/fixtures/ec2/copy_image.xml | 2 +-
.../test/compute/fixtures/ec2/create_image.xml | 2 +-
.../fixtures/ec2/create_internet_gateway.xml | 2 +-
.../compute/fixtures/ec2/create_key_pair.xml | 2 +-
.../fixtures/ec2/create_network_interface.xml | 2 +-
.../fixtures/ec2/create_placement_groups.xml | 2 +-
.../fixtures/ec2/create_security_group.xml | 2 +-
.../compute/fixtures/ec2/create_snapshot.xml | 2 +-
.../test/compute/fixtures/ec2/create_subnet.xml | 2 +-
.../test/compute/fixtures/ec2/create_tags.xml | 2 +-
.../test/compute/fixtures/ec2/create_volume.xml | 2 +-
.../test/compute/fixtures/ec2/create_vpc.xml | 2 +-
.../fixtures/ec2/delete_internet_gateway.xml | 2 +-
.../compute/fixtures/ec2/delete_key_pair.xml | 2 +-
.../fixtures/ec2/delete_network_interface.xml | 2 +-
.../fixtures/ec2/delete_placement_groups.xml | 2 +-
.../fixtures/ec2/delete_security_group.xml | 2 +-
.../compute/fixtures/ec2/delete_snapshot.xml | 2 +-
.../test/compute/fixtures/ec2/delete_subnet.xml | 2 +-
.../test/compute/fixtures/ec2/delete_tags.xml | 2 +-
.../test/compute/fixtures/ec2/delete_volume.xml | 2 +-
.../test/compute/fixtures/ec2/delete_vpc.xml | 2 +-
.../compute/fixtures/ec2/deregister_image.xml | 2 +-
.../ec2/describe_account_attributes.xml | 2 +-
.../compute/fixtures/ec2/describe_addresses.xml | 2 +-
.../fixtures/ec2/describe_addresses_all.xml | 2 +-
.../fixtures/ec2/describe_addresses_multi.xml | 2 +-
.../fixtures/ec2/describe_addresses_single.xml | 2 +-
.../ec2/describe_availability_zones.xml | 2 +-
.../compute/fixtures/ec2/describe_images.xml | 2 +-
.../ec2/describe_images_ex_imageids.xml | 2 +-
.../compute/fixtures/ec2/describe_instances.xml | 2 +-
.../fixtures/ec2/describe_internet_gateways.xml | 2 +-
.../compute/fixtures/ec2/describe_key_pairs.xml | 2 +-
.../ec2/describe_network_interfaces.xml | 2 +-
.../fixtures/ec2/describe_placement_groups.xml | 2 +-
.../ec2/describe_reserved_instances.xml | 2 +-
.../fixtures/ec2/describe_security_groups.xml | 2 +-
.../compute/fixtures/ec2/describe_snapshots.xml | 2 +-
.../compute/fixtures/ec2/describe_subnets.xml | 2 +-
.../test/compute/fixtures/ec2/describe_tags.xml | 2 +-
.../compute/fixtures/ec2/describe_volumes.xml | 2 +-
.../test/compute/fixtures/ec2/describe_vpcs.xml | 2 +-
.../fixtures/ec2/detach_internet_gateway.xml | 2 +-
.../fixtures/ec2/detach_network_interface.xml | 2 +-
.../test/compute/fixtures/ec2/detach_volume.xml | 2 +-
.../fixtures/ec2/disassociate_address.xml | 2 +-
.../compute/fixtures/ec2/get_console_output.xml | 2 +-
.../compute/fixtures/ec2/import_key_pair.xml | 2 +-
.../fixtures/ec2/modify_image_attribute.xml | 2 +-
.../fixtures/ec2/modify_instance_attribute.xml | 2 +-
.../fixtures/ec2/modify_snapshot_attribute.xml | 4 +
.../compute/fixtures/ec2/reboot_instances.xml | 2 +-
.../compute/fixtures/ec2/register_image.xml | 2 +-
.../compute/fixtures/ec2/release_address.xml | 2 +-
.../ec2/revoke_security_group_egress.xml | 2 +-
.../ec2/revoke_security_group_ingress.xml | 2 +-
.../test/compute/fixtures/ec2/run_instances.xml | 2 +-
.../fixtures/ec2/run_instances_iam_profile.xml | 2 +-
.../compute/fixtures/ec2/run_instances_idem.xml | 2 +-
...instances_with_subnet_and_security_group.xml | 2 +-
.../compute/fixtures/ec2/start_instances.xml | 2 +-
.../compute/fixtures/ec2/stop_instances.xml | 2 +-
.../fixtures/ec2/terminate_instances.xml | 2 +-
...entral1_subnetworks_cf_972cf02e6ad49112.json | 1 +
.../test/compute/test_dimensiondata_v2_4.py | 49 ++
libcloud/test/compute/test_ec2.py | 29 +-
libcloud/test/compute/test_profitbricks.py | 2 +-
libcloud/test/storage/test_s3.py | 54 +-
libcloud/test/test_connection.py | 51 ++
libcloud/test/test_logging_connection.py | 53 ++
libcloud/utils/loggingconnection.py | 15 +-
109 files changed, 1896 insertions(+), 428 deletions(-)
----------------------------------------------------------------------
[07/16] libcloud git commit: add a raw method check,
implement basic data testing
Posted by an...@apache.org.
add a raw method check, implement basic data testing
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/95b14af1
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/95b14af1
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/95b14af1
Branch: refs/heads/trunk
Commit: 95b14af18be90eeeeca142a2882bef190f6f02a5
Parents: f278cca
Author: Anthony Shaw <an...@apache.org>
Authored: Tue Jan 10 16:22:05 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Tue Jan 10 16:22:05 2017 +1100
----------------------------------------------------------------------
integration/__main__.py | 22 +++++++++++++++++++++-
integration/api/__main__.py | 5 ++++-
integration/api/data.py | 13 ++++++++++++-
integration/api/routes.py | 9 ++++++++-
integration/api/util.py | 35 +++++++++++++++++++++++++++++++++++
integration/config.py | 21 +++++++++++++++++++++
integration/driver/test.py | 4 ++++
tox.ini | 9 ++++++++-
8 files changed, 113 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b14af1/integration/__main__.py
----------------------------------------------------------------------
diff --git a/integration/__main__.py b/integration/__main__.py
index 7999ca4..9e70f7d 100644
--- a/integration/__main__.py
+++ b/integration/__main__.py
@@ -3,7 +3,7 @@ import sys
from .driver.test import TestNodeDriver
-from .api.data import NODES
+from .api.data import NODES, REPORT_DATA
class IntegrationTest(unittest.TestCase):
def setUp(self):
@@ -11,7 +11,27 @@ class IntegrationTest(unittest.TestCase):
host='localhost', port=9898)
def test_nodes(self):
+ """
+ Test that you can list nodes and that the responding objects
+ match basic values, list (ip), and dict (extra).
+ """
nodes = self.instance.list_nodes()
+ for node in NODES:
+ match = [n for n in nodes if n.id == node['id']]
+ self.assertTrue(len(match) == 1)
+ match = match[0]
+ self.assertEqual(match.id, node['id'])
+ self.assertEqual(match.name, node['name'])
+ self.assertEqual(match.private_ips, node['private_ips'])
+ self.assertEqual(match.public_ips, node['public_ips'])
+ self.assertEqual(match.extra, node['extra'])
+
+ def test_ex_report_data(self):
+ """
+ Test that a raw request can correctly return the data
+ """
+ data = self.instance.ex_report_data().body
+ self.assertEqual(data, REPORT_DATA)
if __name__ == '__main__':
sys.exit(unittest.main())
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b14af1/integration/api/__main__.py
----------------------------------------------------------------------
diff --git a/integration/api/__main__.py b/integration/api/__main__.py
index 2257687..94c6e37 100644
--- a/integration/api/__main__.py
+++ b/integration/api/__main__.py
@@ -13,8 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from functools import wraps
+
from bottle import run
from .routes import *
-run(host='localhost', port=9898)
+if __name__ == '__main__':
+ run(host='localhost', port=9898)
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b14af1/integration/api/data.py
----------------------------------------------------------------------
diff --git a/integration/api/data.py b/integration/api/data.py
index e49d515..ece9fa4 100644
--- a/integration/api/data.py
+++ b/integration/api/data.py
@@ -22,5 +22,16 @@ NODES = [
'size': 'test-size-1',
'created_at': '2017-01-09T05:25:12+00:00',
'image': 'test-image-1',
+ 'extra': {'test-key': 'test-value'}},
+ {'id': '4567a',
+ 'name': 'test-2',
+ 'state': 'RUNNING',
+ 'public_ips': ['4.4.4.5', '8.8.8.8'],
+ 'private_ips': ['10.0.0.2', '192.168.1.1'],
+ 'size': 'test-size-1',
+ 'created_at': '2017-01-09T05:25:12+00:00',
+ 'image': 'test-image-1',
'extra': {'test-key': 'test-value'}}
-]
\ No newline at end of file
+]
+
+REPORT_DATA = "Around the ragged rocks, the ragged rascal ran. \r\n"
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b14af1/integration/api/routes.py
----------------------------------------------------------------------
diff --git a/integration/api/routes.py b/integration/api/routes.py
index 7fdc3b1..b333aec 100644
--- a/integration/api/routes.py
+++ b/integration/api/routes.py
@@ -17,8 +17,15 @@ import json
from bottle import route, template
-from .data import NODES
+from .data import NODES, REPORT_DATA
+from .util import secure
@route('/compute/nodes', method='GET')
+@secure
def list_nodes():
return json.dumps(NODES)
+
+@route('/compute/report_data', method='GET')
+@secure
+def ex_report_data():
+ return REPORT_DATA
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b14af1/integration/api/util.py
----------------------------------------------------------------------
diff --git a/integration/api/util.py b/integration/api/util.py
new file mode 100644
index 0000000..c4478e5
--- /dev/null
+++ b/integration/api/util.py
@@ -0,0 +1,35 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from bottle import run, request
+import base64
+from functools import wraps
+
+from libcloud.utils.py3 import b
+
+from ..config import EXPECTED_AUTH
+
+def secure(f):
+ @wraps(f)
+ def secure_route(*args, **kwargs):
+ if 'Authorization' not in request.headers.keys():
+ raise Exception('Argghhhh')
+ else:
+ auth = request.headers['Authorization']
+
+ if auth != EXPECTED_AUTH:
+ raise Exception('Bad authentication')
+ return f(*args, **kwargs)
+ return secure_route
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b14af1/integration/config.py
----------------------------------------------------------------------
diff --git a/integration/config.py b/integration/config.py
new file mode 100644
index 0000000..d5e524d
--- /dev/null
+++ b/integration/config.py
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import base64
+from libcloud.utils.py3 import b
+
+API_AUTH = ('apache', 'libcloud')
+
+EXPECTED_AUTH = 'Basic %s' % (base64.b64encode(b('%s:%s' % API_AUTH)))
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b14af1/integration/driver/test.py
----------------------------------------------------------------------
diff --git a/integration/driver/test.py b/integration/driver/test.py
index b695002..a3ac1dc 100644
--- a/integration/driver/test.py
+++ b/integration/driver/test.py
@@ -70,3 +70,7 @@ class TestNodeDriver(NodeDriver):
for node in r.object:
nodes.append(Node(driver=self, **node))
return nodes
+
+ def ex_report_data(self):
+ r = self.connection.request('/compute/report_data', raw=True)
+ return r.response.read()
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b14af1/tox.ini
----------------------------------------------------------------------
diff --git a/tox.ini b/tox.ini
index 0ee0ff6..c3e4a57 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py{2.6,2.7,pypy,pypy3,3.3,3.4,3.5,3.6},lint,pylint
+envlist = py{2.6,2.7,pypy,pypy3,3.3,3.4,3.5,3.6},lint,pylint,integration
[testenv]
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
@@ -88,6 +88,7 @@ commands = pylint -E --rcfile=./.pylintrc libcloud/common/
pylint -E --rcfile=./.pylintrc libcloud/storage/
pylint -E --rcfile=./.pylintrc libcloud/utils/
pylint -E --rcfile=./.pylintrc demos/
+ pylint -E --rcfile=./.pylintrc integration/
pylint -E --rcfile=./.pylintrc contrib/
[testenv:lint]
@@ -97,6 +98,12 @@ deps = -r{toxinidir}/requirements-tests.txt
commands = flake8 --ignore=E402 --exclude="test" libcloud/
flake8 --ignore=E402 --max-line-length=160 libcloud/test/
flake8 --ignore=E402 demos/
+ flake8 --ignore=E402 integration/
flake8 --ignore=E402,E902 docs/examples/
flake8 --ignore=E402,E902 --max-line-length=160 contrib/
python -mjson.tool libcloud/data/pricing.json
+
+[testenv:integration]
+deps = -r{toxinidir}/integration/requirements.txt
+
+commands = python -m integration
\ No newline at end of file
[11/16] libcloud git commit: merge from trunk, pylint and lint updates
Posted by an...@apache.org.
merge from trunk, pylint and lint updates
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/a5ff955d
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/a5ff955d
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/a5ff955d
Branch: refs/heads/trunk
Commit: a5ff955d2b8b701e179426d2c496a368a10a1e69
Parents: a9f9cb0
Author: Anthony Shaw <an...@apache.org>
Authored: Fri Jan 13 12:09:54 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Fri Jan 13 12:09:54 2017 +1100
----------------------------------------------------------------------
integration/__main__.py | 9 +++++----
integration/api/__main__.py | 4 +---
integration/api/data.py | 2 +-
integration/api/routes.py | 10 ++++++----
integration/api/util.py | 8 +++-----
integration/config.py | 2 +-
integration/driver/test.py | 6 +++---
7 files changed, 20 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/a5ff955d/integration/__main__.py
----------------------------------------------------------------------
diff --git a/integration/__main__.py b/integration/__main__.py
index 9e70f7d..9977798 100644
--- a/integration/__main__.py
+++ b/integration/__main__.py
@@ -1,12 +1,13 @@
import unittest
import sys
-from .driver.test import TestNodeDriver
+from integration.driver.test import TestNodeDriver
+
+from integration.api.data import NODES, REPORT_DATA
-from .api.data import NODES, REPORT_DATA
class IntegrationTest(unittest.TestCase):
- def setUp(self):
+ def setUp(self):
self.instance = TestNodeDriver('apache', 'libcloud', secure=False,
host='localhost', port=9898)
@@ -30,7 +31,7 @@ class IntegrationTest(unittest.TestCase):
"""
Test that a raw request can correctly return the data
"""
- data = self.instance.ex_report_data().body
+ data = self.instance.ex_report_data()
self.assertEqual(data, REPORT_DATA)
if __name__ == '__main__':
http://git-wip-us.apache.org/repos/asf/libcloud/blob/a5ff955d/integration/api/__main__.py
----------------------------------------------------------------------
diff --git a/integration/api/__main__.py b/integration/api/__main__.py
index 94c6e37..85d7dc7 100644
--- a/integration/api/__main__.py
+++ b/integration/api/__main__.py
@@ -13,11 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from functools import wraps
-
from bottle import run
-from .routes import *
+import integration.api.routes # noqa
if __name__ == '__main__':
run(host='localhost', port=9898)
http://git-wip-us.apache.org/repos/asf/libcloud/blob/a5ff955d/integration/api/data.py
----------------------------------------------------------------------
diff --git a/integration/api/data.py b/integration/api/data.py
index ece9fa4..d292ad9 100644
--- a/integration/api/data.py
+++ b/integration/api/data.py
@@ -34,4 +34,4 @@ NODES = [
'extra': {'test-key': 'test-value'}}
]
-REPORT_DATA = "Around the ragged rocks, the ragged rascal ran. \r\n"
\ No newline at end of file
+REPORT_DATA = "Around the ragged rocks, the ragged rascal ran. \r\n"
http://git-wip-us.apache.org/repos/asf/libcloud/blob/a5ff955d/integration/api/routes.py
----------------------------------------------------------------------
diff --git a/integration/api/routes.py b/integration/api/routes.py
index b333aec..05fd0ec 100644
--- a/integration/api/routes.py
+++ b/integration/api/routes.py
@@ -15,17 +15,19 @@
import json
-from bottle import route, template
+from bottle import route
+
+from integration.api.data import NODES, REPORT_DATA
+from integration.api.util import secure
-from .data import NODES, REPORT_DATA
-from .util import secure
@route('/compute/nodes', method='GET')
@secure
def list_nodes():
return json.dumps(NODES)
+
@route('/compute/report_data', method='GET')
@secure
def ex_report_data():
- return REPORT_DATA
\ No newline at end of file
+ return REPORT_DATA
http://git-wip-us.apache.org/repos/asf/libcloud/blob/a5ff955d/integration/api/util.py
----------------------------------------------------------------------
diff --git a/integration/api/util.py b/integration/api/util.py
index c4478e5..5b5e1f1 100644
--- a/integration/api/util.py
+++ b/integration/api/util.py
@@ -13,13 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from bottle import run, request
-import base64
+from bottle import request
from functools import wraps
-from libcloud.utils.py3 import b
+from integration.config import EXPECTED_AUTH
-from ..config import EXPECTED_AUTH
def secure(f):
@wraps(f)
@@ -32,4 +30,4 @@ def secure(f):
if auth != EXPECTED_AUTH:
raise Exception('Bad authentication')
return f(*args, **kwargs)
- return secure_route
\ No newline at end of file
+ return secure_route
http://git-wip-us.apache.org/repos/asf/libcloud/blob/a5ff955d/integration/config.py
----------------------------------------------------------------------
diff --git a/integration/config.py b/integration/config.py
index d5e524d..d7347fd 100644
--- a/integration/config.py
+++ b/integration/config.py
@@ -18,4 +18,4 @@ from libcloud.utils.py3 import b
API_AUTH = ('apache', 'libcloud')
-EXPECTED_AUTH = 'Basic %s' % (base64.b64encode(b('%s:%s' % API_AUTH)))
\ No newline at end of file
+EXPECTED_AUTH = 'Basic %s' % (base64.b64encode(b('%s:%s' % API_AUTH)))
http://git-wip-us.apache.org/repos/asf/libcloud/blob/a5ff955d/integration/driver/test.py
----------------------------------------------------------------------
diff --git a/integration/driver/test.py b/integration/driver/test.py
index a3ac1dc..b8bd296 100644
--- a/integration/driver/test.py
+++ b/integration/driver/test.py
@@ -56,14 +56,14 @@ class TestNodeDriver(NodeDriver):
name = 'Test Compute Driver'
website = 'http://libcloud.apache.org'
features = {'create_node': ['ssh_key', 'password']}
-
+
def __init__(self, key, secret=None, secure=True,
host=None, port=None, **kwargs):
super(TestNodeDriver, self).__init__(key=key, secret=secret,
secure=secure, host=host,
port=port,
**kwargs)
-
+
def list_nodes(self):
r = self.connection.request('/compute/nodes')
nodes = []
@@ -73,4 +73,4 @@ class TestNodeDriver(NodeDriver):
def ex_report_data(self):
r = self.connection.request('/compute/report_data', raw=True)
- return r.response.read()
\ No newline at end of file
+ return r.response.read()
[10/16] libcloud git commit: Merge branch 'trunk' into
integration_testing
Posted by an...@apache.org.
Merge branch 'trunk' into integration_testing
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/a9f9cb0c
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/a9f9cb0c
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/a9f9cb0c
Branch: refs/heads/trunk
Commit: a9f9cb0cefae2b09e09e9cb652245482e857df91
Parents: 1c5deaf f4c00ea
Author: Anthony Shaw <an...@apache.org>
Authored: Fri Jan 13 11:52:20 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Fri Jan 13 11:52:20 2017 +1100
----------------------------------------------------------------------
CHANGES.rst | 6 ++++++
libcloud/compute/drivers/vsphere.py | 8 +++++---
libcloud/storage/base.py | 20 +++----------------
libcloud/storage/drivers/s3.py | 2 +-
libcloud/test/__init__.py | 34 ++++++++++++++++++++++++++++----
libcloud/test/storage/test_s3.py | 19 ++++++++++++++----
6 files changed, 60 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
[09/16] libcloud git commit: fix libcloud connection class
Posted by an...@apache.org.
fix libcloud connection class
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/1c5deaf5
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/1c5deaf5
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/1c5deaf5
Branch: refs/heads/trunk
Commit: 1c5deaf5dc26685a5a5f46f18fef732269029507
Parents: 2d60ee2
Author: Anthony Shaw <an...@apache.org>
Authored: Wed Jan 11 10:03:44 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Wed Jan 11 10:03:44 2017 +1100
----------------------------------------------------------------------
libcloud/utils/loggingconnection.py | 75 +++++++++-----------------------
1 file changed, 20 insertions(+), 55 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/1c5deaf5/libcloud/utils/loggingconnection.py
----------------------------------------------------------------------
diff --git a/libcloud/utils/loggingconnection.py b/libcloud/utils/loggingconnection.py
index 3ee09ad..adea0ba 100644
--- a/libcloud/utils/loggingconnection.py
+++ b/libcloud/utils/loggingconnection.py
@@ -23,18 +23,11 @@ except:
from pipes import quote as pquote
from xml.dom.minidom import parseString
-import sys
import os
from libcloud.common.base import (LibcloudConnection,
- HTTPResponse,
HttpLibResponseProxy)
-from libcloud.utils.py3 import httplib
-from libcloud.utils.py3 import PY3
-from libcloud.utils.py3 import StringIO
from libcloud.utils.py3 import u
-from libcloud.utils.py3 import b
-
from libcloud.utils.misc import lowercase_keys
from libcloud.utils.compression import decompress_data
@@ -68,20 +61,6 @@ class LoggingConnection(LibcloudConnection):
ht += "%s: %s\r\n" % (h[0].title(), h[1])
ht += "\r\n"
- # this is evil. laugh with me. ha arharhrhahahaha
- class fakesock(object):
- def __init__(self, s):
- self.s = s
-
- def makefile(self, *args, **kwargs):
- if PY3:
- from io import BytesIO
- cls = BytesIO
- else:
- cls = StringIO
-
- return cls(b(self.s))
- rr = r
headers = lowercase_keys(dict(r.getheaders()))
encoding = headers.get('content-encoding', None)
@@ -95,42 +74,28 @@ class LoggingConnection(LibcloudConnection):
pretty_print = os.environ.get('LIBCLOUD_DEBUG_PRETTY_PRINT_RESPONSE',
False)
- if r.chunked:
- ht += "%x\r\n" % (len(body))
- ht += body.decode('utf-8')
- ht += "\r\n0\r\n"
- else:
- if pretty_print and content_type == 'application/json':
- try:
- body = json.loads(body.decode('utf-8'))
- body = json.dumps(body, sort_keys=True, indent=4)
- except:
- # Invalid JSON or server is lying about content-type
- pass
- elif pretty_print and content_type == 'text/xml':
- try:
- elem = parseString(body.decode('utf-8'))
- body = elem.toprettyxml()
- except Exception:
- # Invalid XML
- pass
-
- ht += u(body)
-
- if sys.version_info >= (2, 6) and sys.version_info < (2, 7):
- cls = HTTPResponse
- else:
- cls = httplib.HTTPResponse
+ if pretty_print and content_type == 'application/json':
+ try:
+ body = json.loads(body.decode('utf-8'))
+ body = json.dumps(body, sort_keys=True, indent=4)
+ except:
+ # Invalid JSON or server is lying about content-type
+ pass
+ elif pretty_print and content_type == 'text/xml':
+ try:
+ elem = parseString(body.decode('utf-8'))
+ body = elem.toprettyxml()
+ except Exception:
+ # Invalid XML
+ pass
+
+ ht += u(body)
- rr = cls(sock=fakesock(ht), method=r._method,
- debuglevel=r.debuglevel)
- rr.begin()
rv += ht
rv += ("\n# -------- end %d:%d response ----------\n"
% (id(self), id(r)))
- rr._original_data = body
- return (rr, rv)
+ return rv
def _log_curl(self, method, url, body, headers):
cmd = ["curl"]
@@ -173,12 +138,12 @@ class LoggingConnection(LibcloudConnection):
return " ".join(cmd)
def getresponse(self):
- r = HttpLibResponseProxy(LibcloudConnection.getresponse(self))
+ original_response = LibcloudConnection.getresponse(self)
if self.log is not None:
- r, rv = self._log_response(r)
+ rv = self._log_response(HttpLibResponseProxy(original_response))
self.log.write(rv + "\n")
self.log.flush()
- return r
+ return original_response
def request(self, method, url, body=None, headers=None):
headers.update({'X-LC-Request-ID': str(id(self))})
[16/16] libcloud git commit: Merge branch 'integration_testing' into
trunk
Posted by an...@apache.org.
Merge branch 'integration_testing' into trunk
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/4a3cc7b5
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/4a3cc7b5
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/4a3cc7b5
Branch: refs/heads/trunk
Commit: 4a3cc7b5688a9bc1afe577b3e98ff4b1e8d5a31a
Parents: 623fa89 e807b39
Author: Anthony Shaw <an...@apache.org>
Authored: Sun Apr 2 21:38:28 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Sun Apr 2 21:38:28 2017 +1000
----------------------------------------------------------------------
integration/README.rst | 20 ++++++++++
integration/__init__.py | 0
integration/__main__.py | 41 ++++++++++++++++++++
integration/api/__init__.py | 0
integration/api/__main__.py | 21 ++++++++++
integration/api/data.py | 37 ++++++++++++++++++
integration/api/routes.py | 33 ++++++++++++++++
integration/api/util.py | 33 ++++++++++++++++
integration/config.py | 21 ++++++++++
integration/driver/__init__.py | 0
integration/driver/test.py | 76 +++++++++++++++++++++++++++++++++++++
integration/requirements.txt | 1 +
tox.ini | 9 ++++-
13 files changed, 291 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
[08/16] libcloud git commit: Merge branch 'fix_raw_read_method' into
integration_testing
Posted by an...@apache.org.
Merge branch 'fix_raw_read_method' into integration_testing
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/2d60ee22
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/2d60ee22
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/2d60ee22
Branch: refs/heads/trunk
Commit: 2d60ee22877094ded46503459e985ed7efc5ffa6
Parents: 95b14af 2fcd275
Author: Anthony Shaw <an...@apache.org>
Authored: Tue Jan 10 20:58:23 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Tue Jan 10 20:58:23 2017 +1100
----------------------------------------------------------------------
libcloud/common/base.py | 6 ++--
libcloud/httplib_ssl.py | 46 ++++++++++++++++++++++++++++-
libcloud/test/test_response_classes.py | 27 ++++++++++++++++-
libcloud/utils/loggingconnection.py | 5 ++--
4 files changed, 77 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
[05/16] libcloud git commit: access data and promote Nodes in
responses
Posted by an...@apache.org.
access data and promote Nodes in responses
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/fb867e7f
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/fb867e7f
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/fb867e7f
Branch: refs/heads/trunk
Commit: fb867e7fe756f2f8d2e8958fca846e553483aa50
Parents: 6c1d29f
Author: Anthony Shaw <an...@apache.org>
Authored: Tue Jan 10 13:27:40 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Tue Jan 10 13:27:40 2017 +1100
----------------------------------------------------------------------
integration/__main__.py | 1 +
integration/driver/test.py | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/fb867e7f/integration/__main__.py
----------------------------------------------------------------------
diff --git a/integration/__main__.py b/integration/__main__.py
index 8f09ea9..7999ca4 100644
--- a/integration/__main__.py
+++ b/integration/__main__.py
@@ -3,6 +3,7 @@ import sys
from .driver.test import TestNodeDriver
+from .api.data import NODES
class IntegrationTest(unittest.TestCase):
def setUp(self):
http://git-wip-us.apache.org/repos/asf/libcloud/blob/fb867e7f/integration/driver/test.py
----------------------------------------------------------------------
diff --git a/integration/driver/test.py b/integration/driver/test.py
index 886c98f..b695002 100644
--- a/integration/driver/test.py
+++ b/integration/driver/test.py
@@ -16,7 +16,7 @@
import base64
from libcloud.common.base import JsonResponse, ConnectionUserAndKey
-from libcloud.compute.base import NodeDriver
+from libcloud.compute.base import NodeDriver, Node
from libcloud.utils.py3 import b
@@ -68,5 +68,5 @@ class TestNodeDriver(NodeDriver):
r = self.connection.request('/compute/nodes')
nodes = []
for node in r.object:
- nodes.append(Node(**node))
+ nodes.append(Node(driver=self, **node))
return nodes
[03/16] libcloud git commit: continue integration test driver
Posted by an...@apache.org.
continue integration test driver
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/b5702e25
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/b5702e25
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/b5702e25
Branch: refs/heads/trunk
Commit: b5702e25ea84289e881e04a1428f8265d5e5710f
Parents: e36c9b9
Author: Anthony Shaw <an...@apache.org>
Authored: Mon Jan 9 17:06:44 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Mon Jan 9 17:06:44 2017 +1100
----------------------------------------------------------------------
integration/README.rst | 20 +++++++++++
integration/__main__.py | 16 +++++++++
integration/api/__main__.py | 4 ++-
integration/api/data.py | 26 ++++++++++++++
integration/api/routes.py | 12 +++++--
integration/driver/test.py | 72 +++++++++++++++++++++++++++++++++++++++
integration/requirements.txt | 1 +
7 files changed, 147 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b5702e25/integration/README.rst
----------------------------------------------------------------------
diff --git a/integration/README.rst b/integration/README.rst
new file mode 100644
index 0000000..ed61b5a
--- /dev/null
+++ b/integration/README.rst
@@ -0,0 +1,20 @@
+Integration Test Module
+=======================
+
+This test suite is for running a live API endpoint and testing the apache-libcloud functionality as a full integration test
+
+Running the API service
+-----------------------
+
+.. code-block:: bash
+
+ pip install -r integration/requirements.txt
+ python -m integration.api
+
+Running the tests
+-----------------
+
+.. code-block:: bash
+
+ python -m integration
+
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b5702e25/integration/__main__.py
----------------------------------------------------------------------
diff --git a/integration/__main__.py b/integration/__main__.py
index e69de29..8f09ea9 100644
--- a/integration/__main__.py
+++ b/integration/__main__.py
@@ -0,0 +1,16 @@
+import unittest
+import sys
+
+from .driver.test import TestNodeDriver
+
+
+class IntegrationTest(unittest.TestCase):
+ def setUp(self):
+ self.instance = TestNodeDriver('apache', 'libcloud', secure=False,
+ host='localhost', port=9898)
+
+ def test_nodes(self):
+ nodes = self.instance.list_nodes()
+
+if __name__ == '__main__':
+ sys.exit(unittest.main())
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b5702e25/integration/api/__main__.py
----------------------------------------------------------------------
diff --git a/integration/api/__main__.py b/integration/api/__main__.py
index 7724165..2257687 100644
--- a/integration/api/__main__.py
+++ b/integration/api/__main__.py
@@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from bottle import route, run, template
+from bottle import run
+
+from .routes import *
run(host='localhost', port=9898)
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b5702e25/integration/api/data.py
----------------------------------------------------------------------
diff --git a/integration/api/data.py b/integration/api/data.py
new file mode 100644
index 0000000..e49d515
--- /dev/null
+++ b/integration/api/data.py
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+NODES = [
+ {'id': '1234a',
+ 'name': 'test-1',
+ 'state': 'RUNNING',
+ 'public_ips': ['4.4.4.4', '8.8.8.8'],
+ 'private_ips': ['10.0.0.1', '192.168.1.1'],
+ 'size': 'test-size-1',
+ 'created_at': '2017-01-09T05:25:12+00:00',
+ 'image': 'test-image-1',
+ 'extra': {'test-key': 'test-value'}}
+]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b5702e25/integration/api/routes.py
----------------------------------------------------------------------
diff --git a/integration/api/routes.py b/integration/api/routes.py
index 6e92298..7fdc3b1 100644
--- a/integration/api/routes.py
+++ b/integration/api/routes.py
@@ -13,6 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-@route('/hello/<name>')
-def index(name):
- return template('<b>Hello {{name}}</b>!', name=name)
+import json
+
+from bottle import route, template
+
+from .data import NODES
+
+@route('/compute/nodes', method='GET')
+def list_nodes():
+ return json.dumps(NODES)
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b5702e25/integration/driver/test.py
----------------------------------------------------------------------
diff --git a/integration/driver/test.py b/integration/driver/test.py
new file mode 100644
index 0000000..886c98f
--- /dev/null
+++ b/integration/driver/test.py
@@ -0,0 +1,72 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import base64
+
+from libcloud.common.base import JsonResponse, ConnectionUserAndKey
+from libcloud.compute.base import NodeDriver
+
+from libcloud.utils.py3 import b
+
+
+class TestResponseType(JsonResponse):
+ pass
+
+
+class TestConnection(ConnectionUserAndKey):
+ host = 'localhost'
+ secure = True
+ responseCls = TestResponseType
+
+ allow_insecure = True
+
+ def __init__(self, user_id, key, secure=True, host=None, port=None,
+ url=None, timeout=None, proxy_url=None,
+ api_version=None, **conn_kwargs):
+ super(TestConnection, self).__init__(
+ user_id=user_id,
+ key=key,
+ secure=secure,
+ host=host, port=port,
+ url=url, timeout=timeout,
+ proxy_url=proxy_url)
+
+ def add_default_headers(self, headers):
+ user_b64 = base64.b64encode(b('%s:%s' % (self.user_id, self.key)))
+ headers['Authorization'] = 'Basic %s' % (user_b64)
+ return headers
+
+
+class TestNodeDriver(NodeDriver):
+ connectionCls = TestConnection
+ type = 'testing'
+ api_name = 'testing'
+ name = 'Test Compute Driver'
+ website = 'http://libcloud.apache.org'
+ features = {'create_node': ['ssh_key', 'password']}
+
+ def __init__(self, key, secret=None, secure=True,
+ host=None, port=None, **kwargs):
+ super(TestNodeDriver, self).__init__(key=key, secret=secret,
+ secure=secure, host=host,
+ port=port,
+ **kwargs)
+
+ def list_nodes(self):
+ r = self.connection.request('/compute/nodes')
+ nodes = []
+ for node in r.object:
+ nodes.append(Node(**node))
+ return nodes
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b5702e25/integration/requirements.txt
----------------------------------------------------------------------
diff --git a/integration/requirements.txt b/integration/requirements.txt
new file mode 100644
index 0000000..310dc0b
--- /dev/null
+++ b/integration/requirements.txt
@@ -0,0 +1 @@
+bottle
[06/16] libcloud git commit: Merge branch 'trunk' into
integration_testing
Posted by an...@apache.org.
Merge branch 'trunk' into integration_testing
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/f278cca3
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/f278cca3
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/f278cca3
Branch: refs/heads/trunk
Commit: f278cca31f3d8a527af12fa50b181b00bb5e7987
Parents: fb867e7 3dd6d01
Author: Anthony Shaw <an...@apache.org>
Authored: Tue Jan 10 15:03:38 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Tue Jan 10 15:03:38 2017 +1100
----------------------------------------------------------------------
CHANGES.rst | 18 +++++++++++
libcloud/common/base.py | 3 ++
libcloud/httplib_ssl.py | 5 +--
libcloud/test/common/test_openstack.py | 5 +--
libcloud/test/test_connection.py | 47 +++++++++++++++++++++++++++++
5 files changed, 74 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
[04/16] libcloud git commit: Merge branch 'fix_port_propagation' into
integration_testing
Posted by an...@apache.org.
Merge branch 'fix_port_propagation' into integration_testing
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/6c1d29f8
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/6c1d29f8
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/6c1d29f8
Branch: refs/heads/trunk
Commit: 6c1d29f8e9f1d813033e086c82fb3574d9517381
Parents: b5702e2 8b3b1cb
Author: Anthony Shaw <an...@apache.org>
Authored: Mon Jan 9 19:25:40 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Mon Jan 9 19:25:40 2017 +1100
----------------------------------------------------------------------
libcloud/httplib_ssl.py | 6 +++---
libcloud/test/test_connection.py | 10 ++++++++++
2 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[12/16] libcloud git commit: add module init
Posted by an...@apache.org.
add module init
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/b3b3ebea
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/b3b3ebea
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/b3b3ebea
Branch: refs/heads/trunk
Commit: b3b3ebeab4e7c3f11bd0598f042c8871b4e7e75c
Parents: a5ff955
Author: Anthony Shaw <an...@apache.org>
Authored: Wed Jan 18 14:12:29 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Wed Jan 18 14:12:29 2017 +1100
----------------------------------------------------------------------
integration/__init__.py | 0
integration/__main__.py | 5 ++++-
integration/api/__init__.py | 0
integration/driver/__init__.py | 0
4 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b3b3ebea/integration/__init__.py
----------------------------------------------------------------------
diff --git a/integration/__init__.py b/integration/__init__.py
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b3b3ebea/integration/__main__.py
----------------------------------------------------------------------
diff --git a/integration/__main__.py b/integration/__main__.py
index 9977798..8a59610 100644
--- a/integration/__main__.py
+++ b/integration/__main__.py
@@ -35,4 +35,7 @@ class IntegrationTest(unittest.TestCase):
self.assertEqual(data, REPORT_DATA)
if __name__ == '__main__':
- sys.exit(unittest.main())
+ import libcloud
+ with open('/tmp/testing.log', 'w') as f:
+ libcloud.enable_debug(f)
+ sys.exit(unittest.main())
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b3b3ebea/integration/api/__init__.py
----------------------------------------------------------------------
diff --git a/integration/api/__init__.py b/integration/api/__init__.py
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b3b3ebea/integration/driver/__init__.py
----------------------------------------------------------------------
diff --git a/integration/driver/__init__.py b/integration/driver/__init__.py
new file mode 100644
index 0000000..e69de29
[13/16] libcloud git commit: add bottle as a dep for the linting stage
Posted by an...@apache.org.
add bottle as a dep for the linting stage
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/040067be
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/040067be
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/040067be
Branch: refs/heads/trunk
Commit: 040067be7d9e8f77e42cefcbbb8e292f3c2a8746
Parents: b3b3ebe
Author: Anthony Shaw <an...@apache.org>
Authored: Sat Apr 1 14:23:34 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Sat Apr 1 14:23:34 2017 +1100
----------------------------------------------------------------------
tox.ini | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/040067be/tox.ini
----------------------------------------------------------------------
diff --git a/tox.ini b/tox.ini
index c3e4a57..00c76cc 100644
--- a/tox.ini
+++ b/tox.ini
@@ -81,6 +81,7 @@ commands = python contrib/scrape-ec2-prices.py
[testenv:pylint]
deps = -r{toxinidir}/requirements-tests.txt
backports.ssl_match_hostname
+ bottle
commands = pylint -E --rcfile=./.pylintrc libcloud/common/
pylint -E --rcfile=./.pylintrc libcloud/container/
pylint -E --rcfile=./.pylintrc libcloud/backup/
@@ -106,4 +107,4 @@ commands = flake8 --ignore=E402 --exclude="test" libcloud/
[testenv:integration]
deps = -r{toxinidir}/integration/requirements.txt
-commands = python -m integration
\ No newline at end of file
+commands = python -m integration