diff options
author | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-01-25 13:49:40 +0000 |
---|---|---|
committer | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-01-25 13:49:40 +0000 |
commit | ea5dce37921550e1d05914943f190185d6cf78be (patch) | |
tree | 7276e663bd935f66ae45378cadc5c9a75b858825 /tests | |
parent | 251a25876a3a21a3951a42e2c3c9f877ead96309 (diff) | |
download | morph-ea5dce37921550e1d05914943f190185d6cf78be.tar.gz |
Verify distributed-build with local workers works the same as "build".
This commit adds black box tests for building a single chunk and a
stratum with a chunk using as many local workers as morph thinks make
sense. The expected stdout of these tests is supposed to be the same as
for the build-{chunk,stratum}.script tests.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/build-chunk-distributed-local.script | 39 | ||||
-rw-r--r-- | tests/build-chunk-distributed-local.stdout | 8 | ||||
-rwxr-xr-x | tests/build-stratum-distributed-local.script | 31 | ||||
-rw-r--r-- | tests/build-stratum-distributed-local.stdout | 7 |
4 files changed, 85 insertions, 0 deletions
diff --git a/tests/build-chunk-distributed-local.script b/tests/build-chunk-distributed-local.script new file mode 100755 index 00000000..bcfa48af --- /dev/null +++ b/tests/build-chunk-distributed-local.script @@ -0,0 +1,39 @@ +#!/bin/sh +# +# Test building a chunk using as many local workers as make sense. +# +# Copyright (C) 2012 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +set -e + +# add working directory to PATH, assuming tests are performed in +# the root directory of the morph repository +export PATH="`pwd`:$PATH" + +cache="$DATADIR/build-chunk-cache" +log="$DATADIR/build-chunk-morph.log" +./morph --no-default-configs \ + build-distributed chunk-repo farrokh hello.morph \ + --git-base-url="file://$DATADIR" \ + --cachedir="$cache" --keep-path --no-distcc \ + --log="$log" || cat "$log" 1>&2 + +for chunk in "$cache/"*.chunk.* +do + echo "$chunk:" | sed 's/[^.]*//' + tar -tf "$chunk" | LC_ALL=C sort | sed '/^\.\/./s:^\./::' + echo +done diff --git a/tests/build-chunk-distributed-local.stdout b/tests/build-chunk-distributed-local.stdout new file mode 100644 index 00000000..8077cac2 --- /dev/null +++ b/tests/build-chunk-distributed-local.stdout @@ -0,0 +1,8 @@ +.chunk.hello: +./ +baserock/ +baserock/hello.meta +bin/ +bin/hello +etc/ + diff --git a/tests/build-stratum-distributed-local.script b/tests/build-stratum-distributed-local.script new file mode 100755 index 00000000..2e381fd7 --- /dev/null +++ b/tests/build-stratum-distributed-local.script @@ -0,0 +1,31 @@ +#!/bin/sh +# +# Test build a simple stratum using as many local workers as makes sense. +# +# Copyright (C) 2012 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +set -e + +export PATH="`pwd`:$PATH" + +cache="$DATADIR/build-stratum-cache" +log="$DATADIR/build-stratum-morph.log" +./morph --no-default-configs \ + build-distributed morphs-repo master hello-stratum.morph \ + --git-base-url="file://$DATADIR" \ + --cachedir="$cache" --keep-path --no-distcc \ + --log="$log" || cat "$log" 1>&2 +tar -tf "$cache/"*.stratum.* | LC_ALL=C sort | sed '/^\.\/./s:^\./::' diff --git a/tests/build-stratum-distributed-local.stdout b/tests/build-stratum-distributed-local.stdout new file mode 100644 index 00000000..4f422ea4 --- /dev/null +++ b/tests/build-stratum-distributed-local.stdout @@ -0,0 +1,7 @@ +./ +baserock/ +baserock/hello-stratum.meta +baserock/hello.meta +bin/ +bin/hello +etc/ |