summaryrefslogtreecommitdiff
path: root/nova/tests/functional/api/openstack/placement/gabbits/resource-provider-duplication.yaml
blob: 9eb60fd9f4c5bacba514919ee1e923d2bb98f861 (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
48
# Verify different error messages was attempting to create a
# resource provider with a duplicated name or UUID.

fixtures:
    - APIFixture

defaults:
    request_headers:
        x-auth-token: admin
        accept: application/json
        content-type: application/json

tests:
- name: post new resource provider
  POST: /resource_providers
  data:
      name: shared disk
      uuid: $ENVIRON['RP_UUID']
  status: 201

- name: same uuid different name
  POST: /resource_providers
  data:
      name: shared disk X
      uuid: $ENVIRON['RP_UUID']
  status: 409
  response_strings:
      - "Conflicting resource provider uuid: $ENVIRON['RP_UUID']"

- name: same name different uuid
  POST: /resource_providers
  data:
      name: shared disk
      uuid: 2c2059d8-005c-4f5c-82b1-b1701b1a29b7
  status: 409
  response_strings:
      - 'Conflicting resource provider name: shared disk'

# On this one, don't test for which field was a duplicate because
# that depends on how the database reports columns.
- name: same name same uuid
  POST: /resource_providers
  data:
      name: $ENVIRON['RP_NAME']
      uuid: $ENVIRON['RP_UUID']
  status: 409
  response_strings:
      - Conflicting resource provider