#!/bin/bash . config/config.sh || { echo >&2 "sorry, but config/config.sh not found" exit 1 } # (still) local variables distro=fedora distro_ver=20 arch=x86_64 starttime=$(date -u +%Y%m%d_%H%M%S_%N) die() { echo "$@"; exit 1; } prereq_resultdir() { test -d "$DTF_DATABASE" || mkdir -p "$DTF_DATABASE" } unpack_results() { local where="$1" local tmp_results_dir="$2" local workdir=$(mktemp -d "/tmp/.dtf.XXXXXX") || die "can not create workdir" { pushd "$workdir" >/dev/null \ && tar -xf "$tmp_results_dir/dtf.tar.gz" \ && pushd dtf >/dev/null } || die "can not unpack results" for i in *.log; do local task_id="${i%%.log}" local mydir="" # First item in tarball is the "main" directory while read dirname; do test -z "$mydir" && mydir="$dirname" done <<<"$(tar xvf "$task_id.tar.gz")" # Give the unpacked results better name rm "$task_id.tar.gz" mv "$mydir" "$task_id.dir" done { popd && popd ; } > /dev/null { mkdir -p "$(dirname "$where")" \ && mv "$workdir/dtf" "$where" ; } || die "can not create resultdir" } prereq_resultdir workdir=$(mktemp -d "/var/tmp/dtf_postgresql_setup-XXXXXX") ./run_remote \ --distro="$distro" \ --distro-version="$distro_ver" \ --workdir="$workdir" \ --openstack-instance="$DTF_OPENSTACK_ID" \ || die "can not perform run_remote" resultdir="$DTF_DATABASE/$distro/$distro_ver/$arch" unpack_results "$resultdir/result_$starttime" "$workdir" ./runner/result_stats "$resultdir" > "$resultdir/results.html" rsync -r "${DTF_DATABASE%%/}/" "${DTF_PRESENTER_PLACE%%/}"