summaryrefslogtreecommitdiff
path: root/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2012-11-14 17:52:38 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2012-11-14 17:58:39 +0000
commite8a342e61989f06172457fc25311abc02e5dfee6 (patch)
tree1cb80924d7cd49b495a4844419fd1669ce7eeafd /tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script
parent70564c6457b732e1dd35384971da5df3c5a1665b (diff)
downloadmorph-e8a342e61989f06172457fc25311abc02e5dfee6.tar.gz
Update as-root tests to use their setup infrastructure
Code to generate system images was being duplicated in each test needlessly.
Diffstat (limited to 'tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script')
-rwxr-xr-xtests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script62
1 files changed, 11 insertions, 51 deletions
diff --git a/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script b/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script
index f1aa674a..8bf25dee 100755
--- a/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script
+++ b/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script
@@ -16,63 +16,24 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-# A system-kind of rootfs-tarball should build both kernel image and
-# a tarball with the root filesystem.
+## A system-kind of rootfs-tarball should build both kernel image and
+## a tarball with the root filesystem.
set -eu
. "$SRCDIR/scripts/python-check"
cache="$DATADIR/cache/artifacts"
-kernelrepo="$DATADIR/kernel-repo"
-morphsrepo="$DATADIR/morphs"
-log="$DATADIR/morph.log"
arch=$(uname -m)
-cd "$morphsrepo"
-git checkout --quiet -b custom master
-cat <<EOF >system.morph
-{
- "name": "system",
- "kind": "system",
- "system-kind": "rootfs-tarball",
- "arch": "$arch",
- "disk-size": "1G",
- "strata": [
- {
- "morph": "stratum",
- "repo": "test:morphs",
- "ref": "custom"
- }
- ]
-}
-EOF
-cat <<EOF >stratum.morph
-{
- "name": "stratum",
- "kind": "stratum",
- "chunks": [
- {
- "name": "hello",
- "repo": "test:chunk-repo",
- "ref": "farrokh",
- "build-depends": []
- },
- {
- "name": "linux",
- "repo": "test:kernel-repo",
- "ref": "custom",
- "build-depends": ["hello"]
- }
- ]
-}
-EOF
-git add system.morph stratum.morph
-git commit --quiet -m "add custom system"
+cd "$DATADIR/morphs"
+sed -e 's/"system-kind": "syslinux-disk"/"system-kind": "rootfs-tarball"/' \
+ -i linux-system.morph
+git add linux-system.morph
+git commit --quiet -m "Build rootfs tarball system"
-cd "$kernelrepo"
-git checkout --quiet -b custom master
+cd "$DATADIR/kernel-repo"
cat <<EOF >linux.morph
{
"name": "linux",
@@ -84,17 +45,16 @@ cat <<EOF >linux.morph
}
EOF
git add linux.morph
-
git commit --quiet -m 'Make the kernel create a dummy zImage'
"$SRCDIR/scripts/test-morph" \
- build-morphology test:morphs custom system > /dev/null
+ build-morphology test:morphs master linux-system > /dev/null
for suffix in kernel rootfs
do
- if [ ! -e "$cache"/*system.system-$suffix ]
+ if [ ! -e "$cache"/*system.linux-system-$suffix ]
then
- echo "can't find $cache/*system.system-$suffix" 1>&2
+ echo "can't find $cache/*system.linux-system-$suffix" 1>&2
find "$cache" 1>&2
exit 1
fi