Commit Graph

630 Commits

Author SHA1 Message Date
Patrick Donnelly
cc36113ad4
Merge PR #34776 into master
* refs/pull/34776/head:
	mgr/volumes: Create subvolume with isolated rados namespace

Reviewed-by: Ramana Raja <rraja@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2020-06-02 17:44:21 -07:00
Patrick Donnelly
3d75b5a55f
Merge PR #34839 into master
* refs/pull/34839/head:
	qa/cephfs: add FUSE module before running mount -t fusectl

Reviewed-by: Zheng Yan <zyan@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
2020-06-02 17:42:59 -07:00
Patrick Donnelly
182985455a
Merge PR #34838 into master
* refs/pull/34838/head:
	vstart_runner: don't use namespaces by default
	qa/cephfs: run nsenter commands with superuser privileges
	qa/cephfs: look for mountpoint in cmdline file

Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2020-06-02 12:01:52 -07:00
Patrick Donnelly
963bb62ec9
Merge PR #34782 into master
* refs/pull/34782/head:
	qa/tasks/cephfs/mount.py: remove netns name parsing in mountpoint setter
	qa/tasks/vstart_runner.py: add kwargs parameter to ignore the ones it does not understand

Reviewed-by: Rishabh Dave <ridave@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2020-06-02 07:40:39 -07: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
Rishabh Dave
ea1432810c qa/cephfs: look for mountpoint in cmdline file
Look for self.mountpoint in the contents of /proc/<pid>/cmdline file
when finding asok file for the client so that vstart_runner.py won't end
up picking asok file for a client not created in current run.

This usually never happens so far because PID of newly created processes
is higher than that of previously created processes and list of asok
files returned by "glob.glob(asok_path)" in find_socket() is in
descending order of PIDs.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-06-01 23:53:02 +05:30
Xiubo Li
a7423b2286 qa/tasks/cephfs/test_scrub.py: use umount_wait to avoid ceph-fuse stuck
If the ceph-fuse client need to flush the caps and does sync wait,
the umount() will just return successfully, then the netns container
will be destroyed and the network will not be reachable, but the
ceph-fuse daemon is still stucked and waiting for the flush caps ack.

This will cause the ceph-fuse daemon get stuck forever and if the
mds daemons get restarted, it will try to reconnect the clients,
but the stucked ceph-fuse daemnon won't reply to it, because it is
not reachable any more.

Fixes: https://tracker.ceph.com/issues/45665
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-06-01 09:24:02 -04:00
Varsha Rao
b2adff10b5 qa/tasks/cephfs: Enable multiple exports tests
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-05-29 23:36:34 +05:30
Varsha Rao
1477c98764 qa/tasks/cephfs: Don't enable cephadm in TestNFS
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-05-29 15:24:03 +05:30
Varsha Rao
af3b925dfd qa/tasks/cephfs: Add tests for nfs exports
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-05-29 14:56:34 +05:30
Varsha Rao
ab41951b04 qa/cephfs: Add tests for nfs
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-05-29 14:47:32 +05:30
Xiubo Li
9bc1a74342 qa/tasks/cephfs/mount.py: remove netns name parsing in mountpoint setter
We can get the correct netns name always by using the netns_name
getter.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-05-27 21:34:02 -04:00
Kotresh HR
7396880d40 mgr/volumes: Create subvolume with isolated rados namespace
1. Add --namespace-isolated option to 'subvolume create' command
   to create subvolume in a separate RADOS namespace
2. Add "pool_namespace" field to 'subvolume info' command
   which displays the rados namespace if set else empty string

Fixes: https://tracker.ceph.com/issues/45289
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2020-05-26 12:00:53 +05:30
Patrick Donnelly
481b575491
Merge PR #35090 into master
* refs/pull/35090/head:
	mgr/volumes: Fix subvolume create idempotency

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Ramana Raja <rraja@redhat.com>
2020-05-22 14:23:57 -07:00
Patrick Donnelly
dbef451083
Merge PR #35063 into master
* refs/pull/35063/head:
	cephfs: allow pool names with '-' and '.'

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2020-05-22 14:21:30 -07:00
Patrick Donnelly
3c1330795a
qa: return a string via getfattr
Fixes: https://tracker.ceph.com/issues/45666
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2020-05-22 14:15:19 -07:00
Kotresh HR
db8706aa68 mgr/volumes: Fix subvolume create idempotency
After subvolume is created, it can be resized
using subvolume create command. But it was
broken and the same is fixed.

