Skip to content

Commit dc9a1e2

Browse files
committed
Add script based on cloudkitty docs
1 parent 3b6d5ca commit dc9a1e2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

ci/run_cloudkitty_tests.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- vars/osp18_env.yml
1414
tasks:
1515
- block:
16+
# TODO: consider mounting these dirs into the pod
1617
#- name: Include vars from the extra_vars files
1718
# ansible.builtin.include_vars:
1819
# dir: "{{ cifmw_basedir }}/artifacts/parameters"
@@ -27,3 +28,20 @@
2728
ansible.builtin.shell:
2829
cmd: |
2930
{{ openstack_cmd }} rating module list
31+
export SERVICE_NAME=test_service_instance
32+
export GROUP_NAME=test_group_instance_uptime_flavor_id
33+
export FIELD_NAME="flavor_id"
34+
35+
{{ openstack_cmd }} rating hashmap group create $GROUP_NAME || true
36+
export GROUP_ID=$({{ openstack_cmd }} rating hashmap group list -f value -c Name -c 'Group ID' | grep $GROUP_NAME| awk '{ print $2}')
37+
38+
{{ openstack_cmd }} rating hashmap service create $SERVICE_NAME || true
39+
export SERVICE_ID=$({{ openstack_cmd }} rating hashmap service list -f value -c Name -c 'Service ID' | grep $SERVICE_NAME | awk '{ print $2 }')
40+
41+
{{ openstack_cmd }} rating hashmap field create $SERVICE_ID $FIELD_NAME || true
42+
export FLAVOR_FIELD_ID=$({{ openstack_cmd }} rating hashmap field list $SERVICE_ID -f value -c Name -c 'Field ID' | grep $FIELD_NAME | awk '{ print $2}')
43+
44+
export FLAVOR_NAME=m1.small
45+
export FLAVOR_ID=$({{ openstack_cmd }} flavor list -f value -c Name -c ID | grep $FLAVOR_NAME | awk '{print $2}')
46+
47+
{{ openstack_cmd }} rating hashmap mapping create 0.01 --field-id $FLAVOR_FIELD_ID --value $FLAVOR_ID -g $GROUP_ID -t flat

0 commit comments

Comments
 (0)