Commit Graph

56 Commits

Author SHA1 Message Date
Patrick Donnelly
8512bbc015
qa: simplify and use correct recovery procedure
Notably, this recovery procedure was missing scan_links.

Also, the test was oddly trying to recover the real file system in
addition to the recovery file system. I've removed that unnecessary
recovery.

Fixes: https://tracker.ceph.com/issues/57598
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2022-09-20 17:53:50 -04:00
Xiubo Li
1387fc7fa0 qa: make filesystem to be compatible with nautilus for blocklist
Old cephs, such as nautilus, will use "blacklist" instead of "blocklist".

Fixes: https://tracker.ceph.com/issues/56529
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2022-08-16 08:30:52 +08:00
Jeff Layton
5ab91d53a1 qa: remove REQUIRE_KCLIENT_REMOTE
Nothing references this variable anymore since commit 2df7caae4b (qa:
remove obsolete test).

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2021-10-19 11:07:09 -04:00
Rishabh Dave
485841b255 qa: import CommandFailedError from exceptions not run
Stop importing CommandFailedError from teuthology.orchestra.run, it is
actually defined in teuthology.exception.

Fixes: https://tracker.ceph.com/issues/51226
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-10-05 23:41:09 +05:30
Patrick Donnelly
76ac006875
Merge PR #40431 into master
* refs/pull/40431/head:
	qa/cephfs: remove create_keyring_file from cephfs_test_case.py
	qa/cephfs: don't use sudo to write files in /tmp

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
2021-04-09 20:02:27 -07:00
Rishabh Dave
511434ac5a qa/cephfs: remove create_keyring_file from cephfs_test_case.py
Since teuthology.orchestra.remote.mktemp() can write a temporary file
and not just create it, create_keyring_file() is now redundant.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-04-08 12:11:00 +05:30
Rishabh Dave
e213849581 qa/cephfs: don't use sudo to write files in /tmp
Files in /tmp cannot be written by any user( including the root user)
other than the file owner even if the permission mode on the file is
777.

Fixes: https://tracker.ceph.com/issues/49466
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-04-08 11:56:00 +05:30
Patrick Donnelly
0825d6aa9e
qa: simplify tests which stop MDS ranks
Instead of stopping MDS daemons and individually failing MDS daemons,
just fail the ranks or the entire file system, where possible.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-03-21 10:35:06 -07:00
Kefu Chai
434c1ce400
Merge pull request #39775 from rishabh-d-dave/fs-qa-accept-cmds-as-str
qa/ceph_manager: accepts commands as str too

Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2021-03-07 23:52:54 +08:00
Patrick Donnelly
13c50a9923
Merge PR #38684 into master
* refs/pull/38684/head:
	qa: add _check_scrub_status helper to simplify the code
	qa: add run_scrub helper in filesystem class
	qa: add get_scrub_status helper in filesystem class
	qa: wait the scrub task to complete
	qa: remove passed_validation check for test_damage
	qa: move wait_until_scrub_complete helper to filesystem class
	mds: simplify the C_MDS_EnqueueScrub finish code

Reviewed-by: Rishabh Dave <ridave@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2021-03-04 13:27:45 -08:00
Rishabh Dave
a1dc6b6c19 qa/ceph_manager: accepts commands as str too
Modify CephManager.run_cluster_cmd() to accept command arguments as
string as well since typing commands as strings is much lesser effort
than typing as list. This brings the interface a step closer to
teuthology.orchestra.remote.run()'s interface since it too can accept
commands arguments as string.

The change in cephfs_test_case.py is just to allow testing this PR
locally and on teuthology.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-03-04 09:42:44 +05:30
Patrick Donnelly
4e6d9e6a04
qa: delete all fs during tearDown
During the ceph task Unwind, the MDS are stopped. If any file system
still exists, we will see failover messages in the cluster log.

Fixes: https://tracker.ceph.com/issues/49510
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-02-26 09:13:21 -08:00
Venky Shankar
8334bea5a6 test: optionally create a backup filesystem on startup
Also filter out client-id's starting with "mirror" when
cleaning leftover auth-ids since teuthology would be
configured to create client.mirror and client.mirror_remote
clients before executing mirroring tests.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
2021-01-19 01:08:10 -05:00
Xiubo Li
55d7db9ed6 qa: add run_scrub helper in filesystem class
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2021-01-09 14:56:09 +08:00
Xiubo Li
b1f20a37c7 qa: move wait_until_scrub_complete helper to filesystem class
Fixes: https://tracker.ceph.com/issues/48559
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2021-01-09 14:56:09 +08:00
Patrick Donnelly
4bd9ef0965
qa: update tests concerning setting of multifs
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2020-12-14 10:42:23 -08:00
Patrick Donnelly
0e6f238ce1
Merge PR #37618 into master
* refs/pull/37618/head:
	mds: throttle cap acquisition via readdir

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2020-11-06 20:51:06 -08:00
Patrick Donnelly
2df7caae4b
qa: remove obsolete test
Since the work in [1], the kclient can be killed with network namespaces
without powercycling.

