summaryrefslogtreecommitdiff
path: root/tests.as-root
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2014-08-08 11:10:25 +0000
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2014-08-14 13:28:50 +0000
commitbba1d9e9f17edf885e857d0ddcf5b6f41e956b10 (patch)
treea5e5da0b1c02c7c39679d5d8fbba7599b71ab67b /tests.as-root
parenta87d850a3b96010dd272bba1624fcf0b230afc6d (diff)
downloadmorph-bba1d9e9f17edf885e857d0ddcf5b6f41e956b10.tar.gz
cmdtests: Use YAML not JSON to represent morphologies
Diffstat (limited to 'tests.as-root')
-rwxr-xr-xtests.as-root/archless-system-fails.script15
-rwxr-xr-xtests.as-root/metadata-includes-morph-version.setup19
-rwxr-xr-xtests.as-root/metadata-includes-repo-alias.setup19
-rwxr-xr-xtests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script13
-rwxr-xr-xtests.as-root/system-overlap.script132
-rwxr-xr-xtests.as-root/tarball-image-is-sensible.setup63
6 files changed, 96 insertions, 165 deletions
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 <<EOF >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 <<EOF > 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 <<EOF > 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 <<EOF >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 <<EOF >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 <<EOF >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 <<EOF >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 <<EOF >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 <<EOF >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 <<EOF >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 <<EOF > 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 <<EOF > 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"