Commit Graph

110044 Commits

Author SHA1 Message Date
Kefu Chai
5ef3a5fe32 qa/tasks/tempest.py: always write str is value of options
in Python2, ConfigParser is almost the same as RawConfigParser, which
allows set non-string values, but in Python3, ConfigParser.set() only
accepts strings as value of option.

since we do not use "cpar" as an internal storage for options, it does
not matter what type of options we set using ConfigParser as long as it
can be consumed by tempest. boolean settings are translated to "true" or
"false". see also
https://docs.openstack.org/tempest/latest/sampleconf.html

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
b1726bfb08 qa/tasks/tempest.py: use configparser from six.moves
as ConfigParser is offerd by `configparser` module in Python3, so use
six.moves before the migration.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
6ad2ca9767 qa/tasks/ragweed.py: use str methods of helper from string module
in Python3, some methods offered by `string` module are now member
method of `str` class, and `string.uppercase` is renamed to
`string.ascii_uppercase` in Python2 and Python3. so let's update
accordingly.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
7202d8a72c test/rgw/rgw_multi: do not decode a str
`s` comes from `rgwadmin()`, which passes `StringIO` as stdout, so the
the output should an instance of `str` in both Python2 and Python3.
hence there is no need to decode it using UTF-8 codecs again.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
4a9c43313a qa/tasks/radosgw_admin: use HTTPMessage as a dict in PY3
in Python3, HTTPMessage is a dict-like class by itself, and it does not
offer `dict` attribute anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
35a3d5f7f8 qa/tasks/keystone.py: use list(a_dict) for concatenating lists
`dict.items()` does not return a list in python3, so we need to convert
it to a list first.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
5d0dc8346c qa/tasks/util/rgw: use StringIO for capturing strings
this change should address the failure of
```
2020-04-06T03:07:59.152 ERROR:teuthology.contextutil:Saw exception from nested tasks
Traceback (most recent call last):
  File "/home/teuthworker/src/git.ceph.com_git_teuthology_wip-py3/teuthology/contextutil.py", line 32, in nested
    vars.append(enter())
  File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/rgw.py", line 266, in configure_compression
    rgwadmin(ctx, client, cmd=['user', 'list'], check_status=True)
  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/util/rgw.py", line 43, in rgwadmin
    j = json.loads(out)
  File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
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
51fc7a9922 qa/tasks/fs.py: use six.viewitems()
in python3, dict.viewitems() is replaced with dict.items().

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
8bfe977854 qa/tasks: use StringIO for capturing string output
see d8d44ed156

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08:00
Kefu Chai
253fc93180 test/rgw: 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
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
0930652318 pybind/mgr/dashboard/.pylintrc: drop xrange from the whitelist
since dashboard is now xrange-free, there is no need to have
xrange-builtin in whitelist, moreover, in python3 the error message
cannot be emitted at seeing xrange.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 20:33:47 +08:00
Kefu Chai
ad2bbbc1ed pybind: s/xrange/range/
fortunately, cython does not complain at seeing xrange, but let's drop
the last bit of python2.

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
Jason Dillaman
16e2ccaf14
Merge pull request #33985 from zhengchengyao/clone_metadata
librbd: children should inherit parent's stripe

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Reviewed-by: Mykola Golub <mgolub@suse.com>
2020-04-04 09:46:27 -04:00
Jason Dillaman
448cd3fe9a
Merge pull request #34072 from shangdehao1/fix_nfs_bug
qa/tasks/qemu: fix nfs setup and teardown bug in qemu task

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2020-04-04 09:45:49 -04:00
Josh Durgin
7655548930
Merge pull request #34371 from smithfarm/wip-43896
doc/releases/nautilus: restart OSDs to make them bind to v2 addr

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2020-04-03 14:31:22 -07: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
45288ad525
Merge pull request #33915 from lxbsz/client_assert_failedddd
Client: fix Finisher assert failure

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
2020-04-03 12:49:59 -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
Gregory Farnum
15b3118eda
Merge pull request #34110 from ukernel/wip-44680
mds: don't assert empty io context list when shutting down

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
2020-04-03 12:33:51 -07:00
Sage Weil
004b153f13 Merge PR #34385 into master
* refs/pull/34385/head:
	doc/dev/cephadm: a few notes on developing with cephadm

Reviewed-by: Sebastian Wagner <swagner@suse.com>
2020-04-03 14:29:43 -05:00
Gregory Farnum
13fc503b0f
Merge pull request #34281 from vshankar/wip-44677
mgr: force purge normal ceph entities from service map

Reviewed-by: Kefu Chai <kchai@redhat.com>
2020-04-03 12:29:19 -07:00
Gregory Farnum
794ce8942d
Merge pull request #34306 from ukernel/wip-44771
ceph-fuse: don't get mount options from /etc/fstab when doing remount

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
2020-04-03 12:28:30 -07:00
Sage Weil
857715f7d8 Merge PR #34296 into master
* refs/pull/34296/head:
	qa/suites/rados/cephadm/smoke-roleless: add smoke test
	qa/tasks/cephadm: add 'roleless' mode

Reviewed-by: Sebastian Wagner <swagner@suse.com>
2020-04-03 14:16:21 -05:00
Sage Weil
639762ca26 Merge PR #34384 into master
* refs/pull/34384/head:
	cephadm: create /var/run/ceph dir via unit.run, not unit file

Reviewed-by: Michael Fritch <mfritch@suse.com>
2020-04-03 14:16:00 -05:00
Yuri Weinstein
d23f2b70e8
Merge pull request #34405 from ceph/wip-yuriw-cron-master2
qa/tests: fixed typo
2020-04-03 10:19:17 -07:00
yuriw
898d9c5a60 qa/tests: fixed typo
Signed-off-by: yuriw <yuri.weinstein@gmail.com>
2020-04-03 09:28:05 -07:00
Yuri Weinstein
21e1d54e76
Merge pull request #34404 from ceph/wip-yuriw-cron-master
qa/tests: added client upgrades tests for octopus, removed mimic-x/ma…
2020-04-03 09:21:14 -07:00
yuriw
8c80a43b58 qa/tests: added client upgrades tests for octopus, removed mimic-x/masted as not needed
Signed-off-by: Yuri Weinstein <yweinstein@redhat.com>
2020-04-03 08:57:28 -07:00
Sage Weil
086acd20b9 doc/dev/cephadm: a few notes on developing with cephadm
Signed-off-by: Sage Weil <sage@redhat.com>
2020-04-03 09:42:40 -05:00
Jason Dillaman
cf7c16ca05
Merge pull request #33502 from yison/rwl-image-writeback-cache-seq3
rbd/cache: Replicated Write Log core codes part 3

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2020-04-03 10:39:28 -04:00
Jason Dillaman
524be11882
Merge pull request #34362 from tchaikov/wip-rbd-with-pmem
cmake, librbd: fix build with pmem and cleanups

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2020-04-03 10:08:08 -04:00
Kefu Chai
86c785afb4
Merge pull request #34332 from cyx1231st/wip-seastar-messenger-lossy-peer
crimson/net: enable features for lossy peer connections of heartbeat

Reviewed-by: Kefu Chai <kchai@redhat.com>
2020-04-03 21:26:04 +08:00
Sebastian Wagner
c656e598ba
Merge pull request #34319 from clyso/patch-2
doc/mgr/orchestrator: update cephadm shell proposed alias entry

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
2020-04-03 12:48:11 +02:00
Sebastian Wagner
adedd2f531
Merge pull request #34318 from clyso/patch-1
doc/mgr/orchestrator: add path to ssh-copy-id instructions

Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
2020-04-03 12:44:55 +02:00
Sebastian Wagner
93b908a4dd
Merge pull request #34367 from sebastian-philipp/codeowners-cephadm-update
CODEOWNERS: update cephadm paths

Reviewed-by: Kefu Chai <kchai@redhat.com>
2020-04-03 12:41:34 +02:00
Kefu Chai
b6303828be
Merge pull request #34390 from tchaikov/wip-github-codeowners
.github/CODEOWNERS: add ceph/crimson

Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2020-04-03 17:41:02 +08:00
Lenz Grimmer
b36491c72a
Merge pull request #34325 from tspmelo/wip-npm-update-20-03
mgr/dashboard: Update all npm packages

Reviewed-by: Sebastian Krah <skrah@suse.com>
Reviewed-by: Stephan Müller <smueller@suse.com>
2020-04-03 11:14:50 +02:00