Commit Graph

216 Commits

Author SHA1 Message Date
Xiubo Li
3b44f20ac0 qa: move the optional client_config parameter to the end
Fixes: https://tracker.ceph.com/issues/53216
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2021-12-01 15:05:58 +08:00
Matt Benjamin
0046803534 qa/rgw: use local runner with cmdline radosgw_admin.py
Restore ability to run radosgw_admin.py unit standalone--improved
to use vstart_runner hooks.

Local rgwadmin(...) wrapper suggested as a cleanup in review by Casey.

Fixes: https://tracker.ceph.com/issues/52837

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
2021-11-17 11:22:32 -05:00
Rishabh Dave
e650bc6e87 qa/vstart_runner: add "managers" to LocalContext instances
Without this plenty tests become incompatible with vstart_runner.py.
Ideally, vstart_runner.py should've been updated in commit 7812cfb674.

Fixes: https://tracker.ceph.com/issues/53043
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-10-26 20:51:09 +05:30
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
ec69208deb Merge PR #38481 into master
* refs/pull/38481/head:
	qa/vstart_runner: inherit methods instead of duplicating them
	qa/ceph_manager: make it possible to reuse few methods
	qa/vstart_runner: don't use "shell=False" in run_ceph_w()
	qa/ceph_manager: minor refactor

Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2021-08-27 21:26:41 -04:00
Kefu Chai
62944aefa0
Merge pull request #42277 from tchaikov/wip-vstart-runner-cleanups
qa/tasks/vstart_runner: do not send SIGTERM if no matched pid

Reviewed-by: Rishabh Dave <ridave@redhat.com>
2021-08-06 10:33:19 +08:00
Rishabh Dave
d86bfbfe2d qa/vstart_runner: inherit methods instead of duplicating them
Inherit methods run_ceph_w(), run_cluster_cmd(), raw_cluster_cmd() and
raw_cluster_cmd_result() from ceph_manager.CephManager in
vstart_runner.LocalCephManager instead of duplicating them.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-08-02 11:37:49 +05:30
Rishabh Dave
047c90f881 qa/vstart_runner: don't use "shell=False" in run_ceph_w()
Instead prepend "exec sudo" to the command arguments of
LocalCephManager.run_ceph_w(). This makes the default parameter
"shell=False" redundant in case of
ceph_manager.CephManager.run_ceph_w(), so get rid of it too and update
calls to run_ceph_w() accordingly.

The reason behind using any of these workarounds is that running "ceph
-w" with "shell" set to True leads to crash for Ceph API CI job. See
this ticket for more details: https://tracker.ceph.com/issues/49644.

The reason behind switching the workaround is that in the following
commits to reduce duplication LocalCephManager.run_ceph_w() will be
deleted and CephManager.run_ceph_w() will be used by LocalCephManager
via inheritance. However, due to the issue described above, Ceph API
test will fail since "shell" is set to "True" for the command issued by
CephManager.run_ceph_w(). Prepending "exec sudo" to the command when it
is used in LocalCephManager makes this duplication unnecessary and also
prevents Ceph API test from failing.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-08-02 11:37:44 +05:30
Kefu Chai
0017df2006 qa/tasks/vstart_runner: add optional "sudo" param to _run_python()
to silence mypy warnings like:

tasks/vstart_runner.py:691: error: Definition of "_run_python" in base class "LocalCephFSMount" is incompatible with definition in base class "CephFSMount"
tasks/vstart_runner.py:705: error: Definition of "_run_python" in base class "LocalCephFSMount" is incompatible with definition in base class "CephFSMount"

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-07-22 10:08:27 +08:00
Patrick Donnelly
9f3e49389b
Merge PR #42029 into master
* refs/pull/42029/head:
	vstart_runner: use FileNotFoundError when os.stat() fails

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
2021-07-13 08:07:22 -07:00
Patrick Donnelly
6470e7cdcd
Merge PR #42030 into master
* refs/pull/42030/head:
	vstart_runner: maintain log level when --debug is passed

Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2021-07-13 08:05:25 -07:00
Patrick Donnelly
a20300d4f0
Merge PR #42033 into master
* refs/pull/42033/head:
	vstart_runner: add log messages to vstart_runner.py

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2021-07-13 08:03:18 -07:00
Kefu Chai
58841419be qa/tasks/vstart_runner: do not send SIGTERM if no matched pid
otherwise following error is expected in some cases:

