summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-06-14 15:51:26 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-06-14 15:51:26 +0000
commite5ce2f18d589b595682044589f4f5527e5b1bee6 (patch)
tree563fe38ea3445a2f81a5ee5498e446eff5b0df7b
parentf33553534538be564461d57f81a63ffa4ca6fd54 (diff)
downloadmorph-e5ce2f18d589b595682044589f4f5527e5b1bee6.tar.gz
tests: fix root scripts
make-patch expected a tarball system-overlap was parsing logs rather than using a stable format
-rwxr-xr-xtests.as-root/make-patch.script6
-rwxr-xr-xtests.as-root/system-overlap.script12
-rw-r--r--tests.as-root/system-overlap.stdout10
3 files changed, 15 insertions, 13 deletions
diff --git a/tests.as-root/make-patch.script b/tests.as-root/make-patch.script
index 172f3e07..d312cb55 100755
--- a/tests.as-root/make-patch.script
+++ b/tests.as-root/make-patch.script
@@ -44,7 +44,7 @@ EOF
# Build first image. Remember the stratum.
"$SRCDIR/scripts/test-morph" build test:morphs-repo master hello-system.morph
img1=$(find "$DATADIR/cache/artifacts" -maxdepth 1 -name '*.system.*')
-stratum1=$(find "$DATADIR/cache/artifacts" -maxdepth 1 -name '*.stratum.*')
+stratum1=$(find "$DATADIR/cache/artifacts" -maxdepth 1 -name '*.hello-stratum')
# Modify the chunk, in a new branch.
"$SRCDIR/scripts/run-git-in" "$DATADIR/chunk-repo" checkout --quiet farrokh
@@ -74,7 +74,9 @@ patch="$DATADIR/patch"
# Unpack the original stratum and run the program.
mkdir "$DATADIR/unpacked"
cd "$DATADIR/unpacked"
-tar -xf "$stratum1"
+"$SRCDIR/scripts/assemble-stratum" --cachedir "$DATADIR/cache" "$stratum1" \
+ "$DATADIR/stratum.tar" hello-stratum
+tar -xf "$DATADIR/stratum.tar"
echo "old version:"
./bin/hello
diff --git a/tests.as-root/system-overlap.script b/tests.as-root/system-overlap.script
index 868d3e61..28307301 100755
--- a/tests.as-root/system-overlap.script
+++ b/tests.as-root/system-overlap.script
@@ -23,7 +23,6 @@ set -eu
cache="$DATADIR/cache/artifacts"
chunkrepo="$DATADIR/chunk-repo"
morphsrepo="$DATADIR/morphs-repo"
-log="$DATADIR/morph.log"
cd "$morphsrepo"
git checkout --quiet -b overlap master
@@ -119,6 +118,11 @@ git add overlap-*.morph
git commit --quiet -m 'Add overlapping chunks'
"$SRCDIR/scripts/test-morph" \
- build --log=$log test:morphs-repo overlap overlap-system.morph
-grep "WARNING\s" $log | sed 's/^.*WARNING */WARNING /' |
- sed 's/ \.\// /'
+ build test:morphs-repo overlap overlap-system.morph
+"$SRCDIR/scripts/list-overlaps" groups \
+ "$cache"/*.system.overlap-system.overlaps |
+while IFS='\n' read overlaps; do
+ echo $overlaps
+ "$SRCDIR/scripts/list-overlaps" list-files \
+ "$cache"/*.system.overlap-system.overlaps $overlaps
+done
diff --git a/tests.as-root/system-overlap.stdout b/tests.as-root/system-overlap.stdout
index 33b70636..fe106ad9 100644
--- a/tests.as-root/system-overlap.stdout
+++ b/tests.as-root/system-overlap.stdout
@@ -1,7 +1,3 @@
-WARNING Overlaps in artifact foo-barqux-stratum detected
-WARNING Artifacts overlap-foobar, overlap-fooqux overlap with files:
-WARNING bin/foo
-WARNING Overlaps in artifact overlap-system detected
-WARNING Artifacts foo-barqux-stratum, foo-baz-stratum overlap with files:
-WARNING bin/bar
-WARNING bin/foo
+foo-barqux-stratum foo-baz-stratum
+bin/foo
+bin/bar