summaryrefslogtreecommitdiffstats
path: root/tests/ci/load_images.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ci/load_images.sh')
-rwxr-xr-xtests/ci/load_images.sh63
1 files changed, 39 insertions, 24 deletions
diff --git a/tests/ci/load_images.sh b/tests/ci/load_images.sh
index 49b972777..e1d717749 100755
--- a/tests/ci/load_images.sh
+++ b/tests/ci/load_images.sh
@@ -12,6 +12,18 @@
set -e
+YARD_IMG_ARCH=amd64
+export YARD_IMG_ARCH
+
+if ! grep -q "Defaults env_keep += \"YARD_IMG_ARCH\"" "/etc/sudoers"; then
+ sudo echo "Defaults env_keep += \"YARD_IMG_ARCH YARDSTICK_REPO_DIR\"" >> /etc/sudoers
+fi
+
+ARCH_SCRIPT="test -f /etc/fuel_openstack_arch && grep -q arm64 /etc/fuel_openstack_arch"
+if [ "$INSTALLER_TYPE" == "fuel" ]; then
+ sshpass -p r00tme ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root $INSTALLER_IP "${ARCH_SCRIPT}" && YARD_IMG_ARCH=arm64
+fi
+
UCA_HOST="cloud-images.ubuntu.com"
if [ $YARD_IMG_ARCH = "arm64" ]; then
export VIVID_IMG_URL="http://${UCA_HOST}/vivid/current/vivid-server-cloudimg-arm64.tar.gz"
@@ -63,11 +75,12 @@ load_yardstick_image()
if [ ! -f $VIVID_KERNEL ]; then
tar zxf $VIVID_IMAGE $(basename $VIVID_KERNEL)
fi
- create_vivid_kernel=$(glance --os-image-api-version 1 image-create \
- --name yardstick-vivid-kernel \
- --is-public true --disk-format qcow2 \
+ create_vivid_kernel=$(openstack image create \
+ --public \
+ --disk-format qcow2 \
--container-format bare \
- --file $VIVID_KERNEL)
+ --file $VIVID_KERNEL \
+ yardstick-vivid-kernel)
GLANCE_KERNEL_ID=$(echo "$create_vivid_kernel" | grep " id " | awk '{print $(NF-1)}')
if [ -z "$GLANCE_KERNEL_ID" ]; then
@@ -89,19 +102,21 @@ load_yardstick_image()
fi
if [[ "$DEPLOY_SCENARIO" == *"-lxd-"* ]]; then
- output=$(eval glance --os-image-api-version 1 image-create \
- --name yardstick-trusty-server \
- --is-public true --disk-format root-tar \
+ output=$(eval openstack image create \
+ --public \
+ --disk-format root-tar \
--container-format bare \
$EXTRA_PARAMS \
- --file $RAW_IMAGE)
+ --file $RAW_IMAGE \
+ yardstick-image)
else
- output=$(eval glance --os-image-api-version 1 image-create \
- --name yardstick-trusty-server \
- --is-public true --disk-format qcow2 \
+ output=$(eval openstack image create \
+ --public \
+ --disk-format qcow2 \
--container-format bare \
$EXTRA_PARAMS \
- --file $QCOW_IMAGE)
+ --file $QCOW_IMAGE \
+ yardstick-image)
fi
echo "$output"
@@ -135,12 +150,12 @@ load_cirros_image()
EXTRA_PARAMS=$EXTRA_PARAMS" --property hw_mem_page_size=large"
fi
- output=$(glance image-create \
- --name cirros-0.3.3 \
+ output=$(openstack image create \
--disk-format qcow2 \
--container-format bare \
$EXTRA_PARAMS \
- --file $image_file)
+ --file $image_file \
+ cirros-0.3.3)
echo "$output"
CIRROS_IMAGE_ID=$(echo "$output" | grep " id " | awk '{print $(NF-1)}')
@@ -165,12 +180,12 @@ load_ubuntu_image()
EXTRA_PARAMS=$EXTRA_PARAMS" --property hw_mem_page_size=large"
fi
- output=$(glance image-create \
- --name Ubuntu-14.04 \
+ output=$(openstack image create \
--disk-format qcow2 \
--container-format bare \
$EXTRA_PARAMS \
- --file $ubuntu_image_file)
+ --file $ubuntu_image_file \
+ Ubuntu-14.04)
echo "$output"
UBUNTU_IMAGE_ID=$(echo "$output" | grep " id " | awk '{print $(NF-1)}')
@@ -185,26 +200,26 @@ load_ubuntu_image()
create_nova_flavor()
{
- if ! nova flavor-list | grep -q yardstick-flavor; then
+ if ! openstack flavor list | grep -q yardstick-flavor; then
echo
echo "========== Create nova flavor =========="
# Create the nova flavor used by some sample test cases
- nova flavor-create yardstick-flavor 100 512 3 1
+ openstack flavor create --id 100 --ram 512 --disk 3 --vcpus 1 yardstick-flavor
# DPDK-enabled OVS requires guest memory to be backed by large pages
if [[ "$DEPLOY_SCENARIO" == *"-ovs-"* ]]; then
- nova flavor-key yardstick-flavor set hw:mem_page_size=large
+ openstack flavor set --property hw:mem_page_size=large yardstick-flavor
fi
# VPP requires guest memory to be backed by large pages
if [[ "$DEPLOY_SCENARIO" == *"-fdio-"* ]]; then
- nova flavor-key yardstick-flavor set hw:mem_page_size=large
+ openstack flavor set --property hw:mem_page_size=large yardstick-flavor
fi
fi
}
main()
{
- QCOW_IMAGE="/tmp/workspace/yardstick/yardstick-trusty-server.img"
- RAW_IMAGE="/tmp/workspace/yardstick/yardstick-trusty-server.tar.gz"
+ QCOW_IMAGE="/tmp/workspace/yardstick/yardstick-image.img"
+ RAW_IMAGE="/tmp/workspace/yardstick/yardstick-image.tar.gz"
build_yardstick_image
load_yardstick_image