Fixes: https://tracker.ceph.com/issues/45398
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2020-05-22 16:28:35 +05:30
Rishabh Dave
2d7c32997b qa/cephfs: add FUSE module before running mount -t fusectl
Also, change timeout from 15 minutes to 30 seconds for the command
"mount -t fusectl xxx xxx" since 15 minutes is too much as per Zheng.

Fixes: https://tracker.ceph.com/issues/45304
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-05-22 15:26:37 +05:30
Rishabh Dave
1abfdd161c cephfs-shell: support cephfs-shell.conf
cephfs-shell options should reside in cephfs-shell.conf and not in
ceph.conf. Please note, unlike before, -c option of cephfs-shell must
take path to cephfs-shell.conf instead of path to ceph.conf.

This commit also updates the docs and the tests for cephfs-shell accordingly
and renames the variable config_path in cephfs-shell to shell_conf_path so
that it's easy to distinguish.

Fixes: https://tracker.ceph.com/issues/44127
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-05-20 21:32:45 +05:30
Patrick Donnelly
3a26099d05
Merge PR #33264 into master
* refs/pull/33264/head:
	test_cephfs_shell: refactor test_put_and_get_without_target_directory

Reviewed-by: Varsha Rao <varao@redhat.com>
2020-05-20 08:27:34 -07:00
Ramana Raja
d9f8f8e3d0 cephfs: allow pool names with '-' and '.'
... to be set as pool layouts for files and directories.

Fixes: https://tracker.ceph.com/issues/45521
Signed-off-by: Ramana Raja <rraja@redhat.com>
2020-05-19 13:34:49 +05:30
Patrick Donnelly
076d04654f
Merge PR #35062 into master
* refs/pull/35062/head:
	qa/tasks/cephfs/fuse_mount.py: retry when the admin socket is not ready

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Rishabh Dave <ridave@redhat.com>
2020-05-18 15:14:08 -07:00
Patrick Donnelly
5ea3a9a1f7
Merge PR #34951 into master
* refs/pull/34951/head:
	qa/cephfs: run() cleanup whether FS was mounted or not

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
2020-05-18 14:57:20 -07:00
Patrick Donnelly
0825b9b97d
Merge PR #35058 into master
* refs/pull/35058/head:
	qa/tasks: logger.warn() -> logger.warning()

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2020-05-18 14:34:28 -07:00
Patrick Donnelly
6f14713aed
qa: do not save/restore ip_forward sysctl
We don't really care if this is left on during the course of the mount.
These settings don't persist across tests anyway.

Fixes: https://tracker.ceph.com/issues/45525
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2020-05-14 20:15:38 -07:00
Xiubo Li
422d736568 qa/tasks/cephfs/fuse_mount.py: retry when the admin socket is not ready
Fixes: https://tracker.ceph.com/issues/45552
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-05-14 22:00:35 -04:00
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
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
Kotresh HR
171930ef77 mgr/volumes: Add snapshot info command
The following command is added

"ceph fs subvolume snapshot info <vol_name> <sub_name> <snap_name> [<group_name>]"

The output is in json format with following fields

    created_at: time of creation of snapshot in the format "YYYY-MM-DD HH:MM:SS:ffffff"
    data_pool: data pool the snapshot belongs to
    has_pending_clones: "yes" if snapshot clone is in progress otherwise "no"
    protected: "yes" if snapshot is protected otherwise "no"
    size: snapshot size in bytes

