blob: a186f9ee68c359f82c27f987dac5fb37cc8b539c [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):
22
Joe H. Rahmec54a8632013-10-15 10:09:10 +020023 def setUp(self):
24 super(HealthcheckTest, self).setUp()
Joe H. Rahmec54a8632013-10-15 10:09:10 +020025 # Turning http://.../v1/foobar into http://.../
Andrea Frittoli8bbdb162014-01-06 11:06:13 +000026 self.account_client.skip_path()
Joe H. Rahmec54a8632013-10-15 10:09:10 +020027
Ken'ichi Ohmichib7bc1de2017-01-27 18:12:22 -080028 @decorators.idempotent_id('db5723b1-f25c-49a9-bfeb-7b5640caf337')
Joe H. Rahmec54a8632013-10-15 10:09:10 +020029 def test_get_healthcheck(self):
30
Christian Schwedebb3a5232013-12-31 14:49:43 +000031 resp, _ = self.account_client.get("healthcheck", {})
Joe H. Rahmec54a8632013-10-15 10:09:10 +020032
Daisuke Moritad206d3b2013-12-06 15:18:04 +090033 # The target of the request is not any Swift resource. Therefore, the
34 # existence of response header is checked without a custom matcher.
35 self.assertIn('content-length', resp)
36 self.assertIn('content-type', resp)
37 self.assertIn('x-trans-id', resp)
38 self.assertIn('date', resp)
39 # Check only the format of common headers with custom matcher
40 self.assertThat(resp, custom_matchers.AreAllWellFormatted())