summaryrefslogtreecommitdiffstats
path: root/controller
diff options
context:
space:
mode:
Diffstat (limited to 'controller')
-rwxr-xr-xcontroller35
1 files changed, 21 insertions, 14 deletions
diff --git a/controller b/controller
index 938bab5..9770497 100755
--- a/controller
+++ b/controller
@@ -1,6 +1,9 @@
#!/bin/bash
-. config.sh || { echo >&2 "sorry, but config.sh not found" ; exit 1 ; }
+. config/config.sh || {
+ echo >&2 "sorry, but config/config.sh not found"
+ exit 1
+}
# (still) local variables
distro=fedora
@@ -18,31 +21,34 @@ prereq_resultdir()
unpack_results()
{
local where="$1"
+ local tmp_results_dir="$2"
+
local workdir=$(mktemp -d "/tmp/.dtf.XXXXXX") || die "can not create workdir"
- pushd "$workdir"
- tar -xf /var/tmp/dtf.tar.gz
+ { pushd "$workdir" >/dev/null \
+ && tar -xf "$tmp_results_dir/dtf.tar.gz" \
+ && pushd dtf >/dev/null
+ } || die "can not unpack results"
- pushd dtf
for i in *.log; do
- pwd
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
- popd
- popd
-
- mkdir -p "$(dirname "$where")" || die "can not create resultdir"
- mv "$workdir/dtf" "$where"
+ { mkdir -p "$(dirname "$where")" \
+ && mv "$workdir/dtf" "$where" ;
+ } || die "can not create resultdir"
}
prereq_resultdir
@@ -52,9 +58,10 @@ workdir=$(mktemp -d "/var/tmp/dtf_postgresql_setup-XXXXXX")
./run_remote \
--distro="$distro" \
--distro-version="$distro_ver" \
- --workdir="$workdir"
+ --workdir="$workdir" \
+ --openstack-instance="$DTF_OPENSTACK_ID"
resultdir="$DTF_DATABASE/$distro/$distro_ver/$arch"
-unpack_results "$resultdir/result_$starttime"
+unpack_results "$resultdir/result_$starttime" "$workdir"
-./runner/result_stats "$resultdir"
+./runner/result_stats "$resultdir" > "$resultdir/results.html"