Fixes: https://tracker.ceph.com/issues/45237
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2020-05-13 15:23:36 +05:30
Kefu Chai
b23de0c4b0
Merge pull request #34956 from tchaikov/wip-qa-tasks-cephfs-py3
qa/tasks/cephfs: remove sys.exc_clear() calls

Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2020-05-13 15:21:41 +08:00
Patrick Donnelly
01aea7f7e1
Merge PR #34978 into master
* refs/pull/34978/head:
	qa/tasks/cephfs/mount.py: always setup the NAT rules
	qa/tasks/cephfs/mount.py: fall back to use ip command to setup the bridge

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Rishabh Dave <ridave@redhat.com>
Reviewed-by: Ramana Raja <rraja@redhat.com>
2020-05-12 11:59:51 -07:00
Xiubo Li
2e6e3916a0 qa/tasks/cephfs/mount.py: always setup the NAT rules
If the last test failed just after the 'ceph-brx' bridge is created
but with setuping the NAT rules in iptables, so if we run the test
case again, it will just skip seting the 'ceph-brx' and the NAT rules.
Then deleting the NAT rules will get the errors like:

iptables: Bad rule (does a matching rule exist in that chain?).

Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-05-11 23:20:42 -04:00
Xiubo Li
f7b49f5bab qa/tasks/cephfs/mount.py: fall back to use ip command to setup the bridge
CentOS/RHEL8 have abandoned the bridge-utils package so the brctl
cmd is none avalible, and on Ubuntu 18.04 and 20.04 the nmcli is
buggy to setup the bridge. So this will fall back to use ip cmd
to setup the bridge stuff.

Fixes: https://tracker.ceph.com/issues/45459
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-05-11 22:51:29 -04:00
Kefu Chai
bcbb8abb96
Merge pull request #34834 from sidharthanup/qa-test-exports-fix
qa/test_exports: fix TestExports failure under new py3 compability changes

Reviewed-by: Kefu Chai <kchai@redhat.com>
2020-05-09 14:53:10 +08:00
Kefu Chai
702de9590c qa/tasks/cephfs: remove sys.exc_clear() calls
sys.exc_clear() was removed in Python3, see
https://docs.python.org/3/whatsnew/3.0.html#index-22. so we should not
call it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-05-08 11:21:22 +08:00
Rishabh Dave
71b823daee qa/cephfs: use StringIO instead of BytesIO
Fixes: https://tracker.ceph.com/issues/45425
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-05-07 12:13:53 +05:30
Sidharth Anupkrishnan
b98f3e388b qa/test_exports: fix TestExports failure under new python3 compability changes
self.mount_a.client_remote.sh() returns an 'str' object rather than a StringIO object. Hence the p.stdout.getvalue() produces an error. This commit fixes this and also fix str and byte mismatch as byte and string were the same object in Python2 but this is not the case in Python3.

Signed-off-by: Sidharth Anupkrishnan <sanupkri@redhat.com>
2020-04-30 15:49:32 +05:30
Gregory Farnum
0a9612bcde
Merge pull request #34595 from rishabh-d-dave/fs-move-run_shell
qa/cephfs: move run_shell to mount.py and add methods for negative testing

Reviewed-by: Jeff Layton <jlayton@redhat.com>
2020-04-27 16:35:20 -07:00
Rishabh Dave
39db91ea19 test_cephfs_shell: refactor test_put_and_get_without_target_directory
The refactor intends to simplify the test and make it more readable,

It also changes how this test creates directory -- tempfile.mkdtemp is
used instead of coreutils mkdir to avoid bug reported here -
https://tracker.ceph.com/issues/43567.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-04-27 14:28:03 +05:30
Kefu Chai
28c7ba68ae
Merge pull request #34732 from lxbsz/fs_fix_new
qa: misc fixes to run for cephfs qa test

Reviewed-by: Kefu Chai <kchai@redhat.com>
2020-04-26 01:46:30 +08:00
Kefu Chai
d07960ef7a
Merge pull request #34578 from lxbsz/volume_client_py3
qa/volume_client: be python3 compatible

