You don't need to add dev_id into seen_ids again when it has already existed in seen_ids.
Fixes Bug #1311190
Change-Id: If0766de8dc5e2a59a648cae39c789c91131805d2
Previously at 87% with 20 missing 11 partial, this additional
test code brings it to 99% 0 missing and 3 partial. Noticed
some easy places to add coverage while working on the
Storage Policy branch.
Change-Id: I49b5b4db3341416fce1ef42811732c16d3265522
mock >= 1.0 changed the behavior for iterable sideeffects. Any
exceptions in an iterable side_effect will now be raised instead of
returned.
With mock < 1.0 tests are failing, because test for the
internal client (TestSimpleClient.test_get_with_retries) use an
iterable sideeffect that raise an URLError on the first request
and pass on the second request.
Change-Id: I568b68c33ff599d7a4f590e2a0eb8caeee4b4d4e
Test compares cluster info to hardcoded expected data and wasn't
sorting the two sets of things being compared leading to some
sporadic unit test failures.
Change-Id: I3ef98260a62c15d06ba8cc196196d4e90abca3f0
Use constrainst from the new "swift-constraints" section of test.conf,
fall back to those found in the response to the /info API call,
ultimately falling back to the constraints module's effective
constraints.
Change-Id: Iea01c9c4b5148faa10004a240df411cbe7336a6a
Currently, 'Container Count' was missing in data base info.
So this patch will help printing 'Container Count' also.
Change-Id: I1ca80ee79e71b086b30fd2d1ab024ea1cfb324f5
I've seen several folks recently have problems with their Swift
clusters because they had different hash prefixes on different
nodes. Let's help them out by having recon check that.
Note that MD5-equality is stronger than what we need (which is
ConfigParser-equality for a particular set of keys), but this way we
don't expose the secret hash prefix and suffix across the internal
network, just the MD5 checksum of the file containing them.
Change-Id: I3af984ee45947345891b3c596a88e3464f178cc7
On older versions of python 2.6, exceptions would be spewed to the error
log whenever a service would stop. This gets magnified by the
container-updater which seems to do it with every pass. This catches
and squelches the error.
Change-Id: I128c09c240e768e8195af1f6fe79b10d4e432471
Closes-Bug: #1306027
The only explicit use of Python threading is found in the
testFileSizeLimit test. Using eventlet seems a bit easier to follow,
accomplishing the same goal, and does not constrain us to a
multi-threaded environment.
The chunks() and timeout() module level functions are only used by one
test each, so we just move them to those tests to indicate they are not
used globally.
Change-Id: I50b9fb798fbfd1d552b3c3f90309f6b86da34853
Add test to check that only the expected keys are
reported by proxy in /info, and add comments to
raise awareness that default constraints will be
automatically published by proxy in response to /info
requests.
Change-Id: Ia5f6339b06cdc2e1dc960d1f75562a2505530202
Accessing BaseException.message spews a warning; we can get the same
information with str(err), which does not spew.
Change-Id: I67648d53d25522be074a78c44b3ce97dc27d1f07
This file is normally updated in the standard "update from
global requirements" patch, but since those contain other
changes we don't want, the setup.py file never gets updated.
This patch updates setup.py to bring it in line with the
standard global requirements way of doing things without also
updating [test-]requirements.txt
Change-Id: Id0e4f8e17dd4c714b4d2dd75985431a9e12e6a4f
Two of the default constraints, max_header_size and
max_meta_overall_size, don't get registered for the
/info response by the proxy server.
Rather than adding them individually to the proxy's
register_swift_info call, this patch proposes to
register all the constraints for /info at once
using the constraints.EFFECTIVE_CONSTRAINTS dict.
Any future additions to default constraints will
then be automatically included in /info.
Change-Id: I5c10d4c8eda90ba94745b6f89df85aafbb50f8ef
Make account, object, and container servers construct log lines using the
same utility function so they will produce identically formatted lines.
This change reorders the fields logged for the account server.
This change also adds the "additional info" field to the two servers that
didn't log that field. This makes the log lines identical across all 3
servers. If people don't like that, I can take that out. I think it makes
the documentation, parsing of the log lines, and the code a tad cleaner.
DocImpact
Change-Id: I268dc0df9dd07afa5382592a28ea37b96c6c2f44
Closes-Bug: 1280955
internal client.
Internal client uses 'chunked' transfer encoding in it's
upload_object method. If content-length is known in advance,
internal_client should allowed to use content length in the
upload_object method and not the chunked method.
Change-Id: I68d2ebde78e01fa16b7187a2f045ea20f4310722
The use of NamedTemporaryFile creates rings with permissions 0600;
however most installs probably generate the rings as root but the
swift-proxy runs as user swift.
Set the permissions on the generated ring to 0644 prior to rename so
that the swift user can read the rings.
Change-Id: Ia511931f471c5c9840012c3a75b89c1f35b1b245
Closes-Bug: #1302700
It seems that the test_connect_put_timeout() test does not always fail
when it is expected. Sometimes, not very often, the attempt to connect
succeeds, resulting in a failed test.
This might be because the fake-connection infrastructure uses a
sleep(0.1) and the test uses a connect timeout of 0.1. There might be a
case where the two values result in the exact time where the entries
happen to be added in the wrong order such that the sleep() completes
first before the connect timeout fires, where the connect completes
successfully.
Closes bug 1302781
Change-Id: Ie23e40cf294170eccdf0713e313f9a31a92f9071
Perform all the package level test setup under the setup_package
method so that we only read the configuration file on disk when
functional tests are run. This let's us "play nice" with other tests.
Change-Id: I699d664bcef6754aac4ec6877830e745b764342f
If container sync got a non-ClientException and then a ClientException
during a get/put operation, it previously would break in the error
handling.
Change-Id: Ib2fa70270f3ec870bf60d5bbb3e8f514aeeb0927
Merge the swift_testing module into the functional test module itself,
so that we can read the configuration once for all unit tests, sharing
the same constraints.
Change-Id: I9fbbfdade9adca329cd79f7d4291ba009327c842