stackenv 1.1 KB

1234567891011121314151617181920212223242526
  1. # Prep the testing environment by creating the required testing resources and
  2. # environment variables. This env is for theopenlab CI jobs, you might need
  3. # to modify this according to your setup
  4. pushd /opt/stack/new/devstack
  5. source openrc admin admin
  6. openstack flavor create m1.acctest --id 99 --ram 512 --disk 5 --vcpu 1 --ephemeral 10
  7. openstack flavor create m1.resize --id 98 --ram 512 --disk 6 --vcpu 1 --ephemeral 10
  8. _NETWORK_ID=$(openstack network show private -c id -f value)
  9. _EXTGW_ID=$(openstack network show public -c id -f value)
  10. _IMAGE=$(openstack image list | grep -i cirros | head -n 1)
  11. _IMAGE_ID=$(echo $_IMAGE | awk -F\| '{print $2}' | tr -d ' ')
  12. _IMAGE_NAME=$(echo $_IMAGE | awk -F\| '{print $3}' | tr -d ' ')
  13. echo export OS_IMAGE_NAME="$_IMAGE_NAME" >> openrc
  14. echo export OS_IMAGE_ID="$_IMAGE_ID" >> openrc
  15. echo export OS_NETWORK_ID=$_NETWORK_ID >> openrc
  16. echo export OS_EXTGW_ID=$_EXTGW_ID >> openrc
  17. echo export OS_POOL_NAME="public" >> openrc
  18. echo export OS_FLAVOR_ID=99 >> openrc
  19. echo export OS_FLAVOR_ID_RESIZE=98 >> openrc
  20. echo export OS_SHARE_NETWORK_ID=foobar >> openrc
  21. echo export OS_DOMAIN_ID=default >> openrc
  22. source openrc admin admin
  23. popd