Reviewed-by: Ramana Raja <rraja@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2020-04-25 18:58:43 +08:00
Xiubo Li
dd4fc808a8 qa/tasks/cephfs: switch to StringIO to fix byte-like errors
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-25 06:21:55 -04:00
Xiubo Li
8921c8e1dc qa/cephfs: switch to mount_wait() to avoid possible umounted assert
For the fuse mount, it sometime will need to wait to a moment to let
the client get ready.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-25 06:21:55 -04:00
Xiubo Li
211c3fbb4b qa/tasks/cephfs/fuse_mount: fix possible chmod 1777 error
INFO:teuthology.orchestra.run.smithi13a2:> (cd /home/ubuntu/cephtest && exec sudo chmod 1777 /home/ubuntu/cephtest/mnt.2)
INFO:teuthology.orchestra.run.smithi132.stderr:chmod: changing permissions of '/home/ubuntu/cephtest/mnt.2': Permission denied
DEBUG:teuthology.orchestra.run:got remote process result: 1

Here just wait and rety for 10 times.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-25 06:21:55 -04:00
Xiubo Li
bf10478294 qa/tasks/vstart_runner: remove the stdin str type check
For the "ceph-dencoder" it will use the byte type data.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-25 06:21:54 -04:00
Xiubo Li
7f57576123 qa/cephfs: fix AssertionError: CommandFailedError not raised under py3
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-25 06:21:54 -04:00
Kefu Chai
7b38f01438
Merge pull request #34725 from lxbsz/_type_equality_funcs
qa/tasks/cephfs/test_scrub: fix self.assertEqual no attribute '_type_equality_funcs'

Reviewed-by: Kefu Chai <kchai@redhat.com>
2020-04-24 18:59:31 +08:00
Xiubo Li
afe19f24ba qa/tasks/cephfs/test_volumes: to make sure the size is int type
Fix "Error EINVAL: invalid size option '4915200.0'".

In pytho2 int/2 will get a int type result, but in python3 it maybe
a float type.

Fixes: https://tracker.ceph.com/issues/45247
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-24 05:05:54 -04:00
Xiubo Li
65f97690af qa/tasks/cephfs/mount: to make sure that the count/seek are int type
To fix "stderr:dd: invalid number: '5.0'".

Fixes: https://tracker.ceph.com/issues/45247
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-24 05:05:54 -04:00
Xiubo Li
89d0649088 qa/tasks/cephfs/test_scrub: fix self.assertEqual no attribute '_type_equality_funcs'
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-24 04:12:46 -04: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
0631342d10 qa/tasks/cephfs/mount: switch to StringIO to fix TypeErrors
TypeError: cannot use a string pattern on a bytes-like object

Fixes: https://tracker.ceph.com/issues/45175
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-23 20:55:35 -04:00
Yan, Zheng
cd94861e96
Merge pull request #33479 from simon-rock/simon_split_stray
mds : enable fragmentation of stray dir when conditions are met
2020-04-22 14:55:57 +08:00
Gregory Farnum
da3904609f
Merge pull request #34561 from kotreshhr/ceph-fs-status-output
mgr/status: Fix "ceph fs status" json format writing to stderr

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Ramana Raja <rraja@redhat.com>
2020-04-21 22:17:42 -07:00
Gregory Farnum
54d4b31f0c
Merge pull request #34534 from ajarr/fix-43061
mon/FSCommands: Fix 'add_data_pool' command and 'fs new' command

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
2020-04-21 22:15:23 -07:00
Gregory Farnum
3504799810
Merge pull request #34164 from ukernel/wip-44382
qa/cephfs: update TestClusterFull:test_barrier

Reviewed-by: Jeff Layton <jlayton@redhat.com>
2020-04-21 22:14:10 -07:00
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
Yan, Zheng
a7eadaf28b qa/cephfs: add test case for fragmenting stray dirs
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
2020-04-21 12:38:59 +08:00
Kefu Chai
c5bd318de6 qa/tasks/cephfs/fuse_mount.py: by python3 compatible
pass `StringIO()` to capture stdout whose value will be interpreted as a
string later on

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-20 19:55:09 +08:00
Xiubo Li
0ed507dfd4 qa/volume_client: fix TestVolumeClient failing under new py3 runtime
The pybind now has dropped the WITH_PYTHON2 option, and for now only
py3 supported.