INFO:__main__:Traceback (most recent call last):
INFO:__main__:  File "/home/jenkins-build/build/workspace/ceph-api/qa/tasks/mgr/test_dashboard.py", line 18, in setUp
INFO:__main__:    self._assign_ports("dashboard", "ssl_server_port")
INFO:__main__:  File "/home/jenkins-build/build/workspace/ceph-api/qa/tasks/mgr/mgr_test_case.py", line 197, in _assign_ports
INFO:__main__:    cls.mgr_cluster.mgr_stop(mgr_id)
INFO:__main__:  File "/home/jenkins-build/build/workspace/ceph-api/qa/tasks/mgr/mgr_test_case.py", line 30, in mgr_stop
INFO:__main__:    self.mgr_daemons[mgr_id].stop()
INFO:__main__:  File "../qa/tasks/vstart_runner.py", line 558, in stop
INFO:__main__:    os.kill(pid, signal.SIGTERM)
INFO:__main__:TypeError: an integer is required (got type NoneType)

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-07-12 13:25:44 +08:00
Kefu Chai
e15ceb6bae qa/tasks/vstart_runner: consolidate logging message in LocalDaemon
it's more readable if we have a single logging message when no matching
pid is found.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-07-12 13:25:44 +08:00
Sage Weil
1bfa812f5d qa/tasks/vstart_runner: add LocalCluster.run
Signed-off-by: Sage Weil <sage@newdream.net>
2021-06-26 08:47:06 -04:00
Rishabh Dave
3fc7003608 vstart_runner: use FileNotFoundError when os.stat() fails
Fixes: https://tracker.ceph.com/issues/51369
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-06-25 21:21:14 +05:30
Rishabh Dave
4733402c4e vstart_runner: add log messages to vstart_runner.py
Add log messages to indicate start and end of execution of stop.sh and
vstart.sh. Running both of these scripts is a major step in execution of
vstart_runner.py and not passing --debug makes it impossible to know
whether these scripts have started or finished running.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-06-25 21:16:19 +05:30
Rishabh Dave
73567a1447 vstart_runner: maintain log level when --debug is passed
When --debug and --clear-old-log options are passed to vstart_runner.py,
it ends up resetting log level to the default level (which is
logging.INFO) despite of --debug. Set "log_level" as default parameter
to init_log() so that the log level code for clearing old log can pass
current logging level to init_log() to maintain the log level user
desired for.

Fixes: https://tracker.ceph.com/issues/51344
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-06-24 18:07:49 +05:30
Patrick Donnelly
2a81253141
Merge PR #40412 into master
* refs/pull/40412/head:
	vstart_runner: reuse code in LocalRemoteProcess

Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2021-04-15 21:05:51 -07:00
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
Alfonso Martínez
45e1134e3b qa/tasks/vstart_runner.py: start max required mgrs
Pass environment copy with max required mgrs when shell kwarg is True.

Fixes: https://tracker.ceph.com/issues/50077
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
2021-03-31 10:11:50 +02:00
Kefu Chai
73925c488a
Merge pull request #39969 from batrick/i49684
qa: wait for daemons to come up via cephadm

Reviewed-by: Sage Weil <sage@redhat.com>
2021-03-28 20:01:32 +08:00
Rishabh Dave
dbe002ef64 vstart_runner: reuse code in LocalRemoteProcess
Reduce duplication in LocalRemoteProcess.wait() and
LocalRemoteProcess.finished() by moving the common code to a separate
method and then using that separate method instead.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-03-25 20:28:05 +05:30
Patrick Donnelly
7d412b86d0
Merge PR #40174 into master
* refs/pull/40174/head:
	qa/vstart_runner: fix the admin_socket args parsing

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Rishabh Dave <ridave@redhat.com>
2021-03-22 20:05:29 -07:00
Patrick Donnelly
42270a5338
Merge PR #38443 into master
* refs/pull/38443/head:
	qa: set "shell" to False for run_ceph_w()
	vstart_runner: make "shell" a default argument

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
2021-03-22 20:00:46 -07:00
Patrick Donnelly
5292e88201
qa: reduce dependence on teuthology role list for mds
It's not yet possible to completely remove the dependency on
mds_ids/mds_daemons in the CephFS tests but this commit reduces it
enough for most code paths to work with cephadm.

