Merge "swift-dsvm: Enable more middlewares"

This commit is contained in:
Zuul 2020-05-06 19:37:13 +00:00 committed by Gerrit Code Review
commit a792255e79
5 changed files with 69 additions and 6 deletions

View File

@ -0,0 +1,54 @@
- name: Add more middlewares to pipeline
replace:
path: "/etc/swift/proxy-server.conf"
regexp: "cache listing_formats"
replace: "cache domain_remap etag-quoter listing_formats"
become: true
- name: Set domain_remap domain
ini_file:
path: /etc/swift/proxy-server.conf
section: filter:domain_remap
option: storage_domain
value: example.com
become: true
- name: Set storage_domain in test.conf
ini_file:
path: /etc/swift/test.conf
section: func_test
option: storage_domain
value: example.com
become: true
- name: Enable object versioning
ini_file:
path: /etc/swift/proxy-server.conf
section: filter:versioned_writes
option: allow_object_versioning
value: true
become: true
- name: Copy ring for Policy-1
copy:
remote_src: true
src: /etc/swift/object.ring.gz
dest: /etc/swift/object-1.ring.gz
become: true
- name: Add Policy-1 to swift.conf
ini_file:
path: /etc/swift/swift.conf
section: storage-policy:1
option: name
value: Policy-1
become: true
- name: Restart service to pick up config changes
command: systemctl restart devstack@s-{{ item }}.service
become: true
with_items:
- proxy
- account
- container
- object

View File

@ -1121,10 +1121,15 @@ def get_url_token(user_index, os_options):
auth_version=swift_test_auth_version, auth_version=swift_test_auth_version,
os_options=os_options, os_options=os_options,
insecure=insecure) insecure=insecure)
return get_auth(swift_test_auth, url, token = get_auth(swift_test_auth,
swift_test_user[user_index], swift_test_user[user_index],
swift_test_key[user_index], swift_test_key[user_index],
**authargs) **authargs)
if six.PY2 and not isinstance(url, bytes):
url = url.encode('utf-8')
if six.PY2 and not isinstance(token, bytes):
token = token.encode('utf-8')
return url, token
def retry(func, *args, **kwargs): def retry(func, *args, **kwargs):

View File

@ -225,6 +225,9 @@ class Connection(object):
@storage_url.setter @storage_url.setter
def storage_url(self, value): def storage_url(self, value):
if six.PY2 and not isinstance(value, bytes):
value = value.encode('utf-8')
url = urllib.parse.urlparse(value) url = urllib.parse.urlparse(value)
if url.scheme == 'http': if url.scheme == 'http':

View File

@ -293,7 +293,7 @@ class TestObjectVersioning(TestObjectVersioningBase):
# swift_test_client's File API doesn't really allow for POSTing # swift_test_client's File API doesn't really allow for POSTing
# arbitrary headers, so... # arbitrary headers, so...
def put(url, token, parsed, conn): def post(url, token, parsed, conn):
conn.request('POST', '%s/%s/%s' % (parsed.path, container, conn.request('POST', '%s/%s/%s' % (parsed.path, container,
versioned_obj2.name), versioned_obj2.name),
'', {'X-Auth-Token': token, '', {'X-Auth-Token': token,
@ -301,7 +301,7 @@ class TestObjectVersioning(TestObjectVersioningBase):
'X-Object-Meta-Color': 'red', 'X-Object-Meta-Color': 'red',
'X-Delete-After': '1'}) 'X-Delete-After': '1'})
return tf.check_response(conn) return tf.check_response(conn)
resp = tf.retry(put) resp = tf.retry(post)
resp.read() resp.read()
self.assertEqual(resp.status, 202) self.assertEqual(resp.status, 202)

View File

@ -7,3 +7,4 @@
bindep_dir: "{{ zuul_work_dir }}" bindep_dir: "{{ zuul_work_dir }}"
- test-setup - test-setup
- ensure-tox - ensure-tox
- dsvm-additional-middlewares