Fixes: https://tracker.ceph.com/issues/45103
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-20 07:04:52 -04:00
Gregory Farnum
c17f4d9262
Merge pull request #34410 from lxbsz/mds_dirty_parent
tools/cephfs: add accounted_rstat/rstat when building file dentry

Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
2020-04-17 08:27:40 -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
Rishabh Dave
ec1c2af43f vstart_runner.py: add methods for negative testing a cmd
Methods like run_shell effectively conduct positive test on the given
command. Add methods that runs given command expecting failure and then
verifies return value and error message with given one. Rewrite testcmd,
testcmd_as_user and testcmd_as_root to create these new methods for
negative testing since run_shell, run_as_user and run_as_root is
equivalent of running positive test.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-04-17 00:28:20 +05:30
Rishabh Dave
7b15a8437e qa/cephfs: move run_shell and related methods to mount.py
LocalFuseMount and LocalKernelMount can directly inherit these methods
from CephFSMount via FuseMount and KernelMount respectively. Moving
would avoid duplication and would make these methods more accessible
for reusing via inheritance.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-04-17 00:27:41 +05:30
Venky Shankar
2132cf6ee0
Merge pull request #34210 from kotreshhr/cephfs-subvolume-info
mgr/volumes: Add interface to get subvolume metadata
2020-04-16 18:38:08 +05:30
Kotresh HR
138117f2f4 mgr/status: Fix "ceph fs status" json format writing to stderr
"ceph fs status" json format outputs to stderr instead of
stdout. This patch fixes the same.

Fixes: https://tracker.ceph.com/issues/44962
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2020-04-15 19:15:11 +05:30
Ramana Raja
2f45558eb8 mon/FSCommands: Fix 'fs new' command
After creating a filesystem using the 'fs new' command, the value
of the 'data' and 'metadata' key of the datapool and metadatapool's
application tag 'cephfs' should be the filesystem's name. This
didn't happen when the data or metadata pool's application metadata
'cephfs' was enabled before the pool was used in the 'fs new' command.
Fix this during the handling of the 'fs new' command by setting the
value of the key of the pool's application metadata 'cephfs' to the
filesystem's name even when the application metadata 'cephfs' is
already enabled or set.

Fixes: https://tracker.ceph.com/issues/43761
Signed-off-by: Ramana Raja <rraja@redhat.com>
2020-04-15 17:17:23 +05:30
Ramana Raja
3c49092322 mon/FSCommands: Fix 'add_data_pool' command
After making a RADOS pool a filesystem's data pool using the
'add_data_pool' command, the value of the 'data' key of the pool's
application metadata 'cephfs' should be the filesystem's name. This
didn't happen when the pool's application metadata 'cephfs' was
enabled before the pool was made the data pool. Fix this during the
handling of the 'add_data_pool' command by setting the value of
the 'data' key of the pool's application metadata 'cephfs' to the
filesystem's name even when the application metadata 'cephfs' is
already enabled or set.

Fixes: https://tracker.ceph.com/issues/43061
Signed-off-by: Ramana Raja <rraja@redhat.com>
2020-04-15 15:56:56 +05:30
Xiubo Li
06d10798d7 qa/tasks/cephfs: rename mounted() to mounted_wait()
The boolean self.mounted parameter is conflicted with mounted() helper,
so we will hit error like:

INFO:tasks.cephfs_test_runner:TypeError: 'bool' object is not callable

Fixes: https://tracker.ceph.com/issues/44044
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-14 07:47:04 -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
Xiubo Li
ed5b737d00 qa/tasks/cephfs/test_misc: switch to netns suspend/resume
https://tracker.ceph.com/issues/44044
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-14 07:47:04 -04:00
Xiubo Li
eb2fe8440b qa/tasks/cephfs/test_client_recovery: switch to netns suspend/resume
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
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
Xiubo Li
62e9820c3e qa/cephfs: scrub the subdir/ after data scan
This will make sure the rstat between subdir's inode and dirfrag
are matched.

