From bba1d9e9f17edf885e857d0ddcf5b6f41e956b10 Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Fri, 8 Aug 2014 11:10:25 +0000 Subject: cmdtests: Use YAML not JSON to represent morphologies --- tests.as-root/archless-system-fails.script | 15 +-- .../metadata-includes-morph-version.setup | 19 +-- tests.as-root/metadata-includes-repo-alias.setup | 19 +-- .../rootfs-tarball-builds-rootfs-and-kernel.script | 13 +- tests.as-root/system-overlap.script | 132 ++++++++------------- tests.as-root/tarball-image-is-sensible.setup | 63 ++++------ 6 files changed, 96 insertions(+), 165 deletions(-) (limited to 'tests.as-root') diff --git a/tests.as-root/archless-system-fails.script b/tests.as-root/archless-system-fails.script index c5c423b4..e34e9ad6 100755 --- a/tests.as-root/archless-system-fails.script +++ b/tests.as-root/archless-system-fails.script @@ -23,17 +23,10 @@ set -eu cd "$DATADIR/morphs" git checkout --quiet -b archless master cat <archless-system.morph -{ - "name": "archless-system", - "kind": "system", - "strata": [ - { - "morph": "hello-stratum", - "repo": "tests:morphs", - "ref": "archless" - } - ] -} +name: archless-system +kind: system +strata: + - morph: hello-stratum EOF git add archless-system.morph git commit --quiet -m "add archless system" diff --git a/tests.as-root/metadata-includes-morph-version.setup b/tests.as-root/metadata-includes-morph-version.setup index d7fc96e3..e4557302 100755 --- a/tests.as-root/metadata-includes-morph-version.setup +++ b/tests.as-root/metadata-includes-morph-version.setup @@ -24,19 +24,12 @@ morphsrepo="$DATADIR/morphs" cd "$morphsrepo" git checkout -b tarball cat < hello-tarball.morph -{ - "name": "hello-tarball", - "kind": "system", - "arch": "$("$SRCDIR/scripts/test-morph" print-architecture)", - "strata": [ - { - "morph": "hello-stratum", - }, - { - "morph": "linux-stratum", - } - ] -} +name: hello-tarball +kind: system +arch: $("$SRCDIR/scripts/test-morph" print-architecture) +strata: + - morph: hello-stratum + - morph: linux-stratum EOF git add hello-tarball.morph diff --git a/tests.as-root/metadata-includes-repo-alias.setup b/tests.as-root/metadata-includes-repo-alias.setup index d7fc96e3..e4557302 100755 --- a/tests.as-root/metadata-includes-repo-alias.setup +++ b/tests.as-root/metadata-includes-repo-alias.setup @@ -24,19 +24,12 @@ morphsrepo="$DATADIR/morphs" cd "$morphsrepo" git checkout -b tarball cat < hello-tarball.morph -{ - "name": "hello-tarball", - "kind": "system", - "arch": "$("$SRCDIR/scripts/test-morph" print-architecture)", - "strata": [ - { - "morph": "hello-stratum", - }, - { - "morph": "linux-stratum", - } - ] -} +name: hello-tarball +kind: system +arch: $("$SRCDIR/scripts/test-morph" print-architecture) +strata: + - morph: hello-stratum + - morph: linux-stratum EOF git add hello-tarball.morph 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 e0829968..ca1b1302 100755 --- a/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script +++ b/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script @@ -27,14 +27,11 @@ arch=$("$SRCDIR/scripts/test-morph" print-architecture) cd "$DATADIR/kernel-repo" cat <linux.morph -{ - "name": "linux", - "kind": "chunk", - "install-commands": [ - "mkdir -p \"\$DESTDIR/boot\"", - "touch \"\$DESTDIR\"/boot/zImage" - ] -} +name: linux +kind: chunk +install-commands: + - mkdir -p "\$DESTDIR/boot" + - touch "\$DESTDIR/boot/zImage" EOF git add linux.morph git commit --quiet -m 'Make the kernel create a dummy zImage' diff --git a/tests.as-root/system-overlap.script b/tests.as-root/system-overlap.script index 1ce8379d..9be6df13 100755 --- a/tests.as-root/system-overlap.script +++ b/tests.as-root/system-overlap.script @@ -28,63 +28,44 @@ morphsrepo="$DATADIR/morphs" cd "$morphsrepo" git checkout --quiet -b overlap master cat <overlap-system.morph -{ - "name": "overlap-system", - "kind": "system", - "arch": "$("$SRCDIR/scripts/test-morph" print-architecture)", - "strata": [ - { - "morph": "foo-baz-stratum", - }, - { - "morph": "foo-barqux-stratum", - } - ] -} +name: overlap-system +kind: system +arch: $("$SRCDIR/scripts/test-morph" print-architecture) +strata: + - morph: foo-baz-stratum + - morph: foo-barqux-stratum EOF cat <foo-baz-stratum.morph -{ - "name": "foo-baz-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "overlap-foo-baz", - "repo": "test:chunk-repo", - "ref": "overlap", - "build-mode": "test", - "build-depends": [] - }, - { - "name": "linux", - "repo": "test:kernel-repo", - "ref": "master", - "build-mode": "test", - "build-depends": ["overlap-foo-baz"] - } - ] -} +name: foo-baz-stratum +kind: stratum +chunks: + - name: overlap-foo-baz + repo: test:chunk-repo + ref: overlap + build-mode: test + build-depends: [] + - name: linux + repo: test:kernel-repo + ref: master + build-mode: test + build-depends: + - overlap-foo-baz EOF cat <foo-barqux-stratum.morph -{ - "name": "foo-barqux-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "overlap-foobar", - "repo": "test:chunk-repo", - "ref": "overlap", - "build-mode": "test", - "build-depends": [] - }, - { - "name": "overlap-fooqux", - "repo": "test:chunk-repo", - "ref": "overlap", - "build-mode": "test", - "build-depends": ["overlap-foobar"] - } - ] -} +name: foo-barqux-stratum +kind: stratum +chunks: + - name: overlap-foobar + repo: test:chunk-repo + ref: overlap + build-mode: test + build-depends: [] + - name: overlap-fooqux + repo: test:chunk-repo + ref: overlap + build-mode: test + build-depends: + - overlap-foobar EOF git add overlap-system.morph foo-baz-stratum.morph foo-barqux-stratum.morph git commit --quiet -m "add overlapping system" @@ -92,39 +73,30 @@ git commit --quiet -m "add overlapping system" cd "$chunkrepo" git checkout --quiet -b overlap master cat <overlap-foo-baz.morph -{ - "name": "overlap-foo-baz", - "kind": "chunk", - "install-commands": [ - "mkdir -p \$DESTDIR/bin", - "for f in foo bar baz; do echo echo \$f >\$DESTDIR/bin/\$f; done" - ] -} +name: overlap-foo-baz +kind: chunk +install-commands: + - mkdir -p "\$DESTDIR"/bin + - for f in foo bar baz; do echo echo \$f >"\$DESTDIR"/bin/\$f; done EOF cat <overlap-foobar.morph -{ - "name": "overlap-foobar", - "kind": "chunk", - "install-commands": [ - "mkdir -p \$DESTDIR/usr/bin \$DESTDIR/bin", - "echo echo foobar >\$DESTDIR/usr/bin/foobar", - "ln -s /usr/bin/foobar \$DESTDIR/bin/foo", - "ln -s /usr/bin/foobar \$DESTDIR/bin/bar" - ] -} +name: overlap-foobar +kind: chunk +install-commands: + - mkdir -p "\$DESTDIR"/usr/bin "\$DESTDIR"/bin + - echo echo foobar >"\$DESTDIR"/usr/bin/foobar + - ln -s /usr/bin/foobar "\$DESTDIR"/bin/foo + - ln -s /usr/bin/foobar "\$DESTDIR"/bin/bar EOF cat <overlap-fooqux.morph -{ - "name": "overlap-fooqux", - "kind": "chunk", - "install-commands": [ - "mkdir -p \$DESTDIR/usr/bin \$DESTDIR/bin", - "for f in qux fooqux; do echo echo \$f >\$DESTDIR/usr/bin/\$f; done", - "ln -s /usr/bin/fooqux \$DESTDIR/bin/foo" - ] -} +name: overlap-fooqux +kind: chunk +install-commands: + - mkdir -p "\$DESTDIR"/usr/bin "\$DESTDIR"/bin + - for f in qux fooqux; do echo echo \$f >"\$DESTDIR"/usr/bin/\$f; done + - ln -s /usr/bin/fooqux "\$DESTDIR"/bin/foo EOF git add overlap-*.morph diff --git a/tests.as-root/tarball-image-is-sensible.setup b/tests.as-root/tarball-image-is-sensible.setup index c47a5336..a687b691 100755 --- a/tests.as-root/tarball-image-is-sensible.setup +++ b/tests.as-root/tarball-image-is-sensible.setup @@ -24,17 +24,14 @@ chunkrepo="$DATADIR/chunk-repo" cd "$chunkrepo" git checkout -b tarball-links cat >links.morph <<'EOF' -{ - "name": "links", - "kind": "chunk", - "build-system": "manual", - "install-commands": [ - "mkdir -p \"$DESTDIR/bin\"", - "touch \"$DESTDIR/bin/true\"", - "cd \"$DESTDIR/bin\" && ln true true-hardlink", - "cd \"$DESTDIR/bin\" && ln -s true true-symlink" - ] -} +name: links +kind: chunk +build-system: manual +install-commands: + - mkdir -p "$DESTDIR/bin" + - touch "$DESTDIR/bin/true" + - cd "$DESTDIR/bin" && ln true true-hardlink + - cd "$DESTDIR/bin" && ln -s true true-symlink EOF git add links.morph git commit --quiet -m 'Add link adding chunk' @@ -43,22 +40,13 @@ morphsrepo="$DATADIR/morphs" cd "$morphsrepo" git checkout -b tarball-links cat < hello-tarball.morph -{ - "name": "hello-tarball", - "kind": "system", - "arch": "$("$SRCDIR/scripts/test-morph" print-architecture)", - "strata": [ - { - "morph": "link-stratum", - }, - { - "morph": "hello-stratum", - }, - { - "morph": "linux-stratum", - } - ] -} +name: hello-tarball +kind: system +arch: $("$SRCDIR/scripts/test-morph" print-architecture) +strata: + - morph: link-stratum + - morph: hello-stratum + - morph: linux-stratum EOF git add hello-tarball.morph @@ -69,19 +57,14 @@ sed -i linux-stratum.morph \ git add linux-stratum.morph cat < link-stratum.morph -{ - "name": "link-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "links", - "repo": "test:chunk-repo", - "ref": "tarball-links", - "build-mode": "test", - "build-depends": [] - } - ] -} +name: link-stratum +kind: stratum +chunks: + - name: links + repo: test:chunk-repo + ref: tarball-links + build-mode: test + build-depends: [] EOF git add link-stratum.morph git commit --quiet -m "add morphs" -- cgit v1.2.1