diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2012-03-12 16:02:13 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2012-03-12 16:05:15 +0000 |
commit | d17290559f7d97a3801a7666ca87358478bcb986 (patch) | |
tree | 2a3f09db2d4057f24b272cfcc83b4780803aa52a /tests/name-clash.script | |
parent | cd94699c6a39948e1d91c968819303b03573b529 (diff) | |
download | morph-d17290559f7d97a3801a7666ca87358478bcb986.tar.gz |
tests: name clash better description and no trap
Add a description for what the script is testing, namely whether
two chunks in the same repository and branch can be confused for
each other.
Also unpack in DATADIR so no trap trickery is needed.
traps aren't stacked and they aren't fully portable, so avoiding
using them has its advantages
Diffstat (limited to 'tests/name-clash.script')
-rwxr-xr-x | tests/name-clash.script | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/name-clash.script b/tests/name-clash.script index e2964e99..8f762a3e 100755 --- a/tests/name-clash.script +++ b/tests/name-clash.script @@ -1,6 +1,9 @@ #!/bin/sh # -# Test building a chunk. +# Test when there are two chunks with the same "name" set in the morphology +# cause only the first built to be used +# This can cause build failures when the wrong name is set and could be +# a vector for including dodgy data in a system # # Copyright (C) 2012 Codethink Limited # @@ -60,7 +63,7 @@ EOF --log="$log" || cat "$log" 1>&2 # unpack it and check the contents -INSTDIR="$(mktemp -d)" -trap "rm -rf \"$INSTDIR\"" INT TERM EXIT +INSTDIR="$DATADIR"/unpack +mkdir -p "$INSTDIR" tar -C "$INSTDIR" -xf "$cache/"*hello-stratum* test "$("$INSTDIR"/bin/hello)" = "hello, world" |