[1] https://tracker.ceph.com/issues/44044

Fixes: https://tracker.ceph.com/issues/23718
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2020-11-03 13:00:47 -08:00
Kotresh HR
c0de657d3f mds: throttle cap acquisition via readdir
A trivial "find" command on a large directory hierarchy will cause the
client to receive caps significantly faster than it will release. The
MDS will try to have the client reduce its caps below the
mds_max_caps_per_client limit but the recall throttles prevent it from
catching up to the pace of acquisition. The solution is to throttle
readdir from client. This patch does the same.

The readdir is throttled on the condition that the number of caps
acquired is greater than certain percentage of mds_max_caps_per_client
(default is 10%) and cap acquisition via readdir is certain percentage
of mds_max_caps_per_client (the default is 50%). When the above
condition is met, the readdir request is retried after
'mds_cap_acquisition_throttle_retry_request_timeout' (default is 0.5)
seconds.

Fixes: https://tracker.ceph.com/issues/47307
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2020-10-22 18:56:43 +05:30
Yan, Zheng
e76abf517b qa/cephfs: update ephemeral pin tests
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
2020-10-13 20:52:40 +08:00
Rishabh Dave
4e0f090861 qa/cephfs: backup mount object before running tests
Right now, only client IDs are stashed and restored but with the recent
changes (addition of more attributes to mount objects, specifically),
this is not enough. Saving and restoring these details before and after
tests respectively ensures that mount commands rus smoothly. Not doing
this typically leads to mount command failure for the second test in the
testsuite under execution since the client IDs are saved and restored in
CephFSTestCase.setUp and CephFSTestCase.tearDown respectively but the
rest of the details are not.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-09-11 18:04:23 +05:30
Rishabh Dave
352a41d1b3 qa/cephfs: add tests for multi-FS auth tests
Add testsuite for testing authorization on Ceph cluster with multiple
file systems and enable it to be executable with Teuthology framework.

Also add helper methods required to setup the test environment for
multi-FS tests.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-09-11 18:02:48 +05:30
Sage Weil
dfd01d7653 blacklist -> blocklist
Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Neha Ojha <nojha@redhat.com>
2020-08-24 19:53:08 +00:00
Kotresh HR
381925d219 qa: Fix traceback during fs cleanup between tests
The 'mon_allow_pool_delete' option is set to 'True'
in 'setUp' of 'TestVolumes' and is cleared of in
corresponding 'tearDown' function. Hence, any pool
deletion in parent classes such as 'CephFSTestCase'
would fail. This patch fixes the same by setting
the config 'mon_allow_pool_delete' option in the
'CephFSTestCase'.

Fixes: https://tracker.ceph.com/issues/46597
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2020-07-30 13:09:24 +05:30
Patrick Donnelly
95332d5fab
Merge PR #35038 into master
* refs/pull/35038/head:
	qa/tasks/cephfs/cephfs_test_case.py: skip cleaning the core dumps

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2020-06-30 10:36:36 -07:00
Patrick Donnelly
683153c56e
qa: fix flake8 warnings
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2020-06-24 15:43:33 -07:00
Patrick Donnelly
aef549e49e
qa: add more ephemeral pin tests
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2020-06-24 15:43:32 -07:00
Sidharth Anupkrishnan
aa99c8546b
qa: add tests for ephemeral pinning
Signed-off-by: Sidharth Anupkrishnan <sanupkri@redhat.com>
2020-06-24 15:43:32 -07:00
Patrick Donnelly
c050623065
qa: refactor _wait_subtree and _get_subtree
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2020-06-24 15:43:30 -07:00
Xiubo Li
de62c5393b qa/tasks/cephfs/cephfs_test_case.py: skip cleaning the core dumps
|/usr/libexec/abrt-hook-ccpp %s %c %p %u %g %t e %P %I %h

If the first character of this file is a pipe symbol (|), then the
remainder of the line is interpreted as the command-line for a
user-space program (or script) that is to be executed. More detail,
please see: http://man7.org/linux/man-pages/man5/core.5.html

Here will just skip cleaning the core dumps in this case.

Fixes: https://tracker.ceph.com/issues/45530
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-06-22 19:22:43 -04:00
Milind Changire
be650fe47d mds: flag backtrace scrub failures for new files as okay
New, unwritten files, fail when backtracing during scrub.
This is not necessarily bad. So flag such failures as okay and continue
with other entries.

Fixes: https://tracker.ceph.com/issues/43543
Signed-off-by: Milind Changire <mchangir@redhat.com>
2020-06-02 07:41:40 +05:30
Michael Fritch
44bcee8d1a
qa/tasks: logger.warn() -> logger.warning()
logger.warn() is the same as logger.warning(), but was removed in py3.3