Fixes: https://tracker.ceph.com/issues/44380
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-13 00:13:35 -04:00
Xiubo Li
b24edff02e qa/cephfs: remove the whole subdir/ after test done
Fixes: https://tracker.ceph.com/issues/44380
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-12 22:17:49 -04:00
Xiubo Li
39df09e52b tools/cephfs: Disable dirfrag auto merging and splitting
Make sure that the dirfrag auto merging and splitting are disabled
explicitly.

Fixes: https://tracker.ceph.com/issues/44380
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-12 22:17:48 -04:00
Xiubo Li
b8d34cdbdc tools/cephfs: scan the links to set the proper dnfirst
The ceph code will set the dnfirst=2 as default instead of CEPH_NOSNAP.
And this will avoid the MDS daemon assert crash:

ceph_assert(in->first <= straydn->first)

Fixes: https://tracker.ceph.com/issues/44380
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-04-12 22:17:47 -04:00
Kotresh HR
70659ffee1 mgr/volumes: Add interface to get subvolume metadata
The following interface is added

"ceph fs subvolume info <vol_name> <sub_name> [<group_name>]"

The output is in json format with following fields

1. atime: access time of subvolume path in the format "YYYY-MM-DD HH:MM:SS"
2. mtime: modification time of subvolume path in the format "YYYY-MM-DD HH:MM:SS"
3. ctime: change time of subvolume path in the format "YYYY-MM-DD HH:MM:SS"
4. uid: uid of subvolume path
5. gid: gid of subvolume path
6. mode: mode of subvolume path
7. mon_addrs: list of monitor addresses
8. bytes_pcent: quota used in percentage if quota is set, else displays "undefined"
9. bytes_quota: quota size in bytes if quota is set, else displays "infinite"
10. bytes_used: current used size of the subvolume in bytes
11. created_at: time of creation of subvolume in the format "YYYY-MM-DD HH:MM:SS"
12. data_pool: data pool the subvolume belongs to
13. path: absolute path of a subvolume
14. type: subvolume type indicating whether it's clone or subvolume

Fixes: https://tracker.ceph.com/issues/44277
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2020-04-09 15:24:50 +05:30
Kefu Chai
981ad34987 qa/tasks/cephfs/test_cephfs_shell: assertRegex(text, regex)
per Python3 doc of unittest,

