From 8c34d1e9d46b6802d8723f9d151019fe8a7c3250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Tue, 22 Jan 2013 16:28:09 +0000 Subject: Change build tests to use YAML morphologies --- tests.as-root/disk-builds-rootfs-and-kernel.script | 4 +- .../rootfs-tarball-builds-rootfs-and-kernel.script | 2 +- tests.as-root/setup | 144 ++++++++------------- tests.as-root/tarball-image-is-sensible.setup | 4 +- tests.as-root/target-disk-too-small.script | 6 +- 5 files changed, 64 insertions(+), 96 deletions(-) (limited to 'tests.as-root') diff --git a/tests.as-root/disk-builds-rootfs-and-kernel.script b/tests.as-root/disk-builds-rootfs-and-kernel.script index c11c246f..2eb57743 100755 --- a/tests.as-root/disk-builds-rootfs-and-kernel.script +++ b/tests.as-root/disk-builds-rootfs-and-kernel.script @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (C) 2012 Codethink Limited +# Copyright (C) 2012,2013 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 @@ -25,7 +25,7 @@ set -eu cache="$DATADIR/cache/artifacts" cd "$DATADIR/morphs" -sed -e 's/"system-kind": "syslinux-disk"/"system-kind": "disk"/' \ +sed -e 's/system-kind: syslinux-disk/system-kind: disk/' \ -i linux-system.morph git add linux-system.morph git commit --quiet -m "Build rootfs tarball system" 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 c6179aaf..856d3488 100755 --- a/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script +++ b/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script @@ -29,7 +29,7 @@ cache="$DATADIR/cache/artifacts" arch=$(uname -m) cd "$DATADIR/morphs" -sed -e 's/"system-kind": "syslinux-disk"/"system-kind": "rootfs-tarball"/' \ +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" diff --git a/tests.as-root/setup b/tests.as-root/setup index d3ba7ef4..285a3143 100755 --- a/tests.as-root/setup +++ b/tests.as-root/setup @@ -10,7 +10,7 @@ # The stratum repository contains a single branch, "master", with a # stratum and a system morphology that include the chunk above. # -# Copyright (C) 2011, 2012 Codethink Limited +# Copyright (C) 2011, 2012, 2013 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 @@ -62,19 +62,15 @@ EOF git add hello.c cat < hello.morph -{ - "name": "hello", - "kind": "chunk", - "build-system": "dummy", - "build-commands": [ - "gcc -o hello hello.c" - ], - "install-commands": [ - "install -d \\"\$DESTDIR\\"/etc", - "install -d \\"\$DESTDIR\\"/bin", - "install hello \\"\$DESTDIR\\"/bin/hello" - ] -} +name: hello +kind: chunk +build-system: dummy +build-commands: + - gcc -o hello hello.c +install-commands: + - install -d "\$DESTDIR"/etc + - install -d "\$DESTDIR"/bin + - install hello "\$DESTDIR"/bin/hello EOF git add hello.morph @@ -92,82 +88,57 @@ cd "$morphsrepo" git init --quiet cat < hello-stratum.morph -{ - "name": "hello-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "hello", - "repo": "test:chunk-repo", - "ref": "farrokh", - "build-depends": [] - } - ] -} +name: hello-stratum +kind: stratum +chunks: + - name: hello + repo: test:chunk-repo + ref: farrokh + build-depends: [] EOF git add hello-stratum.morph cat < hello-system.morph -{ - "name": "hello-system", - "kind": "system", - "system-kind": "syslinux-disk", - "arch": "$(uname -m)", - "disk-size": "1G", - "strata": [ - { - "morph": "hello-stratum", - "repo": "test:morphs", - "ref": "master" - } - ] -} +name: hello-system +kind: system +system-kind: syslinux-disk +arch: `uname -m` +disk-size: 1G +strata: + - morph: hello-stratum + repo: test:morphs + ref: master EOF git add hello-system.morph cat < linux-stratum.morph -{ - "name": "linux-stratum", - "kind": "stratum", - "build-depends": [ - { - "morph": "hello-stratum", - "repo": "test:morphs", - "ref": "master" - } - ], - "chunks": [ - { - "name": "linux", - "repo": "test:kernel-repo", - "ref": "master", - "build-depends": [] - } - ] -} +name: linux-stratum +kind: stratum +build-depends: + - morph: hello-stratum + repo: test:morphs + ref: master +chunks: + - name: linux + repo: test:kernel-repo + ref: master + build-depends: [] EOF git add linux-stratum.morph cat < linux-system.morph -{ - "name": "linux-system", - "kind": "system", - "system-kind": "syslinux-disk", - "arch": "$(uname -m)", - "disk-size": "1G", - "strata": [ - { - "morph": "hello-stratum", - "repo": "test:morphs", - "ref": "master" - }, - { - "morph": "linux-stratum", - "repo": "test:morphs", - "ref": "master" - } - ] -} +name: linux-system +kind: system +system-kind: syslinux-disk +arch: `uname -m` +disk-size: 1G +strata: + - morph: hello-stratum + repo: test:morphs + ref: master + - morph: linux-stratum + repo: test:morphs + ref: master EOF git add linux-system.morph @@ -176,16 +147,13 @@ git commit --quiet -m "add morphs" # Make a dummy kernel chunk. mkdir "$DATADIR/kernel-repo" cat < "$DATADIR/kernel-repo/linux.morph" -{ - "name": "linux", - "kind": "chunk", - "install-commands": [ - "mkdir -p \"\$DESTDIR/boot\"", - "touch \"\$DESTDIR\"/extlinux.conf", - "touch \"\$DESTDIR\"/boot/vmlinuz", - "touch \"\$DESTDIR\"/boot/System.map" - ] -} +name: linux +kind: chunk +install-commands: + - mkdir -p "\$DESTDIR/boot" + - touch "\$DESTDIR/extlinux.conf" + - touch "\$DESTDIR/boot/vmlinuz" + - touch "\$DESTDIR/boot/System.map" EOF "$SRCDIR/scripts/run-git-in" "$DATADIR/kernel-repo" init --quiet "$SRCDIR/scripts/run-git-in" "$DATADIR/kernel-repo" add . diff --git a/tests.as-root/tarball-image-is-sensible.setup b/tests.as-root/tarball-image-is-sensible.setup index c1c88993..e159070c 100755 --- a/tests.as-root/tarball-image-is-sensible.setup +++ b/tests.as-root/tarball-image-is-sensible.setup @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (C) 2011, 2012 Codethink Limited +# Copyright (C) 2011-2013 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 @@ -71,7 +71,7 @@ git add hello-tarball.morph # Change build-depends ref of hello-stratum from master to tarball-links sed -i linux-stratum.morph \ - -e '/"build-depends": \[/,/\]/ s/"ref": "master"/"ref": "tarball-links"/' + -e '/build-depends:/,/chunks/ s/ref: master/ref: tarball-links/' git add linux-stratum.morph diff --git a/tests.as-root/target-disk-too-small.script b/tests.as-root/target-disk-too-small.script index 92a73a58..ff3a374f 100755 --- a/tests.as-root/target-disk-too-small.script +++ b/tests.as-root/target-disk-too-small.script @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (C) 2011, 2012 Codethink Limited +# Copyright (C) 2011-2013 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 @@ -24,8 +24,8 @@ set -eu # Shrink linux-system to the minimum btrfs will allow. cd "$DATADIR/morphs" -sed -e 's/"system-kind": "syslinux-disk"/"system-kind": "disk"/' \ - -e 's/"disk-size": "1G"/"disk-size": "512M"/' \ +sed -e 's/system-kind: syslinux-disk/system-kind: disk/' \ + -e 's/disk-size: 1G/disk-size: 512M/' \ -i linux-system.morph git add linux-system.morph git commit -q -m "Make linux-system as small as possible" -- cgit v1.2.1