summaryrefslogtreecommitdiff
path: root/nova/tests/functional/api/openstack/placement/gabbits/cors.yaml
blob: 291e1d5f7085e8f24f306579b14b4224bef1b28c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Confirm that CORS is present. No complex configuration is done so
# this just tests the basics. Borrowed, in spirit, from
# nova.tests.functional.test_middleware.

fixtures:
    - CORSFixture

defaults:
    request_headers:
        x-auth-token: user

tests:
- name: valid options request
  OPTIONS: /
  request_headers:
      origin: http://valid.example.com
      access-control-request-method: GET
  status: 200
  response_headers:
      access-control-allow-origin: http://valid.example.com

- name: invalid options request
  OPTIONS: /
  request_headers:
      origin: http://invalid.example.com
      access-control-request-method: GET
  status: 200
  response_forbidden_headers:
      - access-control-allow-origin

- name: valid get request
  GET: /
  request_headers:
      origin: http://valid.example.com
      access-control-request-method: GET
  status: 200
  response_headers:
      access-control-allow-origin: http://valid.example.com

- name: invalid get request
  GET: /
  request_headers:
      origin: http://invalid.example.com
      access-control-request-method: GET
  status: 200
  response_forbidden_headers:
      - access-control-allow-origin