blob: 6fbd77b8fa096d89fd523bd3b3e33d5ba5fbfaa0 [file] [log] [blame]
Joe H. Rahmec54a8632013-10-15 10:09:10 +02001# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
2#
3# Author: Joe H. Rahme <joe.hakim.rahme@enovance.com>
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
16
17
18from tempest.api.object_storage import base
Daisuke Moritad206d3b2013-12-06 15:18:04 +090019from tempest.common import custom_matchers
Masayuki Igawa911148b2014-02-17 15:00:54 +090020from tempest import test
Joe H. Rahmec54a8632013-10-15 10:09:10 +020021
22
23class HealthcheckTest(base.BaseObjectTest):
24
Joe H. Rahmec54a8632013-10-15 10:09:10 +020025 def setUp(self):
26 super(HealthcheckTest, self).setUp()
Joe H. Rahmec54a8632013-10-15 10:09:10 +020027 # Turning http://.../v1/foobar into http://.../
Andrea Frittoli8bbdb162014-01-06 11:06:13 +000028 self.account_client.skip_path()
Joe H. Rahmec54a8632013-10-15 10:09:10 +020029
Masayuki Igawa911148b2014-02-17 15:00:54 +090030 @test.attr('gate')
Joe H. Rahmec54a8632013-10-15 10:09:10 +020031 def test_get_healthcheck(self):
32
Christian Schwedebb3a5232013-12-31 14:49:43 +000033 resp, _ = self.account_client.get("healthcheck", {})
Joe H. Rahmec54a8632013-10-15 10:09:10 +020034
Daisuke Moritad206d3b2013-12-06 15:18:04 +090035 # The target of the request is not any Swift resource. Therefore, the
36 # existence of response header is checked without a custom matcher.
37 self.assertIn('content-length', resp)
38 self.assertIn('content-type', resp)
39 self.assertIn('x-trans-id', resp)
40 self.assertIn('date', resp)
41 # Check only the format of common headers with custom matcher
42 self.assertThat(resp, custom_matchers.AreAllWellFormatted())