From f01ae82eeccb1c3ebc97a84b0d8a547f360741d3 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Tue, 10 Aug 2021 11:57:01 -0400 Subject: [PATCH] tests/rgw: add timeout 5s to radosgw-admin command If the radosgw daemons aren't up and running correctly (like not registered in the servicemap or the OSD are down) then the radosgw-admin will hang forever. Jenkins will kill the jobs after 3h but we don't want to wait until this global timeout. Adding the timeout 5 command to the radosgw-admin commands (which is already present on other ceph calls) allows the job to fail earlier. Signed-off-by: Dimitri Savineau --- tests/functional/tests/rgw/test_rgw_tuning.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/tests/rgw/test_rgw_tuning.py b/tests/functional/tests/rgw/test_rgw_tuning.py index e218878c4..f360c4d38 100644 --- a/tests/functional/tests/rgw/test_rgw_tuning.py +++ b/tests/functional/tests/rgw/test_rgw_tuning.py @@ -13,13 +13,13 @@ class TestRGWs(object): @pytest.mark.no_docker def test_rgw_bucket_default_quota_is_applied(self, node, host, setup): - radosgw_admin_cmd = "sudo radosgw-admin --cluster={cluster} -n client.rgw.{hostname}.rgw0 --keyring /var/lib/ceph/radosgw/{cluster}-rgw.{hostname}.rgw0/keyring user info --uid=test".format( # noqa E501 + radosgw_admin_cmd = "timeout --foreground -s KILL 5 sudo radosgw-admin --cluster={cluster} -n client.rgw.{hostname}.rgw0 --keyring /var/lib/ceph/radosgw/{cluster}-rgw.{hostname}.rgw0/keyring user info --uid=test".format( # noqa E501 hostname=node["vars"]["inventory_hostname"], cluster=setup['cluster_name'] ) radosgw_admin_output = host.run(radosgw_admin_cmd) if radosgw_admin_output.rc == 22: - radosgw_admin_cmd = "sudo radosgw-admin --cluster={cluster} -n client.rgw.{hostname}.rgw0 --keyring /var/lib/ceph/radosgw/{cluster}-rgw.{hostname}.rgw0/keyring user create --uid=test --display-name Test".format( # noqa E501 + radosgw_admin_cmd = "timeout --foreground -s KILL 5 sudo radosgw-admin --cluster={cluster} -n client.rgw.{hostname}.rgw0 --keyring /var/lib/ceph/radosgw/{cluster}-rgw.{hostname}.rgw0/keyring user create --uid=test --display-name Test".format( # noqa E501 hostname=node["vars"]["inventory_hostname"], cluster=setup['cluster_name'] ) -- 2.39.5