Merge "swift-dsvm: Enable more middlewares"
This commit is contained in:
commit
a792255e79
54
roles/dsvm-additional-middlewares/tasks/main.yaml
Normal file
54
roles/dsvm-additional-middlewares/tasks/main.yaml
Normal 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
|
@ -1121,10 +1121,15 @@ def get_url_token(user_index, os_options):
|
||||
auth_version=swift_test_auth_version,
|
||||
os_options=os_options,
|
||||
insecure=insecure)
|
||||
return get_auth(swift_test_auth,
|
||||
swift_test_user[user_index],
|
||||
swift_test_key[user_index],
|
||||
**authargs)
|
||||
url, token = get_auth(swift_test_auth,
|
||||
swift_test_user[user_index],
|
||||
swift_test_key[user_index],
|
||||
**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):
|
||||
|
@ -225,6 +225,9 @@ class Connection(object):
|
||||
|
||||
@storage_url.setter
|
||||
def storage_url(self, value):
|
||||
if six.PY2 and not isinstance(value, bytes):
|
||||
value = value.encode('utf-8')
|
||||
|
||||
url = urllib.parse.urlparse(value)
|
||||
|
||||
if url.scheme == 'http':
|
||||
|
@ -293,7 +293,7 @@ class TestObjectVersioning(TestObjectVersioningBase):
|
||||
|
||||
# swift_test_client's File API doesn't really allow for POSTing
|
||||
# arbitrary headers, so...
|
||||
def put(url, token, parsed, conn):
|
||||
def post(url, token, parsed, conn):
|
||||
conn.request('POST', '%s/%s/%s' % (parsed.path, container,
|
||||
versioned_obj2.name),
|
||||
'', {'X-Auth-Token': token,
|
||||
@ -301,7 +301,7 @@ class TestObjectVersioning(TestObjectVersioningBase):
|
||||
'X-Object-Meta-Color': 'red',
|
||||
'X-Delete-After': '1'})
|
||||
return tf.check_response(conn)
|
||||
resp = tf.retry(put)
|
||||
resp = tf.retry(post)
|
||||
resp.read()
|
||||
self.assertEqual(resp.status, 202)
|
||||
|
||||
|
@ -7,3 +7,4 @@
|
||||
bindep_dir: "{{ zuul_work_dir }}"
|
||||
- test-setup
|
||||
- ensure-tox
|
||||
- dsvm-additional-middlewares
|
||||
|
Loading…
Reference in New Issue
Block a user