Added new unit tests:
test_add_device_old_missing_region
test_create_ring_number_of_arguments
test_add_duplicate_devices
test_rebalance_with_seed
test_set_overload_number_of_arguments
test_main_no_arguments
test_main_single_argument
test_main_with_safe
Modified existing unit tests to create sample ring at start of test.
This change was needed to have unit tests run correctly and demonstrate
code coverage.
test_unknown
test_search_device_number_of_arguments
test_list_parts_number_of_arguments
test_set_weight_number_of_arguments
test_set_info_number_of_arguments
test_remove_device_number_of_arguments
test_set_min_part_hours_number_of_arguments
test_set_replicas_number_of_arguments
test_set_replicas_invalid_value
Updates to handled nested mocks.
Updates to handle no exception case when SystemExit is expected.
PEP8 corrections.
Moved new tests from try blocks to use of assertRaises or call to
run_srb using exp_results with specified exit codes.
Updated run_srb to accept a dictionary of expected results. Specifically,
look for 'valid_exit_codes' to test, default to (0,1).
Change-Id: I4cf3f5f055a9babba140c68a9c7ff90b9c50ea62
To minimize external library dependencies for Swift unit
tests and SAIO, PyECLib 1.1.1 introduces a native backend
'liberasurecode_rs_vand.' This patch is to migrate over
the unit tests to the new ec_type when available.
This change will work with current pyeclib requirements
(==1.0.7) and also future requirements (>=1.0.7).
When we're able to raise *our* requirements to >=1.1.1 we
should remove jerasure from the list of preferred backends.
Related SAIO doc and example config changes should be
included with that patch.
Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>
Change-Id: Idf657f0acf0479bc8158972e568a29dbc08eaf3b
test_write_builder_after_device_removal() wasn't setting a
default min_part_hours so a warnign was printed. Explicitly
adding a min_part_hours suppresses the warning
Change-Id: I6f234b72c34e066abb91f28e6eacf50e29be8842
internal_client was not reading response if response status is not 200.
So proxy server treats this as client disconnect and logs 499 in log file.
This patch fixes that by reading response if response status is greater
than or equal to 300 and in acceptable statuses.
Closes-Bug: #1364752
Change-Id: I0512a25895da583956f76031e3c5de5c970bce01
commit 71993d84e88cc1d5f7742182905cace21c7e88cb added
a new 'remove_dev' column to the
swift.common.ring.builder.rebalance return value.
This patch adds the docs for that and clean up a bit to
the variable name to be easy to read.
Change-Id: Idfd46e47b9f6894cbafc8b7701a4c7414212f79f
Add unit tests to cover all code paths in print_item_locations
function in cli/info.py.
Update comment to match what's tested for invalid/missing policy.
Update tests to verify output of print_item_locations
Corrected PEP8 compliance violations.
Change-Id: I84958cb70205ee8d7ea246826dd56201fa642da9
Update requirements to install dnspython3 on Python 3 and dnspython on
Python 2. dnspython is not compatible with Python 3, and dnspython3
is not compatible with Python 2.
Add a requirement on pbr to ensure that pbr 1.6 or newer is
installed. pbr 1.0 or newer is required to support environment
markers in requirements which are now used to select dnspython or
dnspython3 depending on the Python major version.
Note: pbr 1.0 is enough, but OpenStack global requirements asks to
use "pbr>=1.6".
Change-Id: Ie5d437cd396972d4143ffffb96ec3c289e221b08
We have some tests that exercise both the sender and receiver,
but are spread across test_ssync_sender.py and test_ssync_receiver.py.
This creates a new module test_ssync.py and moves the end-to-end tests
into there.
Change-Id: Iea3e9932734924453f7241432afda90abbc75c06
Usually, the number of characters in FORBIDDEN_CHARS are fewer than
the number of characters in the req.path - so it's better to use
smaller count for the outer loop.
Change-Id: I78b7e0ff4cae1cc90e8d29d7bddcec7fe0ba4bd4
This patch adds more unit tests to diminish missing pieces
of the coverage in the proxy_controllers_base unit test.
Change-Id: I85ba1955c681cc9d5b2a70ac31155678d2e5b6fd
This patch add some unit tests to prevent regression and to describe
validate_hash_path behavior, I found in review with
https://review.openstack.org/#/c/231864/
*bonus*
- Fix test_hash_path to use "with" syntax instead of "try/finally"
for assigning a testing value into a global variable.
Change-Id: I948999a8fb8addb9a378dbf8bee853b205aeafad
contextlib.nested() is missing completely in Python 3.
Since 2.7, we can use multiple context managers in a 'with' statement,
like so:
with thing1() as t1, thing2() as t2:
do_stuff()
Now, if we had some code that needed to nest an arbitrary number of
context managers, there's stuff we could do with contextlib.ExitStack
and such... but we don't. We only use contextlib.nested() in tests to
set up bunches of mocks without crazy-deep indentation, and all that
stuff fits perfectly into multiple-context-manager 'with' statements.
Change-Id: Id472958b007948f05dbd4c7fb8cf3ffab58e2681
Added region prefix to example commands for adding devices to ring.
Also updates description to include region prefix.
Change-Id: Ie6d6485b497cea973e37909b5b19b44946c8aa89
Follow up for change I7c57bba053711a27d3802efe6f2a0bf53483a54f
The current tests won't prevent this kind of regression in the
updaters' __init__ methods:
self.node_timeout = int(float(conf.get('node_timeout', 10)))
so this makes them a little tighter.
Change-Id: I60bd79ac392deb1e8a108357d48474dddd9028c1
The doc for these sections was missing because of an rst error - the
source is there in rst file but didn't make it into the html output.
Add doc for per_diff and max_diffs in account and container doc sections.
Also, fix a bunch of other sphinx build errors and most of the warnings.
Change-Id: If9ed2619b2f92c6c65a94f41d8819db8726d3893
It's æsthetically pleasing to display the segment description parameters
in a table (using the reStructuredText "simple" table markup) and to use
a code block (which receives syntax hightlighting in the rendered
document!) for the example JSON fragment. Also, a few very minor copy
changes are made (a comma after an introductory phrase clarifies; JSON
and ETag receieve their canonical capitalizations; the elements of the
manifest JSON aren't "files" exactly; the inclusive nature of the range
is noted for the benefit of harried readers who won't read the "Range
Specification" section later in the document).
Change-Id: I5296fc04c6fe5410ad14bba7de0a7f8ab060b126
On a full disk, a call to delete an object will fail when it tries to
write tombstones. Handling DiskFileNoSpace exception raised by
swift.common.utils.
Change-Id: I8f0cfcc4159ee154fcd3e7ca90c422aa5aadf0b3
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
Closes-Bug: 1491675
This patch add a expositive test that closing connection
(fd and socket) causes StopIteration on reader at proxy server
on PUT object case.
And then, if the connection closed and proxy detects a lack of
data length, it will result in HTTPClientDisconnected.
The only reason why I leave test_client_disconnect as current
is Bill is now working for the change at
https://review.openstack.org/#/c/236007/
Change-Id: If68f752a2b0dd6cfad4d007ca5d155e6ffb378e5
If a device with 0 weight is tried to remove, the following rebalance
does not write changes into builder file.
Scenario:
$ swift-ring-builder object.builder set_weight --id 1 0.00
$ swift-ring-builder object.builder rebalance
Wait for moving files out of the device id=1.
$ swift-ring-builder object.builder remove --id 1
$ swift-ring-builder object.builder rebalance
In fact, the device id=1 is not removed after rebalance (must be --force used).
Change-Id: Iad5a444023eae9882a3addd7f119ff4d18559ddd