6360 Commits

Author SHA1 Message Date
Jenkins
69b93dd011 Merge "Test current reclaim_age handling" 2017-01-14 00:58:12 +00:00
Thiago da Silva
a768563bd8 add swift_source to PUT request part of COPY
Change-Id: I1287c02e26f6c52831d3ffbe7b07f2c1f73a8b3c
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2017-01-13 10:51:34 -05:00
Jenkins
b90f2d7a23 Merge "Fix download resumption for new SLOs." 2017-01-13 08:30:32 +00:00
Jenkins
59425664f1 Merge "Make timestamp setting to be consistent in test loop" 2017-01-13 08:30:25 +00:00
Jenkins
5d5299d7b7 Merge "Trivial follow up to addition of last modified in container listings" 2017-01-13 07:40:01 +00:00
Alistair Coles
1a8085fc41 Test current reclaim_age handling
This is just tests to demonstrate the current behavior - and provide
context of behavioral differences/consistency in the related change.

See the related change for context.

The related change slightly modifies the outcome of the
reclaim/REPLICATE test.

The related change has no effect on the config handling.

The related change greatly simplfies the reclaim_age option
cleanup_ondisk_files plumbing tests.

Related-Change-Id: I2b9189941ac29f6e3be69f76ff1c416315270916
Co-Author: Clay Gerrard <clay.gerrard@gmail.com>

Change-Id: I5b5f90bb898a335e6336f043710a05a44e3b810f
2017-01-12 19:08:50 -08:00
Kota Tsuyuzaki
4a2adfe453 Make timestamp setting to be consistent in test loop
This is a kind of the follow-up patch
https://review.openstack.org/#/c/419579

And I'd address one more my mistake with this patch, that is
inconsistent timestamp setting between
test_GET_limit_marker_json and test_GET_limit_marker_xml

Change-Id: Ia2e0c62c6146c0d79c7de2de82fe13ec4dd98165
2017-01-12 17:44:10 -08:00
Samuel Merritt
0590d20fcc Fix download resumption for new SLOs.
SLOs created after commit 2d25fe6ad3573b2a06b6b3e5e66493d7b0c55693
have an explicit X-Object-Sysmeta-SLO-Size attribute. Fetching one of
those with a range like "bytes=100-" would crash and cause a 500. This
commit fixes the crash.

Closes-Bug: #1656147

Change-Id: I174ed98b4f01a5943af12177d6f8c3586f049778
2017-01-13 01:13:29 +00:00
Jenkins
bce1aa7394 Merge "Support last modified on listing containers" 2017-01-13 00:12:48 +00:00
Alistair Coles
dcb432b176 Trivial follow up to addition of last modified in container listings
Trivial fixes in follow up to [1]

- give container unique timestamps in listing test
- remove accidental line duplication
- add missing last modified time assertion

[1] Related-Change: Iba0503916f1481a20c59ae9136436f40183e4c5b

Change-Id: Ia1e9f292c62197f1f19e86936c8d05e6cff131be
2017-01-12 18:09:06 +00:00
Kota Tsuyuzaki
652276fea6 Support last modified on listing containers
For now, last modified timestamp is supported only on
object listing. (i.e. GET container)

For example:

GET container with json format results in like as:

[{"hash": "d41d8cd98f00b204e9800998ecf8427e", "last_modified":
"2015-06-10T04:58:23.460230", "bytes": 0, "name": "object",
"content_type": "application/octet-stream"}]

However, container listing (i.e. GET account) shows just a dict
consists of ("name", "bytes", "name") for each container.

For example:

GET accounts with json format result in like as:

[{"count": 0, "bytes": 0, "name": "container"}]

This patch is for supporting last_modified key in the container
listing results as well as object listing like as:

[{"count": 0, "bytes": 0, "name": "container", "last_modified":
"2015-06-10T04:58:23.460230"}]

This patch is changing just output for listing. The original
timestamp to show the last modified is already in container table
of account.db as a "put_timestamp" column.

