diff options
author | Pavel Raiskup <praiskup@redhat.com> | 2014-10-12 14:57:20 +0200 |
---|---|---|
committer | Pavel Raiskup <praiskup@redhat.com> | 2014-10-12 15:42:56 +0200 |
commit | fc3af983f7a74a74b332c2e99b76759e6b4e4374 (patch) | |
tree | 768a681364ed69bac1d6503f13c2289cb5346695 /controller | |
parent | 8957b4e9296777fedf44ee0e71431763b38c2f2a (diff) | |
download | postgresql-setup-tests-fc3af983f7a74a74b332c2e99b76759e6b4e4374.tar.gz postgresql-setup-tests-fc3af983f7a74a74b332c2e99b76759e6b4e4374.tar.xz postgresql-setup-tests-fc3af983f7a74a74b332c2e99b76759e6b4e4374.zip |
controller: create
Controller script runs the script on remote machine (OpenStack),
downloads the results, stores the result into its own
result-database and re-generates statistics for runs done so far.
It will be able to upload the results to "presenter" machine.
* config.sh.template: New doc file.
* controller: New file (the central script for CI).
* runner/result_stats: New file. Based on downloaded results from
testing machine, it generates single html file with stats.
* runner/result_templates/html.tmpl: New file. Template for ^^^.
Diffstat (limited to 'controller')
-rwxr-xr-x | controller | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/controller b/controller new file mode 100755 index 0000000..938bab5 --- /dev/null +++ b/controller @@ -0,0 +1,60 @@ +#!/bin/bash + +. config.sh || { echo >&2 "sorry, but 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 workdir=$(mktemp -d "/tmp/.dtf.XXXXXX") || die "can not create workdir" + + pushd "$workdir" + tar -xf /var/tmp/dtf.tar.gz + + pushd dtf + for i in *.log; do + pwd + local task_id="${i%%.log}" + local mydir="" + while read dirname; do + test -z "$mydir" && mydir="$dirname" + done <<<"$(tar xvf "$task_id.tar.gz")" + + rm "$task_id.tar.gz" + + mv "$mydir" "$task_id.dir" + done + + + popd + popd + + mkdir -p "$(dirname "$where")" || die "can not create resultdir" + mv "$workdir/dtf" "$where" +} + +prereq_resultdir + +workdir=$(mktemp -d "/var/tmp/dtf_postgresql_setup-XXXXXX") + +./run_remote \ + --distro="$distro" \ + --distro-version="$distro_ver" \ + --workdir="$workdir" + +resultdir="$DTF_DATABASE/$distro/$distro_ver/$arch" +unpack_results "$resultdir/result_$starttime" + +./runner/result_stats "$resultdir" |