If the exclusive lock feature is enabled, all locks need
to be removed prior removing the image.
Fixes: #10990
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Handle the case that kernel does not support fcntl.F_OFD_SETLK.
Also fix the code that checks if fnctl fails with errno == EINTR.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
The rbd CLI now utilizes the rbd_default_format configuration
setting, therefore the copy test now needs to tell rbd which image
format it is expecting to create.
Fixes: #10961
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Instead of the http://github.com/dachary namespace. It is not an issue
in the common case because it should be cloned because it is in the
.gitmodules file with the proper namespace.
http://tracker.ceph.com/issues/10836Fixes: #10836
Signed-off-by: Loic Dachary <ldachary@redhat.com>
We're seeing the lsof invocation fail (as not found) in testing and nobody can
identify why. Since attempting to reproduce the issue has not worked, this
patch will gather data from a genuinely in-vitro location.
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
The test was removed in 1189138 (mon: make ceph tell mon.* version
work) as it began to fail due to #10439. After it fixed in c4548f6
(pybind: ceph_argparse: validate incorrectly formed targets), the test
can be restored.
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
* Use set -e to detect errors
* no need to retry cleanup in a loop now that rbd-fuse closes images
* use --no-progress for long-running operations
* add output at the start of each test
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
Until the kernel supports RBD exclusive locking, this test
has been updated to create shared images (exclusive locking
disabled).
Fixes: #10613
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
This is because running fs/misc on a kclient
should not include quota (quota not supported
on kernel client).
Fixes: #10579
Signed-off-by: John Spray <john.spray@redhat.com>
Automatic locking hides the ESHUTDOWN from the caller, which is how
this test detects that blacklisting works.
Fixes: #10592
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
* nodelete - pool can't be deleted
* nopgchange - pool's pg and pgp num can't be changed
* nosizechange - pool's size and min size can't be changed
This is intended to help some poor admin to avoid a very bad day.
Fixes: #9792 (but in a different way than it was proposed there)
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
undersized not valid: undersized not in inactive|unclean|stale
undersized not valid: undersized doesn't represent an int
Invalid command: unused arguments: ['undersized']
pg dump_stuck {inactive|unclean|stale [inactive|unclean|stale...]} {<int>} : show information about stuck pgs
Signed-off-by: xinxin shu <xinxin.shu@intel.com>
These can happen with split or with state changes due to reordering
results within the hash range requested. It's easy enough to filter
them out at this stage.
Backport: giant, firefly
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
Because fs reset opens a brief window for the previously
failed MDSs to spring back into life.
Fixes: #10539
Signed-off-by: John Spray <john.spray@redhat.com>
Previously was set in hashbang, which meant
that "./quota.sh" was OK, but "sh ./quota.sh" would
just run through ignoring errors.
Signed-off-by: John Spray <john.spray@redhat.com>
The tiobench software has been abandoned upstream for years. Fedora and
Debian are no longer shipping the tiobench package, so we've had to
carry the package ourselves in the Ceph project, and we're trying to
slim down our dependencies where it makes sense to do so.
Nuke the tiobench suite.
http://tracker.ceph.com/issues/10152 Refs: #10152
Signed-off-by: Ken Dreyer <kdreyer@redhat.com>
This is like a temporary measure as the mon will try to set them again,
but we have run into cases where the mon was misbehaving (failing to clear
the flag) and we wanted to do it. Note that the mon will likely set it
again on the next tick() anyway.
If we're going to clear it, we may as well be able to set it, too (again,
even if the mon is going to clear it soon). If nothing else this is useful
for writing tests.
Fixes: #9323
Signed-off-by: Sage Weil <sage@redhat.com>
This was missing from 17b5fc9a but we didn't notice
because the test wasn't being run by the gitbuilders.
Signed-off-by: John Spray <john.spray@redhat.com>
Using the array notation to list test is error prone and more
complicated to write.
It also fixes a bug : only the first test of each series (MON, OSD, MDS)
was run and the others were ignored.
Signed-off-by: Loic Dachary <loic@dachary.org>
This was an overly-strict check. In fact it is perfectly
fine to set an overlay on a pool that is already in use
as a filesystem data or metadata pool.
Fixes: #10135
Signed-off-by: John Spray <john.spray@redhat.com>
If CEPH_CLI_TEST_DUP_COMMAND is set when ceph osd create is called, it
will create two osd. They must be cleaned up afterwards instead of
assuming only one is going to be created.
http://tracker.ceph.com/issues/10083Fixes: #10083
Signed-off-by: Loic Dachary <ldachary@redhat.com>
The local filesytem may behave slightly differently. This isn't
foolproof, but seems to be reliable enough on rhel7 rootfs, where
exact comparison was failing.
Fixes: #10002
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
Clone the archive of encoded objects and decode all archived objects, up
to and including the current ceph version.
http://tracker.ceph.com/issues/9420 Refs: #9420
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Update bench.sh/plot tool to cover ISA backend.
ISA will output a fake echinique 'cauchy_good' so the plot tool
don't need to be changed.
Signed-off-by: Yuan Zhou <yuan.zhou@intel.com>
For testing injectargs a configuration option was changed that has side
effects on the cluster. It could introduce random failures later. It is
replaced with a configuration option that cannot have adverse side
effects on the cluster.
http://tracker.ceph.com/issues/9919Fixes: #9919
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
It is incorrect to append the content of CEPH_ARGS to the argument list
when running injectargs. For instance if
CEPH_ARGS='--log-file the.log' \
./ceph tell osd.0 injectargs --no-osd_debug_op_order
translates into
./ceph tell osd.0 injectargs --no-osd_debug_op_order \
--log-file the.log
it ends up changing the log file of osd.0 which is probably unintended.
Instead CEPH_ARGS is inserted before injectargs and it translates into:
./ceph tell osd.0 --log-file the.log \
injectargs --no-osd_debug_op_order
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
The arguments of injectargs being valid ceph arguments, they are.
consumed when the ceph cli calls rados.conf_parse_argv(). It can be
worked around by obsuring them as in:
ceph tell osd.0 injectargs '--osd_debug_drop_ping_probability 444'
where '--osd_debug_drop_ping_probability 444' is a single argument that
does not match any known argument. The trick is that it will be
evaluated again once it reaches the OSD or the MON and translated into
the expected list of arguments. Although it is clear once explained, it
is obscure and leads to strange combinations such as:
ceph tell osd.0 injectargs '--osd_debug_op_order '
(note the extra space at the end) to set boolean parameters. A better
workaround is to add a -- marking the end of the options as in:
ceph tell osd.0 -- injectargs --osd_debug_op_order
this one is unfortunately much less documented and the user does not
usually know the exact semantic of --, let alone where it should be
placed.
The simpler solution is to split the argument list in two if
"injectargs" is found. The arguments that show after the "injectargs"
argument is removed from the list of arguments until parsing is
complete. It implements the more intuitive syntax:
ceph tell osd.0 injectargs --osd_debug_op_order
and the other forms are still valid for backward compatibility.
http://tracker.ceph.com/issues/9372Fixes: #9372
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Suites run with CEPH_TEST_CLI_DUP_COMMAND=1, which will send a duplicate
command for every command issued with the 'ceph' tool. Behavior is to
get a reply from the command and then send a duplicate, looking for the
same outcome (guaranteeing idempotency of the operations). However, it
so happens that if you remove the entity's own key from the keyring and
you happen to be unlucky enough so that the client's connection gets
failed (we also run tests with connection failure injections), the
'ceph' tool won't be able to reconnect to the cluster to send the
duplicate command (as it's entity no longer exists in the cluster's
keyring).
We rewrite the test instead of resorting to ugly hacks to work around
this behavior, simply having a new 'role-definer' added by the existing
'role-definer' (which we weren't testing anyway, so bonus points for
that) and then have one removing the other (to test the procedure) and
finally using 'client.admin' to remove the last 'role-definer'.
Fixes: #9820
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
Wip client flock
Add support for file locking to the userspace client, and improve blocked-lock cancellation so that it doesn't remove locks that succeeded when racing.
Reviewed-by: Greg Farnum <greg@inktank.com>
Assuming they are more likely than others to leave OSD/MON in an
unstable state that could have undefined side effects on the tests
following it. A cleaner solution would be to run them in a separate
script that is run on an independent cluster.
http://tracker.ceph.com/issues/9700Fixes: #9700
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
We added MDS resetting code here a while back,
but the order of operations was such that a
"cluster up" was being run between a fail_all_mds
and the point at which we needed the map not to
be interfered with (testing setmap).
Also the new fs create/destroy cycles for testing
EC pool handling were missing calls to stop the
daemons before fs rm.
Signed-off-by: John Spray <john.spray@redhat.com>
It is expected for ceph tell to fail with ENXIO if the daemon it is
trying to join is not ready for some reason. This should be handled as a
transient error instead of a fatal error.
Add two shell functions to help with retry. They may prove useful if
other cases requiring a few retries show up.
http://tracker.ceph.com/issues/9655Fixes: #9655
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
test creating and entity with blank caps with and without '--force'
being specified. without '--force' they must fail with EINVAL as the
monitor will not be able to parse them.
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
We have variables with the same name that are being shared! We don't
hit any issues with it currently because the code just kind of works
even though that happens. Add a bit of new logic that relies on an
immutable return code (for instance) and we're in the woods.
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
expect_false does not extend past the pipe and fails because the command
succeeds
introduced in f05c977bbc
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Keep the osd trash test to ensure it is a valid command but make it a
noop by giving it a zero argument (meaning thrash 0 OSD maps).
Remove the loops that were added after the command in an attempt to wait
for the cluster to recover and not pollute the rest of the tests. Actual
testing of osd thrash would require a dedicated cluster because it the
side effects are random and it is unnecessarily difficult to ensure they
are finished.
http://tracker.ceph.com/issues/9620Fixes: #9620
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
ceph --format plain osd find 1 (and metadata) are not implemented and
must fallback to the default (json-pretty).
http://tracker.ceph.com/issues/9538Fixes: #9538
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Add a trivial osd health test at the beginning of each group of
tests. When facing an intermittent failure, it is difficult to diagnose
if the cluster appears to be missing an OSD but there is no indication
as to when the OSDs were last up.
The tests are now only run after all OSDs are up.
These checks can be disabled with --no-sanity-check to allow running
some tests that have less requirements than running all the tests.
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
From the bash man page:
set -e exit immediately ... The shell does not exit ... if the
command's return value is being inverted with !
Add an explicit exit 1 where appropriate.
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
* Removing tiers from a base pool in use by CephFS is forbidden.
* Using CephFS pools as tiers is forbidden.
Signed-off-by: John Spray <john.spray@redhat.com>
Fixes two things:
* EC pools are now permissible if they have a cache overlay
* Pools are not permissible if they are a cache tier.
Fixes: #9435
Signed-off-by: John Spray <john.spray@redhat.com>
This workunit will be used by tests as a placeholder that always return
true. This is helpful in tests when a script from the qa/workunits
directory is mandatory but we do not care about testing anything. For
an example of how it can be used, check
https://github.com/ceph/ceph-qa-suite/pull/120
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Add tests to fail as soon as an unexpected condition is met in
test_mon_osd. Otherwise the actual error will be more difficult find in
the logs.
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Aside from being a bit odd to begin with, using stderr
was causing tests to fail because the output was polluted
by log output which is also on stderr.
Fixes: 9281
Signed-off-by: John Spray <john.spray@redhat.com>
The ceph_erasure_code_benchmark output is converted into a JSON series
suitable to display in HTML with the http://www.flotcharts.org/
library. A self contained copy of the HTML,JS,CSS files is included for
durability and can be used from the source tree with:
CEPH_ERASURE_CODE_BENCHMARK=src/ceph_erasure_code_benchmark \
PLUGIN_DIRECTORY=src/.libs \
qa/workunits/erasure-code/bench.sh fplot jerasure |
tee qa/workunits/erasure-code/bench.js
and display with:
firefox qa/workunits/erasure-code/bench.html
Signed-off-by: Loic Dachary <loic@dachary.org>
Expand the default suite to enumerate all cases that are relevant to the
current code base so that it is easier to consume. Namely it means
* iterating over object sizes of 4KB (what is used by default) and
1MB (what was previous benchmarked)
* grouping results in series that would make sense to plot to get the
behavior of a given technique for a series of K/M values and all
possible erasures.
Instead of specifying the iterations to run, set the size of the total
data set to be exercised and compute the iterations by dividing it by
the object size. Since the object size varies, it is impractical to
preset the number of iterations and get meaningful results.
The PARAMETERS environment variable is added to enable the caller to
inject --parameter jerasure-variant=generic, for instance.
The packets size is calculated based on the other parameters. The
options are limited when packets are small (4KB) and it would not make a
real difference to give control over it. The packet size is capped to
a maximum of 3100 bytes which is roughly what has been found to be an
optimal value for large packets (1MB).
Signed-off-by: Loic Dachary <loic@dachary.org>