ceph_volume_client.py's put_object_versioned() has only one test. Since
this only test is a negative test it may fail to assure that
put_object_versioned() works as expected with positive inputs even when
it completes successfully. Therefore, write a positive test for better
coverage.
Also, make sure the new test is both python 2 and python3 compatible.
Signed-off-by: Rishabh Dave <ridave@redhat.com>
test_put_object_versioned() is too generic for a negative test that
specifically tests if the version is verified before writing.
Signed-off-by: Rishabh Dave <ridave@redhat.com>
The test's success depends on whether CommandFailedError exception is
raised. This manner of testing is unreliable since there's no way to
check if the exception was raised by the statement (in the embedded
Python program) the test expects to.
This implies that this test's failure may go undetected. This is primary
reason why bugs like tracker #38946 occured despite of having a test.
Fixes: http://tracker.ceph.com/issues/39510
Signed-off-by: Rishabh Dave <ridave@redhat.com>
Instead of defining another method to write a file as root user in
test_volume_client.py, use the method from teuthology/misc.py.
Signed-off-by: Rishabh Dave <ridave@redhat.com>
Convert strings to bytes in the Python program embedded inside this
test. Also, in the process don't lose Python 2 compatibility.
Fixes: http://tracker.ceph.com/issues/39405
Signed-off-by: Rishabh Dave <ridave@redhat.com>
mon: Improve health status for backfill_toofull and recovery_toofull
Reviewed-by: Joao Eduardo Luis <joao@suse.de>
Reviewed-by: Neha Ojha <nojha@redhat.com>
* refs/pull/28561/head:
vstart_runner: upgrade the check for commands to be run as another user
vstart_runner: split unicode arguments into lists
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
rgw: add S3 object lock feature to support object worm
Reviewed-by: Adam C. Emerson <aemerson@redhat.com>
Reviewed-by: Casey Bodley <cbodley@redhat.com>
Rectify the condition that checks if command to be issued as another
user using sudo is issued as a single argument after "-c".
Signed-off-by: Rishabh Dave <ridave@redhat.com>
* refs/pull/28194/head:
test_volume_client: declare only one default for python version
test_volume_client: don't shadow class variable
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
cephfs binding already automatically converts paths and some arguments to
bytes.
Fixes: http://tracker.ceph.com/issues/40455
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
py3 does not have the unicode built-in. Instead, simply try to do the encoding
and catch failures appropriately. If it quacks like a duck...
(Note that cython apparently cheats and allows the unicode check but this is
simpler.)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Treat backfull_toofull as a warning condition because it can resolve itself.
Includes test case for PG_BACKFILL_FULL
Includes test case for recovery_toofull / PG_RECOVERY_FULL
Fixes: https://tracker.ceph.com/issues/39555
Signed-off-by: David Zafman <dzafman@redhat.com>
There's little reason to support this new tool with python2.
Fixes: http://tracker.ceph.com/issues/40418
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>