]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests/rgw: add timeout 5s to radosgw-admin command
authorDimitri Savineau <dsavinea@redhat.com>
Tue, 10 Aug 2021 15:57:01 +0000 (11:57 -0400)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Fri, 27 Aug 2021 17:50:20 +0000 (13:50 -0400)
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 <dsavinea@redhat.com>
tests/functional/tests/rgw/test_rgw_tuning.py

index e218878c42713806b6ef4ee922b0833db5950401..f360c4d38e6ff6d1e4b9e7dd1a5b03014b1008c1 100644 (file)
@@ -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']
             )