Commit Graph

66 Commits

Author SHA1 Message Date
Venky Shankar
4322dcc2e9 qa: avoid explicit set to client mountpoint as "/"
This causes self.cephfs_mntpt to set as "/" by default which
overrides the config in ceph.conf. `test_client_cache_size`
updates ceph.conf with:

        client mountpoint = /subdir

However, the ceph-fuse mount command has --client_mountpoint explicitly
set as "/", thereby causing the root of the file system to get mounted which
confuses the test.

Fixes: http://tracker.ceph.com/issues/56446
Introduced-by: bf83eaa4e7
Signed-off-by: Venky Shankar <vshankar@redhat.com>
2023-01-30 19:58:16 +05:30
Patrick Donnelly
d3295628eb
qa: allow specifying mount options for fuse
Also, fix the type default to None. A list does not work in the code but
the default is not used in QA.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2022-09-26 22:19:22 -04:00
Patrick Donnelly
ae00634a5e
qa: unify mountpoint config behavior
Only fuse would support the "mountpoint" yaml config. Move it to
mount.py so it works consistently with the kernel mount. Ditto for the
cephfs mount point.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2022-09-26 22:19:22 -04:00
Rishabh Dave
c279b47ec9 qa/cephfs: lazy-force unmount clients that have been evicted
Before unmounting check if the client has been evicted and, if so, run
"umount -f -l" for the mount point of the client and cleanup the mount
right after it.

Attempting to unmount, cleanup or operate in any way over mount point
of a evicted client will hang the operation (and thereby our Python
code too). Lazy-force unmount prevents such hangs for our Python code
and also frees the mount point.

This commit also adds code to gather session info for kernel mounts
after mounting is successful. This is a necessity since network address
of session is needed to check if it is blocked by Ceph cluster.

Fixes: https://tracker.ceph.com/issues/56476
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2022-08-19 21:00:00 +05:30
Rishabh Dave
cef4c8d832
Merge pull request #45036 from rishabh-d-dave/qa-fix-is_mounted
qa/cephfs: upgrade is_mounted() in mount.py

Reviewed-by: Kotresh HR <khiremat@redhat.com>
Reviewed-by: Dhairya Parmar <dparmar@redhat.com>
Reviewed-by: Nikhilkumar Shelke <nshelke@redhat.com>
Reviewed-by: Ramana Raja <rraja@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
2022-08-19 18:43:59 +05:30
Rishabh Dave
f96031b920 qa/cephfs: upgrade is_mounted() in mount.py
Instead of relying on value of a mutable variable, actually check if the
CephFS is mounted on the system. This will prevent bugs due to stale and
incorrect values.

Fixes: https://tracker.ceph.com/issues/54283
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2022-07-20 22:36:18 +05:30
Neeraj Pratap Singh
9fb85b02f3 qa: test the correctness of snap dir name
Signed-off-by: Neeraj Pratap Singh <neesingh@redhat.com>
2022-06-29 15:22:41 +05:30
Venky Shankar
61673a77d4
Merge pull request #46363 from dparmar18/tracker_55548
qa/cephfs: fallback to older way of get_op_read_count

Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
2022-06-20 09:57:26 +05:30
Venky Shankar
27f4729256
Merge pull request #45556 from mchangir/qa-add-subvolume-option-flavors
qa: add subvolume option flavors

Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Ramana Raja <rraja@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
2022-06-13 12:29:43 +05:30
dparmar18
269567d005 qa/cephfs: fix read_debug_file() return value and a pep8 violation
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
2022-06-13 11:33:43 +05:30
dparmar18
0aca27d2fc qa/cephfs: fallback to older way of get_op_read_count
Fixes: https://tracker.ceph.com/issues/55538

Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
2022-06-13 11:33:43 +05:30
Rishabh Dave
ac5de474cf qa/cephfs: change default timeout from 900 secs to 300
15 minutes is unnecessarily large as a default value for timeout for a
command. Not having to wait unnecessarily on a crash of a command will
reduce teuthology's testing queue and will save individual developer's
time while running tests locally.

Whatever lines are modified for this purpose are also modified to follow
the stlye guideline, specfically wrapping at 80 characters.

Fixes: https://tracker.ceph.com/issues/54236
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2022-04-26 18:34:42 +05:30
Milind Changire
bf83eaa4e7 qa: enhancement for subvol creation and mounting
Fixes: https://tracker.ceph.com/issues/54317
Signed-off-by: Milind Changire <mchangir@redhat.com>
2022-04-07 14:15:56 +05:30
Venky Shankar
a15e6d6721 qa: exclude nofallback mount option when using v1-style syntax
Otherwise, certain upgrade tests fail which install pacific
or earlier releases since the mount helper does not understand
this mount option, thereby passing it to the kernel which would
does not handle this config causing mount to fail in tests.

Note that this mount config is only used during teuthology tests
to catch v2-style syntax implementation bugs in the kernel.

