blob: f5e2443b55a36213c37af3a434651455145a18c2 [file] [log] [blame]
Joe H. Rahmec54a8632013-10-15 10:09:10 +02001# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
2#
Joe H. Rahmec54a8632013-10-15 10:09:10 +02003# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15
16from tempest.api.object_storage import base
Daisuke Moritad206d3b2013-12-06 15:18:04 +090017from tempest.common import custom_matchers
Ken'ichi Ohmichib7bc1de2017-01-27 18:12:22 -080018from tempest.lib import decorators
Joe H. Rahmec54a8632013-10-15 10:09:10 +020019
20
21class HealthcheckTest(base.BaseObjectTest):
zhufl0539a642020-08-18 16:10:03 +080022 """Test healthcheck"""
Joe H. Rahmec54a8632013-10-15 10:09:10 +020023
Joe H. Rahmec54a8632013-10-15 10:09:10 +020024 def setUp(self):
25 super(HealthcheckTest, self).setUp()
Joe H. Rahmec54a8632013-10-15 10:09:10 +020026
Ken'ichi Ohmichib7bc1de2017-01-27 18:12:22 -080027 @decorators.idempotent_id('db5723b1-f25c-49a9-bfeb-7b5640caf337')
Joe H. Rahmec54a8632013-10-15 10:09:10 +020028 def test_get_healthcheck(self):
zhufl0539a642020-08-18 16:10:03 +080029 """Test getting healthcheck"""
Martin Kopec1d500e72019-10-31 13:56:42 +000030 url = self.account_client._get_base_version_url() + "healthcheck"
31 resp, body = self.account_client.raw_request(url, "GET")
32 self.account_client._error_checker(resp, body)
Joe H. Rahmec54a8632013-10-15 10:09:10 +020033
Daisuke Moritad206d3b2013-12-06 15:18:04 +090034 # The target of the request is not any Swift resource. Therefore, the
35 # existence of response header is checked without a custom matcher.
36 self.assertIn('content-length', resp)
37 self.assertIn('content-type', resp)
38 self.assertIn('x-trans-id', resp)
39 self.assertIn('date', resp)
40 # Check only the format of common headers with custom matcher
41 self.assertThat(resp, custom_matchers.AreAllWellFormatted())