summaryrefslogtreecommitdiff
path: root/integration
diff options
context:
space:
mode:
authorLingxian Kong <anlin.kong@gmail.com>2020-06-12 22:03:17 +1200
committerLingxian Kong <anlin.kong@gmail.com>2020-06-12 22:41:23 +1200
commit428e3644f8770a608f6e4dfc617f45f6e17cb685 (patch)
treeadc1bcbbb51f3c0c3c9a3c5d7a0258ecd4d7e0ce /integration
parent4bf6c496bb63123b363498141b06a4c131f83c59 (diff)
downloadtrove-428e3644f8770a608f6e4dfc617f45f6e17cb685.tar.gz
Support image type for guest image building
Change-Id: I8d640c47f00446d7f912ece9892b17585cde3add
Diffstat (limited to 'integration')
-rw-r--r--integration/scripts/functions_qemu4
1 files changed, 3 insertions, 1 deletions
diff --git a/integration/scripts/functions_qemu b/integration/scripts/functions_qemu
index 783ae9c6..395756fc 100644
--- a/integration/scripts/functions_qemu
+++ b/integration/scripts/functions_qemu
@@ -11,13 +11,14 @@ function build_guest_image() {
local dev_mode=$3
local guest_username=$4
local image_output=$5
+ local image_type=${image_output##*.}
+ local working_dir=$(dirname ${image_output})
local elementes="base vm"
local trove_elements_path=${PATH_TROVE}/integration/scripts/files/elements
local GUEST_IMAGESIZE=${GUEST_IMAGESIZE:-3}
local GUEST_CACHEDIR=${GUEST_CACHEDIR:-"$HOME/.cache/image-create"}
rm -rf ${GUEST_CACHEDIR}
- local working_dir=$(dirname ${image_output})
export GUEST_USERNAME=${guest_username}
export HOST_SCP_USERNAME=${HOST_SCP_USERNAME:-$(whoami)}
@@ -62,6 +63,7 @@ function build_guest_image() {
disk-image-create -x \
-a amd64 \
-o ${image_output} \
+ -t ${image_type} \
--image-size ${GUEST_IMAGESIZE} \
--image-cache ${GUEST_CACHEDIR} \
$elementes