Note that this patch *DOESN'T* change the put_timestamp semantics.
i.e. the last_modified timestamp will be changed only at both PUT
container and POST container.
(PUT object doesn't affect the timestamp)

Note that the tuple format of returning value from
swift.account.backend.AccountBroker.list_containers is now
(name, object_count, bytes_used, put_timestamp, 0)

* put_timestamp is added *

Original discussion was in working session at Vancouver Summit.
Etherpads are around here:

https://etherpad.openstack.org/p/liberty-swift-contributors-meetup
https://etherpad.openstack.org/p/liberty-container-listing-update

DocImpact

Change-Id: Iba0503916f1481a20c59ae9136436f40183e4c5b
2017-01-12 18:03:10 +00:00
Jenkins
7f6d316dd6 Merge "For any part, only one replica can move in a rebalance" 2017-01-11 20:34:58 +00:00
Jenkins
652ec940dc Merge "Add test for object updater user-agent header" 2017-01-11 18:58:36 +00:00
Jenkins
bcaaf725fe Merge "Update the tag for Swift tox test" 2017-01-11 18:04:46 +00:00
Jenkins
6918c7940a Merge "Removes unnecessary utf-8 encoding" 2017-01-10 03:42:05 +00:00
Jenkins
436374e66c Merge "Donagh McCabe has been reassigned to different project." 2017-01-06 18:00:26 +00:00
John Dickinson
8abe2496ac added a quote
Change-Id: I69f92aa9af160e4db2d5eb1e92545fc8ae050538
2017-01-05 10:24:09 -08:00
Jenkins
cf95a51e85 Merge "Fix flaky expirer probe test" 2017-01-04 23:15:43 +00:00
Clay Gerrard
0fd7257fc8 Fix flaky expirer probe test
This does not address the underlying lp bug #1652323 with ssync that
makes ssync inconsistent with expired objects.

Change-Id: Ia12dc27a12418637587c57ff4f5744d00c661691
Related-Bug: #1652323
Closes-Bug: #1653836
2017-01-04 12:54:14 -08:00
kellerbr
aa17ae1b04 Allow Hacking H401, H403 check
Currently swift ignores a lot of the Hacking style guide. This patch
enables the H401 and H403 checks and fixes any violations. With this
we can get a little closer to following the OpenStack style guidelines.

Change-Id: I5109a052f2ceb2e6a9a174cded62f4231156d39b
2017-01-04 17:23:46 +00:00
donagh-mccabe
dc0a592411 Donagh McCabe has been reassigned to different project.
Change-Id: I8a55b2a2b0dc55c865a361783f516a04b06f6bfa
2017-01-04 15:07:12 +00:00
Luong Anh Tuan
cbb99f97b0 Replace six iteration methods with standard ones
1.As mentioned in [1], we should avoid using six.iterXXX
to achieve iterators. We can use dict.XXX instead, as it will
return iterators in PY3 as well.

2.In py2, the performance about list should be negligible,
see the link [2].

[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: I35b6c00d6ce7c6dd535932c97c071ae4d5f503e3
2016-12-25 12:43:27 +00:00
Jenkins
517083e999 Merge "Fix stats calculation in object-reconstructor" 2016-12-23 03:06:31 +00:00
Cao Xuan Hoang
a67bb2e249 Removes unnecessary utf-8 encoding
The following file(s) added utf-8 encoding but never used. So we can
remove them at all.

test/functional/test_access_control.py
test/unit/common/middleware/crypto/test_keymaster.py
test/unit/obj/test_diskfile.py

Change-Id: I00adc968872ebe9f9c0619a4e393e048c7c1a91e
2016-12-22 10:49:56 +07:00
Jenkins
09fa9dddd7 Merge "Remove duplicate setup code from test_tempurl.py" 2016-12-21 01:56:47 +00:00
Jenkins
28d25938c2 Merge "Make tempurl functional tests clean up account keys" 2016-12-20 21:06:25 +00:00
Alistair Coles
9f30c5d31e Make tempurl functional tests clean up account keys
Addresses a TODO in test/functional/test_account.py where
an account metadata test was having to clean up tempurl keys
in the account metadata that were left by another test in
a different module. This cleanup is necessary because tests
in test_account.py fail if there is any pre-existing
account metadata.

This patch:

* makes the tempurl tests clean up their keys from account
  metadata.

* makes the test_account.py:TestAccount class remove any
  pre-existing metadata before attempting any tests and
  replacing that metadata when all the tests in that class
  have completed. This is more robust than the existing code
  which only removes any tempurl keys that might be in the
  account - now you could have x-account-meta-foo = bar in
  the test account and test_account.py will still pass.

* consolidates some common setup code currently repeated for
  many of the functional test classes into into a BaseEnv class.

Change-Id: I874a9e23dfcdd1caa934945b46089f11b9f6de65
2016-12-20 10:45:59 -08:00
Andreas Jaeger
a0345cb287 Move bandit to pep8
The bandit gate is passing, let's make it voting.

Since bandit is a security linter, add it to the linter target - called
pep8 - and run it there. This will save the CI systems spawning an extra
test machine for this.

Needed-By: I90e5401ee8e46a2a153adb62d0f99a8a88a686b8
Change-Id: I75eeefa2441466da60b9b206769a2e64e9c1e7a9
2016-12-20 07:30:43 +00:00
Jenkins
94c6b9e46b Merge "Raise ValueError if a config section does not exist" 2016-12-19 07:30:59 +00:00
Christian Hugo
ffd5194a3b Raise ValueError if a config section does not exist
Instead of printing the error message and
calling sys.exit() when a section not exists
or reading the file failed rais an Exception
from readconfig. Depending on the Value or IO-Error,
the caller can decide if he wants to exit or continue.
If an Exception reaches the wsgi utilities
it bubbles all the way up.

Change-Id: Ieb444f8c34e37f49bea21c3caf1c6c2d7bee5fb4
Closes-Bug: 1578321
2016-12-15 19:49:57 +00:00
John Dickinson
462f91b040 Swift 2.12.0 authors/changelog updates
Change-Id: I7f6613a7e964d9d867bf61e20a2afcf673cc1d45
2016-12-14 12:50:51 -08:00
Alistair Coles
b9f796b8a2 Remove duplicate setup code from test_tempurl.py
TestTempURLPrefix.setUp() almost duplicates the superclass
setUp method, except it set "expires" as an instance variable.
The duplicated setUp code can be removed by simply having the
super class setUp set the "expires" instance variable.

Change-Id: Icf7604460e475523e156daa8c578765336820c8e
2016-12-14 12:22:25 +00:00
tone-zhang
d58064c207 Update the tag for Swift tox test
Change default py3x to py35 in tox.ini to support python3.5,
and fix the error when run tox test for Swfit.

Closes-Bug: #1649773

Change-Id: I8e26183ffe270518503da8b5aa394e99ae4cd8c6
2016-12-14 07:15:48 +00:00
Jenkins
c0640f8710 Merge "SLO: Make etag and size_bytes fully optional" 2016-12-13 23:02:27 +00:00
Jenkins
22c7a1f48b Merge "Py3: Make test_manager py3 compatable" 2016-12-13 16:20:51 +00:00
Kota Tsuyuzaki
b09360d447 Fix stats calculation in object-reconstructor
This patch fixes the object-reconstructor to calculate device_count
as the total number of local devices in all policies. Previously
Swift counts it for each policy but reconstruction_device_count
which means the number of devices actually swift needs to reconstruct
is counted as sum of ones for all polices.

With this patch, Swift will gather all local devices for all policies
at first, and then, collect parts for each devices as well as current.
To do so, we can see the statuses for remaining job/disks percentage via
stats_line output.

To enable this change, this patch also touchs the object replicator
to get a DiskFileManager via the DiskFileRouter class so that
DiskFileManager instances are policy specific. Currently the same
replication policy DiskFileManager class is always used, but this
change future proofs the replicator for possible other DiskFileManager
implementations.

The change also gives the ObjectReplicator a _df_router variable,
making it consistent with the ObjectReconstructor, and allowing a
common way for ssync.Sender to access DiskFileManager instances via
it's daemon's _df_router instance.

Also, remove the use of FakeReplicator from the ssync test suite. It
was not necessary and risked masking divergence between ssync and the
replicator and reconstructor daemon implementations.

Co-Author: Alistair Coles <alistair.coles@hpe.com>

Closes-Bug: #1488608
Change-Id: Ic7a4c932b59158d21a5fb4de9ed3ed57f249d068
2016-12-12 21:26:54 -08:00
Jenkins
54d1e1bae8 Merge "tempurls with a prefix-based scope" 2016-12-13 01:58:16 +00:00
Tim Burke
7fb102dc5d SLO: Make etag and size_bytes fully optional
Previously, we still required that clients send "etag" and "size_bytes"
keys in their segment definitions. This was done as a way to guard
against typos leading to an accidental lack of verification.

However, typos should already be caught when we check for extra keys. As
a result, the only truly required key is "path".

Change-Id: Ie1d8691115f8c68b5a3f3b59317cdab59f9a3fca
2016-12-12 23:14:32 +00:00
Lokesh S
84aa6558b4 Py3: Make test_manager py3 compatable
Fixes: NameError: name 'file' is not defined
file() is removed in python3.x using open()
 will solve it.
Fixes: AttributeError: 'generator' object has no
attribute 'next'
Python3 it is __next__()

Change-Id: Ib2cbdfbbedb86f6e01239d2ee991677727b0548b
2016-12-12 22:19:39 +00:00
Jenkins
e41cbd7415 Merge "Replace 'assertTrue(a not in b)' with 'assertNotIn(a, b)'" 2016-12-12 20:25:32 +00:00
Jenkins
962a17528b Merge "Add python3-dev to bindep and use py27for some envs" 2016-12-12 20:25:24 +00:00
Jenkins
3e2f516519 Merge "Rename ObjectUpdater variables in unit test to appropriate names" 2016-12-12 18:57:41 +00:00
donagh-mccabe
052ca666cb Add python3-dev to bindep and use py27for some envs
Installed my workstation with Ubuntu Xenial and then hit a few
snags running tox.

python3-dev is needed to build the python3 envs. Did not actually
test python3-devel (rpm) as I don't have such a system.

While python2.7 is the default, tox (on Xenial) itself uses
python3.5, hence 3.5 becomes the basepython and a number
of envs don't work.

Driveby, removed warning about /bin/echo in py3pep8

Change-Id: Ie880246dd757570b8e444da0e643f3c50093bdc5
2016-12-12 18:14:17 +00:00
Christopher Bartz
8333c4b36a tempurls with a prefix-based scope
The middleware now allows the usage of signatures with a prefix-based
scope. A prefix-based signature grants access to all objects which share
the same prefix. This avoids the creation of a large amount of signatures,
when a whole container or pseudofolder is shared.

Please see spec: https://review.openstack.org/#/c/199607/

Change-Id: I03b68eb74dae6196b5e63e711ef642ff7d2cfdc9
2016-12-12 12:17:12 +01:00
Cao Xuan Hoang
3da144a3af Replace 'assertTrue(a not in b)' with 'assertNotIn(a, b)'
trivialfix

Change-Id: I416831c8ad92f8445bc8d9560040a5ebf5c90702
2016-12-12 16:23:09 +07:00
Tin Lam
07d3dd7c7f Added conditional headers to HEAD request documentation
Currently, conditional headers, e.g. If-Match, If-Modified-Since, etc.,
are listed for the GET objects API call, but not in the HEAD objects
call in the api-ref documentation.  This patch adds the missing headers
to the HEAD documentation.

Change-Id: Idd1c248cc27415d148a1b9a5eb2e95f25b8c4da0
Closes-Bug: #1630212
2016-12-09 14:59:40 -06:00
Jenkins
e67a57fb17 Merge "Fixups for ghost listing fix" 2016-12-09 03:03:03 +00:00
Jenkins
d8673e452c Merge "adding unit tests for if-none-match fix" 2016-12-08 23:50:43 +00:00
Jenkins
20dffcfe35 Merge "line wrap overview_expiring_objects.rst" 2016-12-08 23:49:17 +00:00
Jenkins
458cb5db3e Merge "Use assertGreater(len(x), 0) instead of assertTrue(len(x) > 0)" 2016-12-08 21:52:23 +00:00