Fixes: http://tracker.ceph.com/issues/53487
Signed-off-by: Venky Shankar <vshankar@redhat.com>
2021-12-09 13:30:22 +05:30
Xiubo Li
b44ee81e7e qa: rename and save the client_config for kernel mount
Fixes: https://tracker.ceph.com/issues/53216
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2021-12-01 15:05:16 +08:00
Venky Shankar
c44f2fcbb7
Merge pull request #43878 from jtlayton/wip-53214
qa: account for split of the kclient "metrics" debugfs file

Reviewed-by: Venky Shankar <vshankar@redhat.com>
2021-12-01 09:38:05 +05:30
Venky Shankar
f8b939e128 test: mount kclient using new-style (v2) syntax
But, do not throw away the old style mount syntax since we would
want to continue testing it since users (scripts) might still be
using it.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
2021-11-30 01:13:34 -05:00
Jeff Layton
e9f2bff8cd qa: account for split of the kclient "metrics" debugfs file
Recently, Luis posted a patch to turn the metrics debugfs file into a
directory with separate files for the different sections in the old
metrics file.

Account for this change in get_op_read_count().

Fixes: https://tracker.ceph.com/issues/53214
Signed-off-by: Jeff Layton <jlayton@redhat.com>
2021-11-10 13:14:27 -05:00
Patrick Donnelly
04aabf8bee
Merge PR #38752 into master
* refs/pull/38752/head:
	qa: enable dynamic debug support to kclient

Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2021-10-20 22:24:32 -04:00
Patrick Donnelly
a8e77365b1
Merge PR #43425 into master
* refs/pull/43425/head:
	qa: import CommandFailedError from exceptions not run

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Jos Collin <jcollin@redhat.com>
2021-10-15 11:13:55 -04:00
Venky Shankar
ff88d7de52 qa: skip internal metadata directory when scanning ceph debugfs directory
kclient patchset

        https://patchwork.kernel.org/project/ceph-devel/list/?series=556049

introduces `meta` directory to add debugging entries. This needs to be filtered
when scanning ceph debugfs directory.

Fixes: https://tracker.ceph.com/issues/52824
Signed-off-by: Venky Shankar <vshankar@redhat.com>
2021-10-07 00:40:13 -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
Xiubo Li
0cb06740a9 qa: enable dynamic debug support to kclient
Add a 'kmount_count' counter in ctx to make sure the dynamic debug
log won't be disabled until the last kernel mounter is unmounted.

Fixes: https://tracker.ceph.com/issues/48736
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2021-09-15 09:31:04 +08:00
Patrick Donnelly
f92a4f4330
qa: use kclient xattr to lookup client id
Added relatively recently but in RHEL 8.4.

Fixes: https://tracker.ceph.com/issues/51183
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-07-02 12:07:42 -07:00
Patrick Donnelly
891c2773e9
qa: refactor reading debug file code
No need to invoke Python to read a file!

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-06-29 20:13:41 -07:00
Jeff Layton
53863f3654 qa: log messages when falling back to force/lazy umount
We suspect that we may be hitting races against lazy umounts that are
causing problems when enumerating debugfs files. Currently though we
don't log anything special when falling back to a lazy unmount. Log
a message when killing processes on a mount and when force+lazy
unmounting.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2021-06-15 07:16:00 -04:00
Rishabh Dave
5e71e9b065 qa/cephfs: move common and generic methods mount.py
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-03-05 10:03:12 +05:30
Rishabh Dave
86467b14d7 qa/cephfs: refactor KernelMount.mount method
Make KernelMount.mount() such that it can LocalKernelMount can reuse it
instead of duplicating it. For this, move subtasks required for mounting
Ceph FS (like creating mountpoint directory) to a different method, so
that these methods can be overriden in LocalKernelMount as per
requirement.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-03-05 08:53:26 +05:30
Rishabh Dave
db0b85b440 qa/cephfs: remove parameter createfs from mount classes
It's better to get rid of this paramter since it doesn't actually create
any new Ceph file system.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-02-20 15:32:52 +05:30
Xiubo Li
2f4980f394 qa: test_readahead add kernel client support
If the "ceph.cluster_fsid" and "ceph.client_id" vxattrs or the
"metric" debug file are not support yet, will assume the test
succeeds.

Fixes: https://tracker.ceph.com/issues/48053
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-12-18 09:07:26 +08:00
Xiubo Li
cf6797828a qa: add debug information for client address for kclient
Fixes: https://tracker.ceph.com/issues/48242
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-11-17 09:44:57 +08:00
Xiubo Li
66be9cd291 qa/kernel_mount.py: rename _read_debug_file to read_debug_file
Fixes: https://tracker.ceph.com/issues/48053
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-11-16 13:19:51 +08:00
Rishabh Dave
ce32cf4f81 qa/cephfs: add code for when config is None in __init__
When tests are launched with kernel client using vstart_runner.py,
config is None and, therefore, the call "config.get()" leads to a crash.
Assigning self.rbytes None is important since leaving it undefined will
to lead a crash since the code executed later assumes that self.rbytes
is defined.