The main change here is use of CephManager.do_rados, with some
improvements.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-03-21 10:35:07 -07:00
Xiubo Li
e0e5eb4c93 qa/vstart_runner: fix the admin_socket args parsing
Fixes: https://tracker.ceph.com/issues/49621
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2021-03-17 21:54:50 +08:00
Patrick Donnelly
facd7a59ae
Merge PR #39847 into master
* refs/pull/39847/head:
	qa/cephfs: don't expect "file exists" error for "mkdir -p"
	qa/cephfs: don't take parameter cwd in _create_mntpt()

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
2021-03-16 20:21:52 -07:00
Rishabh Dave
df88ec3822 qa: set "shell" to False for run_ceph_w()
Setting shell to True in call to run() in LocalCephManager.run_ceph_w()
leads to a crash when self.subproc.communicate() is executed for the
process created by running "ceph -w".

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-03-12 09:03:13 +05:30
Rishabh Dave
391e5b19fc vstart_runner: make "shell" a default argument
Add "shell" as a parameter for LocalRemoteProcess._do_run() and set its
default value to True. This is necessary to align the interface that
executes the commands for the teuthology and for vstart_runner.py which
reduces compatibility bugs between vstart_runner and teuthology for
tests.

Also, update the part where LocalRemote._do_run() sets shell to True
based on whether or not list contains an instance of class Raw.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-03-12 09:01:58 +05:30
Sebastian Wagner
340281fe76 qa/tasks: some type annotations
Mostly for making my IDE aware of things

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
2021-03-10 15:02:41 +01:00
Rishabh Dave
60d5d7cf9c qa/cephfs: don't expect "file exists" error for "mkdir -p"
Get rid of try-except block in _create_mntpt() since "mkdir -p" doesn't
raise any error when the directory to be created already exists. Also,
use chmod command instead of mkdir command to set the permission mode on
directory since mkdir command would have no effect on the directory's
permission mode if the directory already exists.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-03-10 12:05:15 +05:30
Rishabh Dave
1b34665741 qa/cephfs: don't take parameter cwd in _create_mntpt()
Accepting "cwd" as a parameter in _create_mntpt() methods was a mistake
that happened commit 5e71e9b065.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-03-10 12:04:41 +05:30
Patrick Donnelly
1cbad56fd2
Merge PR #37711 into master
* refs/pull/37711/head:
	qa/cephfs: create class LocalCephFSMount
	vstart_runner: reuse FuseMount methods in LocalFuseMount
	vstart_runner: reuse KernelMount methods in LocalKernelMount
	qa/cephfs: move common and generic methods mount.py
	qa/cephfs: refactor FuseMount.mount method
	qa/cephfs: refactor KernelMount.mount method

Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2021-03-09 13:41:53 -08: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
Kefu Chai
3cdb88b0ac
Merge pull request #39690 from rishabh-d-dave/qa-raw_cluster_cmd
qa/ceph_manger: fixes bugs in CephManager

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2021-03-07 23:51:05 +08:00
Rishabh Dave
66a87d21ed qa/cephfs: create class LocalCephFSMount
This would contain methods common to LocalKernelMount and
LocalFuseMount.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-03-05 10:03:14 +05:30
Rishabh Dave
2716c98ce9 vstart_runner: reuse FuseMount methods in LocalFuseMount
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-03-05 10:03:14 +05:30
Rishabh Dave
eeba70eae8 vstart_runner: reuse KernelMount methods in LocalKernelMount
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-03-05 10:03:14 +05:30
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
7bb6845e87
Merge PR #39682 into master
* refs/pull/39682/head:
	vstart_runner: remove duplicate methods from LocalCephManager

Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2021-03-03 10:05:35 -08:00
Patrick Donnelly
3107a1f1f8
Merge PR #39780 into master
* refs/pull/39780/head:
	qa/vstart_runner: dont log "not Ceph bin" msg too often

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
2021-03-03 10:04:23 -08:00
Rishabh Dave
b2030edc15 qa/vstart_runner: dont log "not Ceph bin" msg too often
The message is logged everytime a binary not from Ceph repo's build
directory is executed, which it too often.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-03-02 16:41:09 +05:30
Rishabh Dave
793980ec0e qa: don't override with args when it's empty
In methods raw_cluster_cmd_result() of CephManager and LocalCephManager
and raw_cluster_cmd of LocalCephManager when keyword arguments are
passed instead of positional arguments, the methods run ceph command
with no arguments. This is because the methods do
"kwargs['args'] = args" unconditionally.

Fixes: https://tracker.ceph.com/issues/49486
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-03-01 18:38:55 +05:30
Rishabh Dave
9f827a7b90 vstart_runner: remove duplicate methods from LocalCephManager
LocalCephManager already inherits these methods from CephManager.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-02-25 11:04:18 +05:30
Rishabh Dave
1045cd2334 vstart_runner: define path to ceph binary and use it
... instead of joining path to <ceph-repo-root>/build/bin/ directory to
'ceph' everytime.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-02-25 11:00:54 +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
Patrick Donnelly
488f10c62f
qa: move cephfs_ec_profile under cephfs
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-01-07 12:55:25 -08:00