> assertRegex(text, regex, msg=None)

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
7f48f61bdc qa/tasks/cephfs: return ascii decoded xattr
as callers of `TestForwardScrub._read_str_xattr()` expects str.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08:00
Kefu Chai
162be92106 qa/tasks/cephfs: cast mds_recall_warning_decay_rate to float
this change should address the failure of
```
2020-04-05T15:14:23.088 INFO:tasks.cephfs_test_runner:Traceback (most recent call last):
2020-04-05T15:14:23.088 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_client_limits.py", line 110, in test_client_pin_mincaps
2020-04-05T15:14:23.089 INFO:tasks.cephfs_test_runner:    self._test_client_pin(True, 200)
2020-04-05T15:14:23.089 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_client_limits.py", line 71, in _test_client_pin
2020-04-05T15:14:23.090 INFO:tasks.cephfs_test_runner:    self.wait_for_health("MDS_CLIENT_RECALL", mds_recall_warning_decay_rate*2)
2020-04-05T15:14:23.091 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/ceph_test_case.py", line 152, in wait_for_health
2020-04-05T15:14:23.091 INFO:tasks.cephfs_test_runner:    self.wait_until_true(seen_health_warning, timeout)
2020-04-05T15:14:23.092 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/ceph_test_case.py", line 193, in wait_until_true
2020-04-05T15:14:23.093 INFO:tasks.cephfs_test_runner:    if elapsed >= timeout:
2020-04-05T15:14:23.093 INFO:tasks.cephfs_test_runner:TypeError: unorderable types: int() >= str()
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08:00
Kefu Chai
20dafc6d52 qa/tasks/cephfs: allow caller to use BytesIO when calling rados()
when the caller expects binary data, it should pass BytesIO as stdout.

this change shold address the failure of
```
2020-04-05T12:47:25.335 INFO:tasks.cephfs_test_runner:======================================================================
2020-04-05T12:47:25.336 INFO:tasks.cephfs_test_runner:ERROR: test_apply_tag (tasks.cephfs.test_forward_scrub.TestForwardScrub)
2020-04-05T12:47:25.336 INFO:tasks.cephfs_test_runner:----------------------------------------------------------------------
2020-04-05T12:47:25.336 INFO:tasks.cephfs_test_runner:Traceback (most recent call last):
2020-04-05T12:47:25.337 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_forward_scrub.py", line 75, in test_apply_tag
2020-04-05T12:47:25.337 INFO:tasks.cephfs_test_runner:    self.assertTagged(inos[dirpath], tag, self.fs.get_metadata_pool_name())
2020-04-05T12:47:25.337 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_forward_scrub.py", line 98, in assertTagged
2020-04-05T12:47:25.338 INFO:tasks.cephfs_test_runner:    "scrub_tag"
2020-04-05T12:47:25.338 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_forward_scrub.py", line 35, in _read_str_xattr
2020-04-05T12:47:25.339 INFO:tasks.cephfs_test_runner:    strlen = struct.unpack('i', output[0:4])[0]
2020-04-05T12:47:25.339 INFO:tasks.cephfs_test_runner:TypeError: a bytes-like object is required, not 'str'
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08:00
Kefu Chai
eb2c6b3740 qa/tasks/cephfs: use BytesIO for capturing binary
this change partially reverts e46eb8348e.

xattrs could contain non-utf8 encoded data, and should be captured using
BytesIO. moreover, it will be fed to `ceph-dencoder`, which expects
binary when performing "import".

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08:00
Kefu Chai
21d6c5a95b qa/tasks/cephfs: use assertCountEqual if PY3
assertItemsEqual is renamed to assertCountEqual in Python3.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08:00
Kefu Chai
83e41daec4 qa/tasks/cephfs: compare number with number
to address following failure:
```
2020-04-05T12:25:30.997 INFO:tasks.cephfs_test_runner:Traceback (most recent call last):
2020-04-05T12:25:30.997 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_misc.py", line 50, in test_root_rctime
2020-04-05T12:25:30.998 INFO:tasks.cephfs_test_runner:    self.assertGreaterEqual(rctime, t-10)
2020-04-05T12:25:30.998 INFO:tasks.cephfs_test_runner:  File "/usr/lib/python3.5/unittest/case.py", line 1215, in assertGreaterEqual
2020-04-05T12:25:30.998 INFO:tasks.cephfs_test_runner:    if not a >= b:
2020-04-05T12:25:30.999 INFO:tasks.cephfs_test_runner:TypeError: unorderable types: str() >= float()
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08:00
Kefu Chai
40d0356249 qa/tasks/cephfs: do no radom.sample(a_dict)
collect the keys instead of filtering a dict,
to address following failure:
```
2020-04-05T12:15:36.275 INFO:tasks.cephfs_test_runner:Traceback (most recent call last):
2020-04-05T12:15:36.275 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_strays.py", line 29, in test_files_throttle
2020-04-05T12:15:36.275 INFO:tasks.cephfs_test_runner:    self._test_throttling(self.FILES_THROTTLE)
2020-04-05T12:15:36.276 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_strays.py", line 96, in _test_throttling
2020-04-05T12:15:36.276 INFO:tasks.cephfs_test_runner:    return self._do_test_throttling(throttle_type)
2020-04-05T12:15:36.278 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_strays.py", line 176, in _do_test_throttling
2020-04-05T12:15:36.278 INFO:tasks.cephfs_test_runner:    mds_max_purge_ops = int(self.fs.get_config("mds_max_purge_ops", 'mds'))
2020-04-05T12:15:36.279 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/filesystem.py", line 285, in get_config
2020-04-05T12:15:36.279 INFO:tasks.cephfs_test_runner:    service_id = random.sample(filter(lambda i: self.mds_daemons[i].running(), self.mds_daemons), 1)[0]
2020-04-05T12:15:36.280 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/git.ceph.com_git_teuthology_py3/virtualenv/lib/python3.5/random.py", line 311, in sample
2020-04-05T12:15:36.280 INFO:tasks.cephfs_test_runner:    raise TypeError("Population must be a sequence or set.  For dicts, use list(d).")
2020-04-05T12:15:36.280 INFO:tasks.cephfs_test_runner:TypeError: Population must be a sequence or set.  For dicts, use list(d).
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08: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
Kefu Chai
9ca45bd942 qa/tasks: do not random.choice(a_view)
use `random.sample()` instead of `random.choice(list(a_view))` for better performance.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 20:33:47 +08:00
Kefu Chai
dd8d929c9c qa,tes: s/xrange/range/
use six.moves.range for python3 copatibility, we can drop six after
migrating to python3.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 20:33:47 +08:00
Kefu Chai
f10f865796 qa/tasks/cephfs: use StringIO for capturing str
if we don't expect non-utf8 in stdout, use StringIO instead of BytesIO.