Signed-off-by: Michael Fritch <mfritch@suse.com>
2020-05-13 17:18:13 -06:00
Xiubo Li
666974e0a6 qa/tasks/cephfs/cephfs_test_case: switch 'dict_keys' object to list
Fix the "TypeError: 'dict_keys' object does not support indexing" under
py3.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-24 04:04:18 -04:00
Xiubo Li
5c24d91327 qa/tasks/cephfs: add mount_wait() support to simplify the code
Mostly we should wait the mountpoint to get ready, especially for
the fuse mountpoint, sometimes it may take a few seconds to get
ready.

Fixes: https://tracker.ceph.com/issues/44044
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-14 07:47:04 -04:00
Kefu Chai
2089bf04b9 qa/tasks: use "a // b" instead of "a / b"
for expressions where the value is expected to be integer. as in
python3, `a / b` returns a float.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 20:33:47 +08:00
Kyr Shatskyy
9f6c764f10 qa/tasks/cephfs: get rid of StringIO for py3
Use io.BytesIO and six.ensure_str for py3 compatibility

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
2020-03-06 10:19:55 +01:00
Thomas Bechtold
46e22c422b qa: Enable basic mypy support for qa/ directory
A first step to do more automatic code checks on the qa/
directory. This is useful while transitioning to python3.

Also use log_exc to top-level to not run into:

error: Argument 1 to "log_exc" has incompatible type
  "Callable[[OSDThrasher], Any]"; expected "OSDThrasher"

Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
2020-03-05 06:54:56 +01:00
Patrick Donnelly
8729281121
qa: manage config changes through mons
This provides a generic framework for modifying Ceph configuration
changes in tests through the monitors rather than the asok interface or
local ceph.conf changes. Any changes are reverted during test teardown.

A future patch will convert existing tests manipulating the local
ceph.conf or admin socket.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2020-02-13 07:51:09 -08:00
Patrick Donnelly
423dcb4c54
qa: only restart MDS between tests
"fs fail" will only fail the MDS that are part of the file system which
will generally allow us to avoid spurious MDS_INSUFFICIENT_STANDBY
warnings. Further, only restart the MDS, there's no reason to leave them
offline.

Fixes: https://tracker.ceph.com/issues/43514
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2020-01-07 18:47:23 -08:00
Patrick Donnelly
4e16633856
qa: improve variable name
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2019-12-04 07:01:34 -08:00
Patrick Donnelly
98e3b7efe8
qa: test mgr cephfs mount blacklist
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2019-12-03 17:53:14 -08:00
Yan, Zheng
89759654c1 qa/cephfs: add test for blacklisted client eviction
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
2019-06-05 21:05:06 +08:00
Patrick Donnelly
1071f73c76
qa: use skipTest method instead of exception
This is the recommended method to skip a test according to [1]. It also lets us
avoid an unnecessary import.

[1] https://docs.python.org/2/library/unittest.html#unittest.TestCase.skipTest

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2019-04-24 09:38:52 -07:00
John Spray
e5fb5a1ddd qa: generalise REQUIRE_MEMSTORE
Move it up into CephTestCase so that mgr tests can
use it too, and pick it up in vstart_runner.py so
that these tests will work neatly there.

Signed-off-by: John Spray <john.spray@redhat.com>
2018-12-18 13:30:54 -06:00
Yan, Zheng
79a56a7023 qa/cephfs: add tests for snaptable transaction
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
2018-02-09 18:42:29 +08:00
Patrick Donnelly
6e046dfc90
qa: check pool full flags
Cluster-wide flag removed in b4ca5ae462.

Fixes: http://tracker.ceph.com/issues/22475

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-12-18 21:59:57 -08:00
Patrick Donnelly
3a5f090a1e
qa: remove usage of mds dump
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-10-24 11:32:43 -07:00
Douglas Fuller
8f9a252020 qa/cephfs: support CephFS recovery pools
Add support for testing recovery of CephFS metadata into an alternate
RADOS pool, useful as a disaster recovery mechanism that avoids
modifying the metadata in-place.

Signed-off-by: Douglas Fuller <dfuller@redhat.com>
2017-08-30 09:02:44 -04:00
Douglas Fuller
c85562c94a qa/ceph_test_case: support CephFS recovery pools
Add support for testing recovery of CephFS metadata into an alternate
RADOS pool, useful as a disaster recovery mechanism that avoids
modifying the metadata in-place.

Signed-off-by: Douglas Fuller <dfuller@redhat.com>
2017-08-30 09:02:44 -04:00
Douglas Fuller
5fafc03cb9 qa/cephfs: Allow deferred fs creation
Permit Filesystem objects to be created and settings modified before
calling Filesystem.create().

Signed-off-by: Douglas Fuller <dfuller@redhat.com>
2017-08-30 09:02:44 -04:00