X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=tools%2Fyardstick-img-lxd-modify;h=b977d2a5217e5c34dfbb2315f2a5bace50d63de8;hb=fbf9928d76f2d52d5f4687d942d60120db792b7e;hp=31194554c94d865cf159bd02f2d68e7a6d9ecb78;hpb=48bd9f30930e5a241e098acbba674e3f8bb5935d;p=yardstick.git diff --git a/tools/yardstick-img-lxd-modify b/tools/yardstick-img-lxd-modify index 31194554c..b977d2a52 100755 --- a/tools/yardstick-img-lxd-modify +++ b/tools/yardstick-img-lxd-modify @@ -32,35 +32,36 @@ die() { exit 1 } -test $# -eq 1 || die "no image specific script as argument" +test $# -eq 1 -o $# -eq 2 || die "no image specific script as argument" test $(id -u) -eq 0 || die "should invoke using sudo" cmd=$1 +RELEASE=$2 test -x $cmd mountdir="/mnt/yardstick" workspace=${WORKSPACE:-"/tmp/workspace/yardstick"} host=${HOST:-"cloud-images.ubuntu.com"} -release=${RELEASE:-"trusty"} +release=${RELEASE:-"xenial"} image_path="${release}/current/${release}-server-cloudimg-amd64-root.tar.gz" image_url=${IMAGE_URL:-"https://${host}/${image_path}"} -md5sums_path="${release}/current/MD5SUMS" -md5sums_url=${MD5SUMS_URL:-"https://${host}/${md5sums_path}"} +sha256sums_path="${release}/current/SHA256SUMS" +sha256sums_url=${SHA256SUMS_URL:-"https://${host}/${sha256sums_path}"} -imgfile="${workspace}/yardstick-${release}-server.tar.gz" +imgfile="${workspace}/yardstick-image.tar.gz" filename=$(basename $image_url) # download and checksum base image, conditionally if local copy is outdated download() { test -d $workspace || mkdir -p $workspace cd $workspace - rm -f MD5SUMS # always download the checksum file to a detect stale image - wget $md5sums_url + rm -f SHA256SUMS # always download the checksum file to a detect stale image + wget $sha256sums_url test -e $filename || wget -nc --progress=dot:giga $image_url - grep $filename MD5SUMS | md5sum -c || + grep $filename SHA256SUMS | sha256sum -c || if [ $? -ne 0 ]; then rm $filename wget -nc --progress=dot:giga $image_url - grep $filename MD5SUMS | md5sum -c + grep $filename SHA256SUMS | sha256sum -c fi cd - }