diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2013-01-28 16:57:18 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2013-01-28 16:57:18 +0000 |
commit | e97bd4be721834e24c32838c2ecd5149ef7c7101 (patch) | |
tree | 195e2ecfa8afb38522b81ed030588eed8785017f /tests.as-root | |
parent | 2024583a303ef1a79709b7ecc9fc2dce22e8ce98 (diff) | |
parent | e6dc394c0f31429b2f54c77b20223651a0ab68ee (diff) | |
download | morph-e97bd4be721834e24c32838c2ecd5149ef7c7101.tar.gz |
Merge branch 'jjardon/yaml-v2'
Diffstat (limited to 'tests.as-root')
-rwxr-xr-x | tests.as-root/disk-builds-rootfs-and-kernel.script | 4 | ||||
-rwxr-xr-x | tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script | 2 | ||||
-rwxr-xr-x | tests.as-root/setup | 144 | ||||
-rwxr-xr-x | tests.as-root/tarball-image-is-sensible.setup | 4 | ||||
-rwxr-xr-x | tests.as-root/target-disk-too-small.script | 6 |
5 files changed, 64 insertions, 96 deletions
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 <<EOF > 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 <<EOF > 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 <<EOF > 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 <<EOF > 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 <<EOF > 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 <<EOF > "$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" |