summaryrefslogtreecommitdiff
path: root/nova/tests/functional/api/openstack/placement/gabbits/allocation-bad-class.yaml
blob: ec08406419b8ff6e310ca7c9ecaa0cbdf1224e5b (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77

fixtures:
    - APIFixture

defaults:
    request_headers:
        x-auth-token: admin
        accept: application/json
        content-type: application/json
        # Using <= 1.11 allows the PUT /allocations/{uuid} below
        # to work with the older request form.
        openstack-api-version: placement 1.11

tests:

- name: create a resource provider
  POST: /resource_providers
  data:
      name: an rp
  status: 201

- name: get resource provider
  GET: $LOCATION
  status: 200

- name: create a resource class
  PUT: /resource_classes/CUSTOM_GOLD
  status: 201

- name: add inventory to an rp
  PUT: /resource_providers/$HISTORY['get resource provider'].$RESPONSE['$.uuid']/inventories
  data:
      resource_provider_generation: 0
      inventories:
          VCPU:
              total: 24
          CUSTOM_GOLD:
              total: 5
  status: 200

- name: allocate some of it two
  desc: this is the one that used to raise a 500
  PUT: /allocations/6d9f83db-6eb5-49f6-84b0-5d03c6aa9fc8
  data:
      allocations:
          - resource_provider:
                uuid: $HISTORY['get resource provider'].$RESPONSE['$.uuid']
            resources:
                DISK_GB: 5
                CUSTOM_GOLD: 1
      project_id: 42a32c07-3eeb-4401-9373-68a8cdca6784
      user_id: 66cb2f29-c86d-47c3-8af5-69ae7b778c70
  status: 409

- name: allocate some of it custom
  PUT: /allocations/6d9f83db-6eb5-49f6-84b0-5d03c6aa9fc8
  data:
      allocations:
          - resource_provider:
                uuid: $HISTORY['get resource provider'].$RESPONSE['$.uuid']
            resources:
                CUSTOM_GOLD: 1
      project_id: 42a32c07-3eeb-4401-9373-68a8cdca6784
      user_id: 66cb2f29-c86d-47c3-8af5-69ae7b778c70
  status: 204

- name: allocate some of it standard
  PUT: /allocations/6d9f83db-6eb5-49f6-84b0-5d03c6aa9fc8
  data:
      allocations:
          - resource_provider:
                uuid: $HISTORY['get resource provider'].$RESPONSE['$.uuid']
            resources:
                DISK_GB: 1
      project_id: 42a32c07-3eeb-4401-9373-68a8cdca6784
      user_id: 66cb2f29-c86d-47c3-8af5-69ae7b778c70
  status: 409