Fixes: https://tracker.ceph.com/issues/48147
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-11-10 15:47:24 +05:30
Patrick Donnelly
e8642c742a
qa: run norstats workunit for klient
Fixes: https://tracker.ceph.com/issues/23718
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2020-11-03 13:00:35 -08:00
Xiubo Li
7acd445fcc qa/tasks: tear down the background process before unmounting
If the background process keeps running by opening the mountpoint
directory, the unmount will fail with BUSY.

Fixes: https://tracker.ceph.com/issues/46883
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-10-21 04:02:38 -04:00
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
Rishabh Dave
9a36a0abd0 qa/cephfs: allow not aborting execution when mount command fails
This commit adds a new argument check_status to mount methods of
KernelMount, FuseMount, LocalKernelMount and LocalFuseMount. When value
of this argument is False, these methods would catch the
CommandFailedError exception and would return a tuple consisting of the
exception itself, and stdout and stderr of the mount command. This
allows reusing these mount methods while running negative tests for
commands.

The name "check_status" is selected so since teuthology's run() and
vstart_runner's run() use a variable with same name for the very same
purpose.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-09-10 17:10:51 +05:30
Rishabh Dave
07e493ffb5 qa/cephfs: allow reusing mount objects and add remount method
This commit introduces following two set of changes -

First, make client keyring path, mountpoint on host FS and CephFS and
CephFS's name attributes of the object representing the mount
and update all the mount object creation calls accordingly. Also,
rewrite all the mount object creation to use keyword arguments instead
of positional arguments to avoid mistakes, especially since a new
argument was added in this commit.

Second, add remount method to mount.py so that it's possible to unmount
safely, modify the attributes of the object representing the mount and
mount again based on new state of the object *in a single call*. The
method is placed in mount.py to avoid duplication.

This change has two leads to two more changes: upgrading interface of
mount() and mount_wait() and upgrading testsuites to adapt to these
change.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-09-10 17:10:51 +05:30
Patrick Donnelly
4636a1bda8
Merge PR #35664 into master
* refs/pull/35664/head:
	qa: add omit_sudo=False for commands ran with sudo

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
2020-06-25 14:31:33 -07:00
Kefu Chai
21ad5bf2eb qa/tasks/cephfs: flake8 fixes
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-06-24 10:12:11 +08:00
Rishabh Dave
90727ee474 qa: add omit_sudo=False for commands ran with sudo
Commands that cleanup FUSE and kernel mount and that setup and
teardown/cleanup network namespaces are that ones that use sudo. Set
omit_sudo to False while running these commands.

Fixes: https://tracker.ceph.com/issues/46101
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-06-19 14:21:04 +05:30
Rishabh Dave
e57c86fab3 qa/cephfs: run() cleanup whether FS was mounted or not
In case the mount command in mount() fails, it would still have created
the mountpoint and network namespace for the FS's mount. Therefore, run
cleanup() and cleanup_netns() in umount() and umount_wait() even when
self.mounted is set to False.

Also, move the call to cleanup_netns() in cleanup().

Fixes: https://tracker.ceph.com/issues/45430
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-05-14 10:06:21 +05:30
Gregory Farnum
6fae077e9e
Merge pull request #33576 from lxbsz/fuse
unshare-ns-mount: add isolating netns for mount helper support

Reviewed-by: Jeff Layton <jlayton@redhat.com>
2020-04-21 22:12:37 -07:00
Gregory Farnum
b274265acd
Merge pull request #33711 from lxbsz/qa_umount_failed
qa/tasks/cephfs: umount the mountpoints when tearDown

Reviewed-by: Rishabh Dave <ridave@redhat.com>
2020-04-17 08:20:30 -07:00
Xiubo Li
8728da9c08 qa/cephfs/fuse-mount: do not use the 'stat' to check the mount state
If the network couldn't response due to some reasons, the 'stat' cmd
will stuck until the network recovery, the best case is it will stuck
forever.

Fixes: https://tracker.ceph.com/issues/44044
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-14 07:47:03 -04:00
Xiubo Li
f0c67256b9 qa/vstart_runner: add unsharing network namespace support
This will isolate the network namespace for each mount point with
a private ip address and iptables, etc.

For the kill() stuff it will just do DOWN the veth interface instead
of sending ipmi request for kernel mount and kill the fuse processes
for the fuse mount. This could avoid sending the socket FIN to the
ceph cluster.

Fixes: https://tracker.ceph.com/issues/44044
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-14 07:47:03 -04:00
Kefu Chai
947a74349d qa: import with full path
to be py3 compatible

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-03-24 18:27:55 +08:00
Xiubo Li
95820bf48f qa/tasks/vstart_runner: use parent's umount methods
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-03-11 01:52:18 -04:00
Kyr Shatskyy
875b45f3c9 qa/tasks/cephfs/kernel_mount: get rid of StringIO.StringIO for py3
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
2020-03-06 10:19:55 +01:00
Yan, Zheng
261a456439 qa/cephfs: test case for auto reconnect after blacklisted
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Fixes: https://tracker.ceph.com/issues/42085
2020-01-15 15:43:17 +08:00