From 65b33fe43474475b0d6af0fbece6a49e2033c487 Mon Sep 17 00:00:00 2001 From: Thijs Metsch Date: Wed, 18 Jul 2012 11:45:54 +0200 Subject: [PATCH 01/10] test bug fix --- test/functional/cdmi/test_cdmi_container.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/cdmi/test_cdmi_container.py b/test/functional/cdmi/test_cdmi_container.py index 6533ec9..7f2edef 100755 --- a/test/functional/cdmi/test_cdmi_container.py +++ b/test/functional/cdmi/test_cdmi_container.py @@ -31,7 +31,6 @@ def setUp(self): auth_method = 'http://' auth_host = (self.conf.get('auth_host') + ':' + self.conf.get('auth_port')) - self.conf.get('auth_port')) auth_url = (auth_method + auth_host + self.conf.get('auth_prefix') + 'v1.0') try: @@ -50,6 +49,7 @@ def setUp(self): self.conf.get('cdmi_capability_id', 'cdmi_capabilities') + '/' + pieces[2]) + #Setup two container names suffix = format(time.time(), '.6f') self.child_container = "cdmi_test_child_container_" + suffix From f644d7fb3f38c878494a14cc751cf843116a8700 Mon Sep 17 00:00:00 2001 From: tmetsch Date: Tue, 4 Dec 2012 13:39:44 +0100 Subject: [PATCH 02/10] fixed some unittests --- test/functional/cdmi/test_cdmi_container.py | 89 +++++++------- test/functional/cdmi/test_cdmi_object.py | 126 +++++++++++--------- test/functional/cdmi/test_utils.py | 1 + 3 files changed, 116 insertions(+), 100 deletions(-) diff --git a/test/functional/cdmi/test_cdmi_container.py b/test/functional/cdmi/test_cdmi_container.py index e80b9f3..5709399 100755 --- a/test/functional/cdmi/test_cdmi_container.py +++ b/test/functional/cdmi/test_cdmi_container.py @@ -1,4 +1,5 @@ # Copyright (c) 2010-2011 IBM. +# Copyright (c) 2012 Intel Performance Learning Solutions Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,6 +20,8 @@ import time import json +SWIFT_HOST = 'localhost' + class TestCDMIContainer(unittest.TestCase): """ Test CDMI ContainerController """ @@ -93,7 +96,7 @@ def __concat_parts__(self, *args): return path.lstrip('/') def __create_test_container(self, container_name): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'content-type': 'application/directory', @@ -104,7 +107,7 @@ def __create_test_container(self, container_name): self.assertEqual(res.status, 201, "Test Container creation failed") def __delete_test_container(self, container_name): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('DELETE', self.os_access_root + '/' + container_name, @@ -112,7 +115,7 @@ def __delete_test_container(self, container_name): res = conn.getresponse() def test_create_child_container(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -133,7 +136,7 @@ def test_create_child_container(self): conn.close() def test_create_child_container_in_virtual_container(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -154,7 +157,7 @@ def test_create_child_container_in_virtual_container(self): conn.close() def test_create_child_container_no_header(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} @@ -170,7 +173,7 @@ def test_create_child_container_no_header(self): conn.close() def test_create_child_container_non_cdmi(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'content-length': '0'} conn.request('PUT', (self.access_root + '/' + self.top_container + @@ -181,7 +184,7 @@ def test_create_child_container_non_cdmi(self): conn.close() def test_create_child_container_in_virtual_container_non_cdmi(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('PUT', (self.access_root + '/' + self.top_container + @@ -191,7 +194,7 @@ def test_create_child_container_in_virtual_container_non_cdmi(self): conn.close() def test_create_grandchild_container_non_cdmi(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'content-length': '0'} non_exist_child_container = \ @@ -205,7 +208,7 @@ def test_create_grandchild_container_non_cdmi(self): conn.close() def test_create_top_container(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -235,7 +238,7 @@ def test_create_top_container(self): "objectType must be application/cdmi-container") def test_create_top_container_with_empty_body(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -264,7 +267,7 @@ def test_create_top_container_with_empty_body(self): "objectType must be application/cdmi-container") def test_create_top_container_without_body(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -292,7 +295,7 @@ def test_create_top_container_without_body(self): "objectType must be application/cdmi-container") def test_create_top_container_non_cdmi(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'content-length': '0'} conn.request('PUT', (self.access_root + '/' + @@ -303,7 +306,7 @@ def test_create_top_container_non_cdmi(self): conn.close() def test_read_top_container(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -329,7 +332,7 @@ def test_read_top_container(self): 'objectType must be application/cdmi-container') def test_read_top_account_cdmi(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -356,7 +359,7 @@ def test_read_top_account_cdmi(self): 'objectType must be application/cdmi-container') def test_read_top_account_non_cdmi(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('GET', self.access_root + '/', None, headers) @@ -365,7 +368,7 @@ def test_read_top_account_non_cdmi(self): conn.close() def test_read_top_non_exist_container(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -377,7 +380,7 @@ def test_read_top_non_exist_container(self): conn.close() def test_read_top_container_with_wrong_version(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '4.x.1', @@ -389,7 +392,7 @@ def test_read_top_container_with_wrong_version(self): conn.close() def test_read_top_container_non_cdmi(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('GET', (self.access_root + '/' + self.top_container + @@ -404,7 +407,7 @@ def test_read_top_container_non_cdmi(self): conn.close() def test_read_top_non_exist_container_non_cdmi(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('GET', (self.access_root + '/' + 'cdmi_test_not_exist_' + @@ -414,7 +417,7 @@ def test_read_top_non_exist_container_non_cdmi(self): conn.close() def test_read_child_container(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -440,7 +443,7 @@ def test_read_child_container(self): 'objectType must be application/cdmi-container') def test_read_virtual_child_container(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -466,7 +469,7 @@ def test_read_virtual_child_container(self): 'objectType must be application/cdmi-container') def test_read_virtual_child_container_without_header_trailing_slash(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} @@ -476,7 +479,7 @@ def test_read_virtual_child_container_without_header_trailing_slash(self): self.assertEqual(res.status, 409, 'Container read should have failed') def test_read_virtual_child_container_wo_header_w_trailing_slash(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} @@ -501,7 +504,7 @@ def test_read_virtual_child_container_wo_header_w_trailing_slash(self): "objectType must be application/cdmi-container") def test_read_non_exist_child_container(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -514,7 +517,7 @@ def test_read_non_exist_child_container(self): conn.close() def test_read_child_container_no_header(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} @@ -525,7 +528,7 @@ def test_read_child_container_no_header(self): "The read operation should have failed") def test_read_child_container_non_cdmi(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('GET', (self.access_root + '/' + self.top_container + @@ -549,7 +552,7 @@ def test_read_child_container_non_cdmi(self): "objectType must be application/cdmi-container") def test_read_child_container_non_cdmi_without_trailing_slash(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('GET', (self.access_root + '/' + self.top_container + @@ -558,7 +561,7 @@ def test_read_child_container_non_cdmi_without_trailing_slash(self): self.assertEqual(res.status, 409, 'Container read should have failed') def test_read_non_exist_child_container_non_cdmi(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('GET', (self.access_root + '/' + self.top_container + @@ -570,7 +573,7 @@ def test_read_non_exist_child_container_non_cdmi(self): conn.close() def test_child_container_capability_with_prefix(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} @@ -596,7 +599,7 @@ def test_child_container_capability_with_prefix(self): 'objectType should be application/cdmi-capability.') def test_child_virtual_container_capability(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -622,7 +625,7 @@ def test_child_virtual_container_capability(self): 'objectType should be application/cdmi-capability.') def test_non_exist_child_container_capability(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} @@ -636,7 +639,7 @@ def test_non_exist_child_container_capability(self): conn.close() def test_top_container_capability_with_header_prefix(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -662,7 +665,7 @@ def test_top_container_capability_with_header_prefix(self): 'objectType should be application/cdmi-capability.') def test_system_capability(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} @@ -687,7 +690,7 @@ def test_system_capability(self): 'objectType should be application/cdmi-capability.') def test_update_top_container(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -702,7 +705,7 @@ def test_update_top_container(self): conn.close() def test_update_child_container(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -718,7 +721,7 @@ def test_update_child_container(self): conn.close() def test_update_virtual_child_container(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -734,7 +737,7 @@ def test_update_virtual_child_container(self): def test_delete_child_container(self): #Delete the child container first - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} @@ -746,7 +749,7 @@ def test_delete_child_container(self): def test_delete_virtual_child_container(self): #Delete the child container first - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} @@ -759,7 +762,7 @@ def test_delete_virtual_child_container(self): def test_delete_child_container_non_cdmi(self): #Delete the child container first - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('DELETE', (self.access_root + '/' + self.top_container + @@ -771,7 +774,7 @@ def test_delete_child_container_non_cdmi(self): def test_delete_top_container(self): #Delete the child container first - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} @@ -783,7 +786,7 @@ def test_delete_top_container(self): def test_delete_top_non_exist_container(self): #Delete the child container first - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} @@ -797,7 +800,7 @@ def test_delete_top_non_exist_container(self): def test_delete_top_container_non_cdmi(self): #Delete the child container first - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('DELETE', (self.access_root + '/' + @@ -809,7 +812,7 @@ def test_delete_top_container_non_cdmi(self): def test_delete_top_non_exist_container_non_cdmi(self): #Delete the child container first - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('DELETE', (self.access_root + '/' + diff --git a/test/functional/cdmi/test_cdmi_object.py b/test/functional/cdmi/test_cdmi_object.py index 3f322ba..a68ed2c 100755 --- a/test/functional/cdmi/test_cdmi_object.py +++ b/test/functional/cdmi/test_cdmi_object.py @@ -1,4 +1,5 @@ # Copyright (c) 2010-2011 IBM. +# Copyright (c) 2012 Intel Performance Learning Solutions Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,6 +26,8 @@ import base64 import os +SWIFT_HOST = 'localhost' + class TestCDMIObject(unittest.TestCase): """ Test CDMI ContainerController """ @@ -37,7 +40,7 @@ def setUp(self): try: self.conf = get_config()['func_test'] - auth_host = 'localhost' + auth_host = self.conf.get('auth_host') auth_port = self.conf.get('auth_port') access_port = self.conf.get('access_port') auth_url = self.conf.get('auth_prefix') @@ -52,11 +55,10 @@ def setUp(self): self.access_root = ('/' + self.conf.get('cdmi_root', 'cdmi') + '/' + self.account_id) self.cdmi_capability_root = ('/' + - self.conf.get('cdmi_root', 'cdmi') + - '/' + - self.account_id + '/' + self.conf.get('cdmi_capability_id', - 'cdmi_capabilities')) + 'cdmi_capabilities') + + '/' + self.account_id) + #Setup two container names suffix = format(time.time(), '.6f') self.top_container = 'cdmi_test_top_container_' + suffix @@ -100,7 +102,7 @@ def tearDown(self): self.__delete_test_entity(self.top_container) def __create_test_container(self, container_path): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'content-type': 'application/directory', @@ -111,7 +113,7 @@ def __create_test_container(self, container_path): self.assertEqual(res.status, 201, 'Test Container creation failed') def __create_test_object(self, object_path): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('PUT', self.os_access_root + '/' + object_path, @@ -120,7 +122,7 @@ def __create_test_object(self, object_path): self.assertEqual(res.status, 201, 'Test Object creation failed') def __delete_test_entity(self, entity_path): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('DELETE', self.os_access_root + '/' + entity_path, @@ -128,7 +130,7 @@ def __delete_test_entity(self, entity_path): res = conn.getresponse() def test_create_object(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -157,7 +159,7 @@ def test_create_object(self): 'Not objectType found which is required.') def test_create_object_cdmi_multipart(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -198,7 +200,7 @@ def test_create_object_cdmi_multipart(self): conn.close() # now read the object and make sure everything is correct. - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('GET', (self.access_root + '/' + self.top_container + @@ -211,7 +213,7 @@ def test_create_object_cdmi_multipart(self): conn.close() def test_create_object_non_cdmi_multipart(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'Content-Type': 'multipart/mixed'} @@ -233,7 +235,7 @@ def test_create_object_non_cdmi_multipart(self): conn.close() # now read the object and make sure everything is correct. - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -260,7 +262,7 @@ def test_create_object_non_cdmi_multipart(self): conn.close() def test_copy_object_same_dir(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -288,7 +290,7 @@ def test_copy_object_same_dir(self): 'Not objectType found which is required.') def test_copy_object_different_dir(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -316,7 +318,7 @@ def test_copy_object_different_dir(self): 'Not objectType found which is required.') def test_copy_object_non_exist(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -335,7 +337,7 @@ def test_copy_object_non_exist(self): def test_handle_base64_object(self): # create a new object using base64 encoded data - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -368,7 +370,7 @@ def test_handle_base64_object(self): conn.close() # read the object just created. - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -394,7 +396,7 @@ def test_handle_base64_object(self): def test_large_data_upload_cdmi(self): # create the first request - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -431,7 +433,7 @@ def test_large_data_upload_cdmi(self): conn.close() # create the second request - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -469,7 +471,7 @@ def test_large_data_upload_cdmi(self): conn.close() # read the object just created. - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -496,7 +498,7 @@ def test_large_data_upload_cdmi(self): def test_large_data_upload_non_cdmi(self): # create the first request - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-UploadID': 'test_l_id_01', @@ -517,7 +519,7 @@ def test_large_data_upload_non_cdmi(self): conn.close() # create the second request - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-UploadID': 'test_l_id_01', @@ -537,7 +539,7 @@ def test_large_data_upload_non_cdmi(self): conn.close() # read the object just created. - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('GET', (self.access_root + '/' + self.top_container + @@ -553,7 +555,7 @@ def test_large_data_upload_non_cdmi(self): conn.close() def test_create_object_with_empty_body(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -579,7 +581,7 @@ def test_create_object_with_empty_body(self): 'Not objectType found which is required.') def test_create_object_without_body(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -603,7 +605,7 @@ def test_create_object_without_body(self): 'Not objectType found which is required.') def test_create_object_in_virtual_container(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -631,7 +633,7 @@ def test_create_object_in_virtual_container(self): 'Not objectType found which is required.') def test_create_object_in_virtual_container_with_conflict_name(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -648,7 +650,7 @@ def test_create_object_in_virtual_container_with_conflict_name(self): 'Object creation should have failed') def test_create_object_non_cdmi(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} body = 'value of the object' @@ -659,7 +661,7 @@ def test_create_object_non_cdmi(self): self.assertEqual(res.status, 201, 'Non-CDMI Object creation failed') def test_create_object_invalid_body(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -673,7 +675,7 @@ def test_create_object_invalid_body(self): self.assertEqual(res.status, 400, 'Object creation should have failed') def test_create_object_no_parent(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -694,7 +696,7 @@ def test_create_object_no_parent(self): 'Object creation should have failed') def test_create_object_exists_as_parent(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -711,7 +713,7 @@ def test_create_object_exists_as_parent(self): self.assertEqual(res.status, 409, 'Object creation should have failed') def test_read_object(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -734,7 +736,7 @@ def test_read_object(self): 'Not objectType found which is required.') def test_partial_cdmi_read_object(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -758,7 +760,7 @@ def test_partial_cdmi_read_object(self): 'Not objectType found which is required.') def test_partial_cdmi_read_query_object(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -782,7 +784,7 @@ def test_partial_cdmi_read_query_object(self): 'Not objectType found which is required.') def test_partial_noncdmi_read_object(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'Range': 'bytes=1-5'} @@ -796,7 +798,7 @@ def test_partial_noncdmi_read_object(self): self.assertIsNotNone(data, 'Partial read has failed') def test_partial_noncdmi_read_query_object(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} @@ -810,7 +812,7 @@ def test_partial_noncdmi_read_query_object(self): self.assertIsNotNone(data, 'Partial read has failed') def test_read_object_with_header_with_trailing_slash(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -822,7 +824,7 @@ def test_read_object_with_header_with_trailing_slash(self): self.assertEqual(res.status, 409, 'Object read should have failed') def test_read_object_without_accept_header(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} @@ -844,7 +846,7 @@ def test_read_object_without_accept_header(self): 'Not objectType found which is required.') def test_read_object_in_virtual_container(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -866,7 +868,7 @@ def test_read_object_in_virtual_container(self): 'Not objectType found which is required.') def test_read_object_with_wrong_version(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '4.x.x1', @@ -879,7 +881,7 @@ def test_read_object_with_wrong_version(self): conn.close() def test_read_non_exist_object(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -892,7 +894,7 @@ def test_read_non_exist_object(self): self.assertEqual(res.status, 404, 'Object read should have failed') def test_read_non_exist_object_in_virtual_container(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -904,7 +906,7 @@ def test_read_non_exist_object_in_virtual_container(self): self.assertEqual(res.status, 404, 'Object read should have failed') def test_update_object(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -921,7 +923,7 @@ def test_update_object(self): self.assertIn(res.status, [201, 202, 204], 'Object update failed') def test_update_object_in_virtual_container(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -936,7 +938,7 @@ def test_update_object_in_virtual_container(self): self.assertIn(res.status, [201, 202, 204], 'Object update failed') def test_delete_object(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} @@ -947,7 +949,7 @@ def test_delete_object(self): self.assertEqual(res.status, 204, 'object deletion failed') def test_delete_object_in_virtual_container(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} @@ -957,7 +959,7 @@ def test_delete_object_in_virtual_container(self): self.assertEqual(res.status, 204, 'object deletion failed') def test_delete_object_non_cdmi(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('DELETE', (self.access_root + '/' + self.top_container + @@ -967,7 +969,7 @@ def test_delete_object_non_cdmi(self): self.assertEqual(res.status, 204, 'object deletion failed') def test_delete_non_exist_object(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} @@ -979,7 +981,7 @@ def test_delete_non_exist_object(self): self.assertEqual(res.status, 404, 'object deletion should have failed') def test_delete_non_exist_object_non_cdmi(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token} conn.request('DELETE', (self.access_root + '/' + self.top_container + @@ -990,12 +992,15 @@ def test_delete_non_exist_object_non_cdmi(self): self.assertEqual(res.status, 404, 'object deletion should have failed') def test_object_capability_with_header(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', 'Accept': 'application/cdmi-capability'} - conn.request('GET', (self.cdmi_capability_root + '/dataobject/'), + conn.request('GET', (self.access_root + '/' + + self.top_container + + '/' + self.child_container + + '/' + self.object_test), None, headers) res = conn.getresponse() self.assertEqual(res.status, 200, 'Object capability read failed') @@ -1015,12 +1020,19 @@ def test_object_capability_with_header(self): 'objectType should be application/cdmi-capability.') def test_object_capability_with_prefix_no_header(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} - conn.request('GET', (self.cdmi_capability_root + - '/dataobject'), None, headers) + print (self.cdmi_capability_root +'/' + + self.top_container + + '/' + self.child_container + + '/' + self.object_test) + conn.request('GET', (self.cdmi_capability_root +'/' + + self.top_container + + '/' + self.child_container + + '/' + self.object_test), + None, headers) res = conn.getresponse() self.assertEqual(res.status, 200, 'Object capability read failed') data = res.read() @@ -1040,7 +1052,7 @@ def test_object_capability_with_prefix_no_header(self): 'objectType should be application/cdmi-capability.') def test_non_exist_object_capability(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', @@ -1054,7 +1066,7 @@ def test_non_exist_object_capability(self): 'Object capability read should have failed') def test_non_exist_object_capability_with_prefix(self): - conn = httplib.HTTPConnection('localhost', + conn = httplib.HTTPConnection(SWIFT_HOST, self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} diff --git a/test/functional/cdmi/test_utils.py b/test/functional/cdmi/test_utils.py index ae52856..cae6135 100755 --- a/test/functional/cdmi/test_utils.py +++ b/test/functional/cdmi/test_utils.py @@ -1,4 +1,5 @@ # Copyright (c) 2010-2011 IBM. +# Copyright (c) 2012 Intel Performance Learning Solutions Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 9f94a302197b538d13e91875afda5585490219da Mon Sep 17 00:00:00 2001 From: tmetsch Date: Tue, 4 Dec 2012 14:25:46 +0100 Subject: [PATCH 03/10] fixed some unittests --- test/functional/cdmi/test_cdmi_object.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/functional/cdmi/test_cdmi_object.py b/test/functional/cdmi/test_cdmi_object.py index a68ed2c..ac91238 100755 --- a/test/functional/cdmi/test_cdmi_object.py +++ b/test/functional/cdmi/test_cdmi_object.py @@ -54,9 +54,9 @@ def setUp(self): self.os_access_root = '/v1/' + self.account_id self.access_root = ('/' + self.conf.get('cdmi_root', 'cdmi') + '/' + self.account_id) - self.cdmi_capability_root = ('/' + - self.conf.get('cdmi_capability_id', - 'cdmi_capabilities') + + self.cdmi_capability_root = ('/' + self.conf.get('cdmi_root', + 'cdmi') + + '/cdmi_capabilities' + '/' + self.account_id) #Setup two container names @@ -1024,14 +1024,10 @@ def test_object_capability_with_prefix_no_header(self): self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} - print (self.cdmi_capability_root +'/' + - self.top_container + - '/' + self.child_container + - '/' + self.object_test) conn.request('GET', (self.cdmi_capability_root +'/' + self.top_container + '/' + self.child_container + - '/' + self.object_test), + '/' + self.object_test + '/'), None, headers) res = conn.getresponse() self.assertEqual(res.status, 200, 'Object capability read failed') From 77e048a930613a6a319b777d2a591abe780e837a Mon Sep 17 00:00:00 2001 From: tmetsch Date: Tue, 4 Dec 2012 14:34:21 +0100 Subject: [PATCH 04/10] fixed some unittests --- test/functional/cdmi/test_cdmi_container.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/test/functional/cdmi/test_cdmi_container.py b/test/functional/cdmi/test_cdmi_container.py index 5709399..0fd384e 100755 --- a/test/functional/cdmi/test_cdmi_container.py +++ b/test/functional/cdmi/test_cdmi_container.py @@ -48,12 +48,10 @@ def setUp(self): self.os_access_root = '/v1/' + self.account_id self.access_root = ('/' + self.conf.get('cdmi_root', 'cdmi') + '/' + self.account_id) - self.cdmi_capability_root = ('/' + - self.conf.get('cdmi_root', 'cdmi') + - '/' + - self.account_id + '/' + - self.conf.get('cdmi_capability_id', - 'cdmi_capabilities')) + self.cdmi_capability_root = ('/' + self.conf.get('cdmi_root', + 'cdmi') + + '/cdmi_capabilities' + + '/' + self.account_id) #Setup two container names suffix = format(time.time(), '.6f') @@ -577,8 +575,7 @@ def test_child_container_capability_with_prefix(self): self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} - print self.cdmi_capability_root + '/container/' - conn.request('GET', (self.cdmi_capability_root + '/container/'), + conn.request('GET', (self.cdmi_capability_root + self.top_container), None, headers) res = conn.getresponse() self.assertEqual(res.status, 200, "Container capability read failed") @@ -604,7 +601,7 @@ def test_child_virtual_container_capability(self): headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', 'Accept': 'application/cdmi-capability'} - conn.request('GET', (self.cdmi_capability_root + '/container'), + conn.request('GET', (self.cdmi_capability_root + self.top_container), None, headers) res = conn.getresponse() self.assertEqual(res.status, 200, "Container capability read failed") @@ -644,7 +641,7 @@ def test_top_container_capability_with_header_prefix(self): headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', 'Accept': 'application/cdmi-capability'} - conn.request('GET', (self.cdmi_capability_root + '/container'), + conn.request('GET', (self.cdmi_capability_root + self.top_container), None, headers) res = conn.getresponse() self.assertEqual(res.status, 200, "Container capability read failed") From 2180a3f203f3fed413acfc64ed92b327d3b2d4e2 Mon Sep 17 00:00:00 2001 From: tmetsch Date: Tue, 4 Dec 2012 14:37:13 +0100 Subject: [PATCH 05/10] fixed some unittests --- test/functional/cdmi/test_cdmi_container.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/functional/cdmi/test_cdmi_container.py b/test/functional/cdmi/test_cdmi_container.py index 0fd384e..ed88c3b 100755 --- a/test/functional/cdmi/test_cdmi_container.py +++ b/test/functional/cdmi/test_cdmi_container.py @@ -585,6 +585,7 @@ def test_child_container_capability_with_prefix(self): except Exception as parsing_error: raise parsing_error conn.close() + print body self.assertIsNotNone(body['capabilities'], 'No capabilities found') self.assertIsNotNone(body['parentURI'], From e8ddac2cd9fead66f0ced9ee48046bdebc8becb6 Mon Sep 17 00:00:00 2001 From: tmetsch Date: Tue, 4 Dec 2012 14:38:33 +0100 Subject: [PATCH 06/10] fixed some unittests --- test/functional/cdmi/test_cdmi_container.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/functional/cdmi/test_cdmi_container.py b/test/functional/cdmi/test_cdmi_container.py index ed88c3b..bb5038f 100755 --- a/test/functional/cdmi/test_cdmi_container.py +++ b/test/functional/cdmi/test_cdmi_container.py @@ -575,7 +575,9 @@ def test_child_container_capability_with_prefix(self): self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1'} - conn.request('GET', (self.cdmi_capability_root + self.top_container), + conn.request('GET', (self.cdmi_capability_root + '/' + + self.top_container + '/' + + self.child_container), None, headers) res = conn.getresponse() self.assertEqual(res.status, 200, "Container capability read failed") From 5f2b2aeda3f4d356521f75b91cca3ec4c1dd05dc Mon Sep 17 00:00:00 2001 From: tmetsch Date: Tue, 4 Dec 2012 14:39:35 +0100 Subject: [PATCH 07/10] fixed some unittests --- test/functional/cdmi/test_cdmi_container.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/functional/cdmi/test_cdmi_container.py b/test/functional/cdmi/test_cdmi_container.py index bb5038f..d811f94 100755 --- a/test/functional/cdmi/test_cdmi_container.py +++ b/test/functional/cdmi/test_cdmi_container.py @@ -604,7 +604,9 @@ def test_child_virtual_container_capability(self): headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', 'Accept': 'application/cdmi-capability'} - conn.request('GET', (self.cdmi_capability_root + self.top_container), + conn.request('GET', (self.cdmi_capability_root + '/' + + self.top_container + '/' + + self.child_container), None, headers) res = conn.getresponse() self.assertEqual(res.status, 200, "Container capability read failed") @@ -643,8 +645,9 @@ def test_top_container_capability_with_header_prefix(self): self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', - 'Accept': 'application/cdmi-capability'} - conn.request('GET', (self.cdmi_capability_root + self.top_container), + conn.request('GET', (self.cdmi_capability_root + '/' + + self.top_container + '/' + + self.child_container), None, headers) res = conn.getresponse() self.assertEqual(res.status, 200, "Container capability read failed") From 647a9e32156f014c8bf76e051124e0d786df89e9 Mon Sep 17 00:00:00 2001 From: tmetsch Date: Tue, 4 Dec 2012 14:40:24 +0100 Subject: [PATCH 08/10] fixed some unittests --- test/functional/cdmi/test_cdmi_container.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/functional/cdmi/test_cdmi_container.py b/test/functional/cdmi/test_cdmi_container.py index d811f94..5d46658 100755 --- a/test/functional/cdmi/test_cdmi_container.py +++ b/test/functional/cdmi/test_cdmi_container.py @@ -645,6 +645,7 @@ def test_top_container_capability_with_header_prefix(self): self.conf.get('access_port')) headers = {'X-Auth-Token': self.auth_token, 'X-CDMI-Specification-Version': '1.0.1', + 'Accept': 'application/cdmi-capability'} conn.request('GET', (self.cdmi_capability_root + '/' + self.top_container + '/' + self.child_container), From 1b20d992d3ab21e9778abc34800b6d912f7396a2 Mon Sep 17 00:00:00 2001 From: tmetsch Date: Tue, 4 Dec 2012 14:42:38 +0100 Subject: [PATCH 09/10] fixed some unittests --- test/functional/cdmi/test_cdmi_container.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/cdmi/test_cdmi_container.py b/test/functional/cdmi/test_cdmi_container.py index 5d46658..7e8a251 100755 --- a/test/functional/cdmi/test_cdmi_container.py +++ b/test/functional/cdmi/test_cdmi_container.py @@ -587,7 +587,6 @@ def test_child_container_capability_with_prefix(self): except Exception as parsing_error: raise parsing_error conn.close() - print body self.assertIsNotNone(body['capabilities'], 'No capabilities found') self.assertIsNotNone(body['parentURI'], @@ -683,6 +682,7 @@ def test_system_capability(self): except Exception as parsing_error: raise parsing_error conn.close() + print body self.assertIsNotNone(body['capabilities'], 'No capabilities found') self.assertIsNotNone(body['parentURI'], From 1370c1bf182943f7f31c4034f6592462cb177008 Mon Sep 17 00:00:00 2001 From: tmetsch Date: Tue, 4 Dec 2012 14:47:25 +0100 Subject: [PATCH 10/10] fixed some unittests --- test/functional/cdmi/test_cdmi_container.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/cdmi/test_cdmi_container.py b/test/functional/cdmi/test_cdmi_container.py index 7e8a251..7b63d42 100755 --- a/test/functional/cdmi/test_cdmi_container.py +++ b/test/functional/cdmi/test_cdmi_container.py @@ -682,11 +682,11 @@ def test_system_capability(self): except Exception as parsing_error: raise parsing_error conn.close() - print body self.assertIsNotNone(body['capabilities'], 'No capabilities found') - self.assertIsNotNone(body['parentURI'], - 'No parentURI found which is required.') + # TODO: why should top have parent URI? + #self.assertIsNotNone(body['parentURI'], + # 'No parentURI found which is required.') self.assertIsNotNone(body['objectName'], 'No objectName found which is required.') self.assertIsNot(body['objectType'],