Debian Codegraph @

blazar_tempest_plugin/tests/api/gabbits/allocations.yaml

raw
1 fixtures:
2 - AuthenticationFixture
3
4 defaults:
5 request_headers:
6 accept: application/json
7 content-type: application/json
8 X-Auth-Token: $ENVIRON['OS_TOKEN']
9
10 tests:
11 - name: get host name
12 GET: compute/v2.1/os-hypervisors
13 status: 200
14
15 - name: post new host
16 POST: reservation/v1/os-hosts
17 data:
18 name: $HISTORY['get host name'].$RESPONSE['$.hypervisors[0].hypervisor_hostname']
19 status: 201
20
21 - name: post new lease lease1
22 POST: reservation/v1/leases
23 data:
24 name: lease1
25 start_date: "2050-01-01 10:00"
26 end_date: "2050-01-01 11:00"
27 reservations:
28 - resource_type: physical:host
29 min: 1
30 max: 1
31 hypervisor_properties: "[]"
32 resource_properties: "[]"
33 status: 201
34
35 - name: post new lease lease2
36 POST: reservation/v1/leases
37 data:
38 name: lease2
39 start_date: "2050-01-01 12:00"
40 end_date: "2050-01-01 13:00"
41 reservations:
42 - resource_type: physical:host
43 min: 1
44 max: 1
45 hypervisor_properties: "[]"
46 resource_properties: "[]"
47 status: 201
48
49 - name: list host allocations
50 GET: reservation/v1/os-hosts/allocations
51 response_json_paths:
52 $.allocations..reservations.`len`: 2
53
54 - name: list host allocations with lease2
55 GET: reservation/v1/os-hosts/allocations
56 query_parameters:
57 lease_id: $HISTORY['post new lease lease2'].$RESPONSE['$.lease.id']
58 response_json_paths:
59 $.allocations.`len`: 1
60
61 - name: delete lease2
62 DELETE: reservation/v1/leases/$HISTORY['post new lease lease2'].$RESPONSE['$.lease.id']
63 status: 204
64
65 - name: delete lease1
66 DELETE: reservation/v1/leases/$HISTORY['post new lease lease1'].$RESPONSE['$.lease.id']
67 status: 204
68
69 - name: delete host
70 DELETE: reservation/v1/os-hosts/$HISTORY['post new host'].$RESPONSE['$.host.id']
71 status: 204