Joe H. Rahme | c54a863 | 2013-10-15 10:09:10 +0200 | [diff] [blame] | 1 | # 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 | |
| 18 | from tempest.api.object_storage import base |
Daisuke Morita | d206d3b | 2013-12-06 15:18:04 +0900 | [diff] [blame] | 19 | from tempest.common import custom_matchers |
Masayuki Igawa | 911148b | 2014-02-17 15:00:54 +0900 | [diff] [blame] | 20 | from tempest import test |
Joe H. Rahme | c54a863 | 2013-10-15 10:09:10 +0200 | [diff] [blame] | 21 | |
| 22 | |
| 23 | class HealthcheckTest(base.BaseObjectTest): |
| 24 | |
Joe H. Rahme | c54a863 | 2013-10-15 10:09:10 +0200 | [diff] [blame] | 25 | def setUp(self): |
| 26 | super(HealthcheckTest, self).setUp() |
Joe H. Rahme | c54a863 | 2013-10-15 10:09:10 +0200 | [diff] [blame] | 27 | # Turning http://.../v1/foobar into http://.../ |
Andrea Frittoli | 8bbdb16 | 2014-01-06 11:06:13 +0000 | [diff] [blame] | 28 | self.account_client.skip_path() |
Joe H. Rahme | c54a863 | 2013-10-15 10:09:10 +0200 | [diff] [blame] | 29 | |
Masayuki Igawa | 911148b | 2014-02-17 15:00:54 +0900 | [diff] [blame] | 30 | @test.attr('gate') |
Joe H. Rahme | c54a863 | 2013-10-15 10:09:10 +0200 | [diff] [blame] | 31 | def test_get_healthcheck(self): |
| 32 | |
Christian Schwede | bb3a523 | 2013-12-31 14:49:43 +0000 | [diff] [blame] | 33 | resp, _ = self.account_client.get("healthcheck", {}) |
Joe H. Rahme | c54a863 | 2013-10-15 10:09:10 +0200 | [diff] [blame] | 34 | |
Daisuke Morita | d206d3b | 2013-12-06 15:18:04 +0900 | [diff] [blame] | 35 | # 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()) |