diff --git a/gabbi_tempest/tests/scenario/__init__.py b/gabbi_tempest/tests/scenario/__init__.py index ebc83bf..0272a33 100755 --- a/gabbi_tempest/tests/scenario/__init__.py +++ b/gabbi_tempest/tests/scenario/__init__.py @@ -51,6 +51,7 @@ class GenericGabbiTest(tempest.test.BaseTestCase): os.environ['SERVICE_TOKEN'] = token os.environ['IMAGE_REF'] = CONF.compute.image_ref os.environ['FLAVOR_REF'] = CONF.compute.flavor_ref + os.environ['FLAVOR_REF_ALT'] = CONF.compute.flavor_ref_alt if cls.service_type in endpoints: host = None diff --git a/gabbi_tempest/tests/scenario/gabbits/multi/base.yaml b/gabbi_tempest/tests/scenario/gabbits/multi/base.yaml index 52280e6..3be8129 100644 --- a/gabbi_tempest/tests/scenario/gabbits/multi/base.yaml +++ b/gabbi_tempest/tests/scenario/gabbits/multi/base.yaml @@ -15,8 +15,8 @@ vars: - &cn1_alloc $ENVIRON['PLACEMENT_SERVICE']/resource_providers/$HISTORY['list hypervisors'].$RESPONSE['$.hypervisors[0].id']/allocations - &cn1_usages $ENVIRON['PLACEMENT_SERVICE']/resource_providers/$HISTORY['list hypervisors'].$RESPONSE['$.hypervisors[0].id']/usages - - &s1_id $HISTORY['get server'].$RESPONSE['$.server.id'] - &s1_url $ENVIRON['COMPUTE_SERVICE']/servers/$HISTORY['get server'].$RESPONSE['$.server.id'] + - &s1_action $ENVIRON['COMPUTE_SERVICE']/servers/$HISTORY['get server'].$RESPONSE['$.server.id']/action - &s1_alloc $ENVIRON['PLACEMENT_SERVICE']/allocations/$HISTORY['get server'].$RESPONSE['$.server.id'] tests: @@ -27,7 +27,7 @@ tests: $.hypervisors.`len`: 1 - name: confirm resource provider - GET: $ENVIRON['PLACEMENT_SERVICE']/resource_providers/$RESPONSE['$.hypervisors[0].id'] + GET: *cn1_rp response_json_paths: $.uuid: $RESPONSE['$.hypervisors[0].id'] @@ -56,7 +56,6 @@ tests: GET: $LOCATION - name: watch allocations - verbose: True GET: *s1_alloc poll: count: 4 @@ -66,6 +65,84 @@ tests: VCPU: 1 MEMORY_MB: 64 + - name: server active + GET: *s1_url + poll: + count: 10 + delay: .5 + response_json_paths: + $.server.status: ACTIVE + + - name: resize server + POST: *s1_action + data: + resize: + flavorRef: $ENVIRON['FLAVOR_REF_ALT'] + OS-DCF:diskConfig: AUTO + status: 202 + + - name: wait for verify resize + GET: *s1_url + poll: + count: 12 + delay: 5 + response_json_paths: + $.server.status: VERIFY_RESIZE + +# These next two fail. We are not managing allocations for local +# resize (yet). + - name: check for double allocations + verbose: True + GET: *s1_alloc + poll: + count: 10 + delay: 1 + response_json_paths: + $.allocations.["$HISTORY['list hypervisors'].$RESPONSE['$.hypervisors[0].id']"].resources: + VCPU: 2 + MEMORY_MB: 192 + + - name: confirm usages pending + verbose: True + GET: *cn1_usages + response_json_paths: + $.usages: + DISK_GB: 0 + MEMORY_MB: 192 + VCPU: 2 + + - name: confirm resize + POST: *s1_action + data: + confirmResize: null + status: 204 + + - name: wait for active + GET: *s1_url + poll: + count: 12 + delay: 5 + response_json_paths: + $.server.status: ACTIVE + + - name: changed to correct allocations + GET: *s1_alloc + poll: + count: 12 + delay: 5 + response_json_paths: + $.allocations.["$HISTORY['list hypervisors'].$RESPONSE['$.hypervisors[0].id']"].resources: + VCPU: 1 + MEMORY_MB: 128 + + - name: confirm usages active + GET: *cn1_usages + response_json_paths: + $.usages: + DISK_GB: 0 + MEMORY_MB: 128 + VCPU: 1 + ### Clean Up - name: delete server @@ -74,7 +151,6 @@ tests: - name: reconfirm empty allocation <<: *cn1_zero - verbose: True poll: count: 10 delay: 1