Skip to content

Commit

Permalink
tests/rgw: add timeout 5s to radosgw-admin command
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dsavineau committed Aug 27, 2021
1 parent 2630f8d commit f01ae82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/functional/tests/rgw/test_rgw_tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ def test_rgw_bucket_default_quota_is_set(self, node, host, setup):

@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']
)
Expand Down

0 comments on commit f01ae82

Please sign in to comment.