see also d8d44ed156

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 20:33:47 +08:00
Kefu Chai
d7258ea7fd qa/tasks: use next(iter(..)) for accessing first element in a view
in python2, dict.values() and dict.keys() return lists. but in python3,
they return views, which cannot be indexed directly using an integer index.

there are three use cases when we access these views in python3:

1. get the first element
2. get all the elements and then *might* want to access them by index
3. get the first element assuming there is only a single element in
   the view
4. iterate thru the view

in the 1st case, we cannot assume the number of elements, so to be
python3 compatible, we should use `next(iter(a_dict))` instead.

in the 2nd case, in this change, the view is materialized using
`list(a_dict)`.

in the 3rd case, we can just continue using the short hand of
```py
(first_element,) = a_dict.keys()
```
to unpack the view. this works in both python2 and python3.

in the 4th case, the existing code works in both python2 and python3, as
both list and view can be iterated using `iter`, and `len` works as
well.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 20:33:47 +08:00
Gregory Farnum
40fb15563d
Merge pull request #31480 from ukernel/wip-20
client: auto reconnect after blacklisted

Reviewed-by: Jeff Layton <jlayton@redhat.com>
2020-04-03 12:53:29 -07:00
Gregory Farnum
0e7e0d59c7
Merge pull request #34386 from gregsfortytwo/wip-33279-revert-sudo
Wip 33279 revert sudo

Reviewed-by: Douglas Fuller <dfuller@redhat.com>
2020-04-03 12:36:37 -07:00
Greg Farnum
81ce2b240a Revert "qa/cephfs: move run_shell and related methods to mount.py"
This reverts commit 751d432a86.

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2020-04-03 02:24:48 +00:00
Greg Farnum
1902e6bfd9 Revert "vstart_runner.py: add methods for negative testing a cmd"
This reverts commit 48e0e1d703.

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2020-04-03 02:24:45 +00:00
Venky Shankar
bccbf1fa03 mgr: force purge normal ceph entities from service map
Normal ceph services can send task status updates to manager.
Task status is tracked in service map implying that normal
ceph services have entries in service map and daemon tracking
index (daemon state). But the manager prunes entries from daemon
state when it receives an updated map (fs, mon, etc...). This
causes periodic pruning of service map entries to fail for normal
ceph services (those which send task status updates) since it
expects a corresponding entry in daemon state.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
2020-03-31 02:41:00 -04:00
Yan, Zheng
107b91d528 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-03-30 10:24:47 +08:00
Gregory Farnum
60504bd048
Merge pull request #33279 from rishabh-d-dave/fs-move-run_shell-and-related-methods
qa/cephfs: move run_shell to mount.py and add methods for negative testing
2020-03-27 12:59:43 -07:00
Kefu Chai
4b4f393aec qa/tasks/cephfs: fix print() to be py3 compatible
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-03-27 14:51:24 +08:00