]> git.proxmox.com Git - ceph.git/blob - ceph/qa/tasks/mgr/dashboard/test_requests.py
bump version to 18.2.2-pve1
[ceph.git] / ceph / qa / tasks / mgr / dashboard / test_requests.py
1 # -*- coding: utf-8 -*-
2
3 from __future__ import absolute_import
4
5 from . import DEFAULT_API_VERSION
6 from .helper import DashboardTestCase
7
8
9 class RequestsTest(DashboardTestCase):
10 def test_gzip(self):
11 self._get('/api/summary')
12 self.assertHeaders({
13 'Content-Encoding': 'gzip',
14 'Content-Type': 'application/vnd.ceph.api.v{}+json'.format(DEFAULT_API_VERSION)
15 })
16
17 def test_force_no_gzip(self):
18 self._get('/api/summary', headers={'Accept-Encoding': 'identity'})
19 self.assertNotIn('Content-Encoding', self._resp.headers)
20 self.assertHeaders({
21 'Content-Type': 'application/vnd.ceph.api.v{}+json'.format(DEFAULT_API_VERSION)
22 })
23
24 def test_server(self):
25 self._get('/api/summary')
26 self.assertHeaders({
27 'server': 'Ceph-Dashboard',
28 'Content-Type': 'application/vnd.ceph.api.v{}+json'.format(DEFAULT_API_VERSION),
29 'Content-Security-Policy': "frame-ancestors 'self';",
30 'X-Content-Type-Options': 'nosniff',
31 'Strict-Transport-Security': 'max-age=63072000; includeSubDomains; preload'
32 })