summaryrefslogtreecommitdiff
path: root/tests.as-root
diff options
context:
space:
mode:
Diffstat (limited to 'tests.as-root')
-rwxr-xr-xtests.as-root/branch-from-image-works.script2
-rwxr-xr-xtests.as-root/build-handles-stratum-build-depends.script4
-rwxr-xr-xtests.as-root/build-with-external-strata.script4
-rwxr-xr-xtests.as-root/building-a-system-branch-multiple-times-doesnt-generate-new-artifacts.script4
-rwxr-xr-xtests.as-root/building-a-system-branch-picks-up-committed-removes.script12
-rwxr-xr-xtests.as-root/building-a-system-branch-picks-up-uncommitted-changes.script12
-rwxr-xr-xtests.as-root/building-a-system-branch-works-anywhere.script6
-rwxr-xr-xtests.as-root/building-creates-correct-temporary-refs.script10
-rwxr-xr-xtests.as-root/metadata-includes-morph-version.setup2
-rwxr-xr-xtests.as-root/metadata-includes-repo-alias.setup2
-rwxr-xr-xtests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script4
-rwxr-xr-xtests.as-root/run-in-artifact-with-different-artifacts.script2
-rw-r--r--tests.as-root/run-in-artifact-with-different-artifacts.stderr1
-rwxr-xr-xtests.as-root/setup4
-rwxr-xr-xtests.as-root/system-overlap.script2
-rwxr-xr-xtests.as-root/tarball-image-is-sensible.setup2
-rw-r--r--tests.as-root/tarball-image-is-sensible.stdout1
-rwxr-xr-xtests.as-root/unimportant-morphology-contents-do-not-change-cache-keys.script6
18 files changed, 39 insertions, 41 deletions
diff --git a/tests.as-root/branch-from-image-works.script b/tests.as-root/branch-from-image-works.script
index c9d50bbb..fb0b09c9 100755
--- a/tests.as-root/branch-from-image-works.script
+++ b/tests.as-root/branch-from-image-works.script
@@ -50,7 +50,7 @@ workspace="$DATADIR/workspace"
cd "$workspace"
"$SRCDIR/scripts/test-morph" branch-from-image mybranch \
--metadata-dir="$extracted/baserock"
-cd mybranch/test:morphs
+cd mybranch/test/morphs
grep -qFe "$hello_chunk_commit" hello-stratum.morph
tar=$("$SRCDIR/scripts/test-morph" --find-system-artifact build hello-tarball)
tar -xf "$tar" bin/hello
diff --git a/tests.as-root/build-handles-stratum-build-depends.script b/tests.as-root/build-handles-stratum-build-depends.script
index 22d07c72..6e6f82da 100755
--- a/tests.as-root/build-handles-stratum-build-depends.script
+++ b/tests.as-root/build-handles-stratum-build-depends.script
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (C) 2012-2013 Codethink Limited
+# Copyright (C) 2012-2014 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
@@ -33,7 +33,7 @@ set -eu
cd "$DATADIR/workspace"
"$SRCDIR/scripts/test-morph" branch test:morphs test/stratum-build-depends
-cd test/stratum-build-depends/test:morphs
+cd test/stratum-build-depends/test/morphs
# 'linux-system' and the build-depends fields of 'linux-stratum' need to
# be updated here. Any build-depends of any altered strata also need to
diff --git a/tests.as-root/build-with-external-strata.script b/tests.as-root/build-with-external-strata.script
index f5d86dfe..e43d0262 100755
--- a/tests.as-root/build-with-external-strata.script
+++ b/tests.as-root/build-with-external-strata.script
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (C) 2012-2013 Codethink Limited
+# Copyright (C) 2012-2014 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
@@ -35,7 +35,7 @@ cd "$DATADIR/workspace"
# 'morph build'.
cd "branch1"
"$SRCDIR/scripts/test-morph" edit hello-system stratum2
-cd "test:external-strata"
+cd "test/external-strata"
awk '
/^chunks:/ {
diff --git a/tests.as-root/building-a-system-branch-multiple-times-doesnt-generate-new-artifacts.script b/tests.as-root/building-a-system-branch-multiple-times-doesnt-generate-new-artifacts.script
index 8852b96d..ac6cffec 100755
--- a/tests.as-root/building-a-system-branch-multiple-times-doesnt-generate-new-artifacts.script
+++ b/tests.as-root/building-a-system-branch-multiple-times-doesnt-generate-new-artifacts.script
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright (C) 2012-2013 Codethink Limited
+# Copyright (C) 2012-2014 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
@@ -38,6 +38,6 @@ cd "$DATADIR/workspace/branch1"
[ "$ARTIFACT_COUNT" -eq $(ls "$DATADIR/cache/artifacts" | wc -l) ]
# Build thrice, and that should be enough.
-cd "$DATADIR/workspace/branch1/test:morphs"
+cd "$DATADIR/workspace/branch1/test/morphs"
"$SRCDIR/scripts/test-morph" build linux-system
[ "$ARTIFACT_COUNT" -eq $(ls "$DATADIR/cache/artifacts" | wc -l) ]
diff --git a/tests.as-root/building-a-system-branch-picks-up-committed-removes.script b/tests.as-root/building-a-system-branch-picks-up-committed-removes.script
index fbfd2c0f..64ae82c7 100755
--- a/tests.as-root/building-a-system-branch-picks-up-committed-removes.script
+++ b/tests.as-root/building-a-system-branch-picks-up-committed-removes.script
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (C) 2013 Codethink Limited
+# Copyright (C) 2013-2014 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,7 +24,7 @@ set -e
. "$SRCDIR/tests.as-root/setup-build"
KERNEL_BRANCH=baserock/builds/123456789/AABBCCDDE
-cd "$DATADIR/workspace/branch1/test:kernel-repo"
+cd "$DATADIR/workspace/branch1/test/kernel-repo"
git checkout --quiet master
echo Use Morph >README
git add README
@@ -36,7 +36,7 @@ cd "$DATADIR/workspace"
# Make a change elsewhere to be pulled in
PEER_REPO="$DATADIR/peer-kernel"
-git clone --quiet "file://$DATADIR/workspace/branch1/test:kernel-repo" \
+git clone --quiet "file://$DATADIR/workspace/branch1/test/kernel-repo" \
"$PEER_REPO"
cd "$PEER_REPO"
git checkout --quiet -b fix
@@ -47,7 +47,7 @@ git checkout --quiet master
git merge --no-ff fix >/dev/null 2>&1
# Pull a commit in to the linux morphology.
-cd "$DATADIR/workspace/branch1/test:kernel-repo"
+cd "$DATADIR/workspace/branch1/test/kernel-repo"
git remote add peer "file://$PEER_REPO"
git remote update >/dev/null 2>&1
git merge --quiet peer/master
@@ -55,8 +55,8 @@ git merge --quiet peer/master
# Build the linux system again without comitting.
cd "$DATADIR/workspace"
"$SRCDIR/scripts/test-morph" build linux-system
-cd branch1/test:kernel-repo
+cd branch1/test/kernel-repo
# Check whether the new morphology exists in the temporary build ref
-cd "$DATADIR/workspace/branch1/test:kernel-repo"
+cd "$DATADIR/workspace/branch1/test/kernel-repo"
! git cat-file blob "$KERNEL_BRANCH:README" >/dev/null 2>&1
diff --git a/tests.as-root/building-a-system-branch-picks-up-uncommitted-changes.script b/tests.as-root/building-a-system-branch-picks-up-uncommitted-changes.script
index 8d298010..4dacb23e 100755
--- a/tests.as-root/building-a-system-branch-picks-up-uncommitted-changes.script
+++ b/tests.as-root/building-a-system-branch-picks-up-uncommitted-changes.script
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (C) 2012-2013 Codethink Limited
+# Copyright (C) 2012-2014 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
@@ -32,13 +32,13 @@ cd "$DATADIR/workspace"
"$SRCDIR/scripts/test-morph" build linux-system
# Print tree SHA1s of the build ref of morphs and kernel.
-cd "$DATADIR/workspace/branch1/test:morphs"
+cd "$DATADIR/workspace/branch1/test/morphs"
MORPHS_SHA1="$(git rev-parse baserock/builds/123456789/987654321)"
-cd "$DATADIR/workspace/branch1/test:kernel-repo"
+cd "$DATADIR/workspace/branch1/test/kernel-repo"
KERNEL_SHA1="$(git rev-parse baserock/builds/123456789/AABBCCDDE)"
# Make an uncommitted change to the linux morphology.
-cd "$DATADIR/workspace/branch1/test:kernel-repo"
+cd "$DATADIR/workspace/branch1/test/kernel-repo"
sed -i -e 's@touch@touch foo@g' linux.morph
# Build the linux system again without comitting.
@@ -49,7 +49,7 @@ cd "$DATADIR/workspace"
# This time the tree SHA1 of morphs should be the same
# but that of the kernel repo should be different because we
# made a change.
-cd "$DATADIR/workspace/branch1/test:morphs"
+cd "$DATADIR/workspace/branch1/test/morphs"
[ "$(git rev-parse baserock/builds/123456789/987654321)" != "$MORPHS_SHA1" ]
-cd "$DATADIR/workspace/branch1/test:kernel-repo"
+cd "$DATADIR/workspace/branch1/test/kernel-repo"
[ "$(git rev-parse baserock/builds/123456789/AABBCCDDE)" != "$KERNEL_SHA1" ]
diff --git a/tests.as-root/building-a-system-branch-works-anywhere.script b/tests.as-root/building-a-system-branch-works-anywhere.script
index d5d1e52d..cf946cd5 100755
--- a/tests.as-root/building-a-system-branch-works-anywhere.script
+++ b/tests.as-root/building-a-system-branch-works-anywhere.script
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright (C) 2012-2013 Codethink Limited
+# Copyright (C) 2012-2014 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
@@ -41,13 +41,13 @@ cd "$DATADIR/workspace/branch1"
rm -rf "$DATADIR/cache/artifacts"/*
# Build form the branch root repository.
-cd "$DATADIR/workspace/branch1/test:morphs"
+cd "$DATADIR/workspace/branch1/test/morphs"
"$SRCDIR/scripts/test-morph" build linux-system
"$SRCDIR/scripts/list-tree" "$DATADIR/cache/artifacts" > "$DATADIR/output3"
rm -rf "$DATADIR/cache/artifacts"/*
# Build from the linux directory.
-cd "$DATADIR/workspace/branch1/test:kernel-repo"
+cd "$DATADIR/workspace/branch1/test/kernel-repo"
"$SRCDIR/scripts/test-morph" build linux-system
"$SRCDIR/scripts/list-tree" "$DATADIR/cache/artifacts" > "$DATADIR/output4"
rm -rf "$DATADIR/cache/artifacts"/*
diff --git a/tests.as-root/building-creates-correct-temporary-refs.script b/tests.as-root/building-creates-correct-temporary-refs.script
index c0bf6a1e..6fb6c83a 100755
--- a/tests.as-root/building-creates-correct-temporary-refs.script
+++ b/tests.as-root/building-creates-correct-temporary-refs.script
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright (C) 2012-2013 Codethink Limited
+# Copyright (C) 2012-2014 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
@@ -35,10 +35,10 @@ cd "$DATADIR/workspace"
# Verify that the right temporary refs were created.
echo "Refs of morphs repo after first build:"
-"$SRCDIR/scripts/run-git-in" "$DATADIR/workspace/branch1/test:morphs" \
+"$SRCDIR/scripts/run-git-in" "$DATADIR/workspace/branch1/test/morphs" \
show-ref | cut -d' ' -f2
echo "Refs of kernel repo after first build:"
-"$SRCDIR/scripts/run-git-in" "$DATADIR/workspace/branch1/test:kernel-repo" \
+"$SRCDIR/scripts/run-git-in" "$DATADIR/workspace/branch1/test/kernel-repo" \
show-ref | cut -d' ' -f2
echo
@@ -48,8 +48,8 @@ cd "$DATADIR/workspace"
# Verify that the right temporary refs were created.
echo "Refs of morphs repo after second build:"
-"$SRCDIR/scripts/run-git-in" "$DATADIR/workspace/branch1/test:morphs" \
+"$SRCDIR/scripts/run-git-in" "$DATADIR/workspace/branch1/test/morphs" \
show-ref | cut -d' ' -f2
echo "Refs of kernel repo after second build:"
-"$SRCDIR/scripts/run-git-in" "$DATADIR/workspace/branch1/test:kernel-repo" \
+"$SRCDIR/scripts/run-git-in" "$DATADIR/workspace/branch1/test/kernel-repo" \
show-ref | cut -d' ' -f2
diff --git a/tests.as-root/metadata-includes-morph-version.setup b/tests.as-root/metadata-includes-morph-version.setup
index 31829b01..d7fc96e3 100755
--- a/tests.as-root/metadata-includes-morph-version.setup
+++ b/tests.as-root/metadata-includes-morph-version.setup
@@ -27,7 +27,7 @@ cat <<EOF > hello-tarball.morph
{
"name": "hello-tarball",
"kind": "system",
- "arch": "$(uname -m)",
+ "arch": "$("$SRCDIR/scripts/test-morph" print-architecture)",
"strata": [
{
"morph": "hello-stratum",
diff --git a/tests.as-root/metadata-includes-repo-alias.setup b/tests.as-root/metadata-includes-repo-alias.setup
index 31829b01..d7fc96e3 100755
--- a/tests.as-root/metadata-includes-repo-alias.setup
+++ b/tests.as-root/metadata-includes-repo-alias.setup
@@ -27,7 +27,7 @@ cat <<EOF > hello-tarball.morph
{
"name": "hello-tarball",
"kind": "system",
- "arch": "$(uname -m)",
+ "arch": "$("$SRCDIR/scripts/test-morph" print-architecture)",
"strata": [
{
"morph": "hello-stratum",
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 93cd135f..e0829968 100755
--- a/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script
+++ b/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 2011, 2012, 2013 Codethink Limited
+# Copyright (C) 2011, 2012, 2013, 2014 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
@@ -23,7 +23,7 @@ set -eu
cache="$DATADIR/cache/artifacts"
-arch=$(uname -m)
+arch=$("$SRCDIR/scripts/test-morph" print-architecture)
cd "$DATADIR/kernel-repo"
cat <<EOF >linux.morph
diff --git a/tests.as-root/run-in-artifact-with-different-artifacts.script b/tests.as-root/run-in-artifact-with-different-artifacts.script
index ff944af4..57d408e3 100755
--- a/tests.as-root/run-in-artifact-with-different-artifacts.script
+++ b/tests.as-root/run-in-artifact-with-different-artifacts.script
@@ -44,4 +44,4 @@ echo
# Run 'run-in-artifact' with the statum artifact.
echo "Stratum:"
"$SRCDIR/scripts/test-morph" run-in-artifact "$stratum" -- ls baserock/ \
- || echo "Failed"
+ 2>/dev/null || echo "Failed"
diff --git a/tests.as-root/run-in-artifact-with-different-artifacts.stderr b/tests.as-root/run-in-artifact-with-different-artifacts.stderr
deleted file mode 100644
index 9241fbb5..00000000
--- a/tests.as-root/run-in-artifact-with-different-artifacts.stderr
+++ /dev/null
@@ -1 +0,0 @@
-ERROR: Artifact TMP/cache/artifacts/e8e771e742c8f2199bd9f1e29cbeca07dbd51dd8880136d6521093711d37d8bf.stratum.linux-stratum-runtime cannot be extracted or mounted
diff --git a/tests.as-root/setup b/tests.as-root/setup
index b865f42d..1cf9dd04 100755
--- a/tests.as-root/setup
+++ b/tests.as-root/setup
@@ -132,7 +132,7 @@ git add tools-stratum.morph
cat <<EOF > hello-system.morph
name: hello-system
kind: system
-arch: `uname -m`
+arch: `"$SRCDIR/scripts/test-morph" print-architecture`
strata:
- morph: hello-stratum
EOF
@@ -155,7 +155,7 @@ git add linux-stratum.morph
cat <<EOF > linux-system.morph
name: linux-system
kind: system
-arch: `uname -m`
+arch: `"$SRCDIR/scripts/test-morph" print-architecture`
strata:
- morph: hello-stratum
- morph: linux-stratum
diff --git a/tests.as-root/system-overlap.script b/tests.as-root/system-overlap.script
index c6154e0e..1ce8379d 100755
--- a/tests.as-root/system-overlap.script
+++ b/tests.as-root/system-overlap.script
@@ -31,7 +31,7 @@ cat <<EOF >overlap-system.morph
{
"name": "overlap-system",
"kind": "system",
- "arch": "$(uname -m)",
+ "arch": "$("$SRCDIR/scripts/test-morph" print-architecture)",
"strata": [
{
"morph": "foo-baz-stratum",
diff --git a/tests.as-root/tarball-image-is-sensible.setup b/tests.as-root/tarball-image-is-sensible.setup
index 505707b3..c47a5336 100755
--- a/tests.as-root/tarball-image-is-sensible.setup
+++ b/tests.as-root/tarball-image-is-sensible.setup
@@ -46,7 +46,7 @@ cat <<EOF > hello-tarball.morph
{
"name": "hello-tarball",
"kind": "system",
- "arch": "$(uname -m)",
+ "arch": "$("$SRCDIR/scripts/test-morph" print-architecture)",
"strata": [
{
"morph": "link-stratum",
diff --git a/tests.as-root/tarball-image-is-sensible.stdout b/tests.as-root/tarball-image-is-sensible.stdout
index 4141dee8..cf74a1ec 100644
--- a/tests.as-root/tarball-image-is-sensible.stdout
+++ b/tests.as-root/tarball-image-is-sensible.stdout
@@ -33,7 +33,6 @@
./boot/System.map
./boot/vmlinuz
./etc/
-./etc/fstab
./etc/os-release
./extlinux.conf
NAME="Baserock"
diff --git a/tests.as-root/unimportant-morphology-contents-do-not-change-cache-keys.script b/tests.as-root/unimportant-morphology-contents-do-not-change-cache-keys.script
index ca92b2cb..a540cdee 100755
--- a/tests.as-root/unimportant-morphology-contents-do-not-change-cache-keys.script
+++ b/tests.as-root/unimportant-morphology-contents-do-not-change-cache-keys.script
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright (C) 2012-2013 Codethink Limited
+# Copyright (C) 2012-2014 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
@@ -36,8 +36,8 @@ cd "$DATADIR/workspace"
ARTIFACT_COUNT="$(ls "$DATADIR/cache/artifacts" | wc -l)"
# Petrify the refs, so the morphologies will be different
-(set -e && cd branch1/test:morphs && git push --quiet origin HEAD)
-(set -e && cd branch1/test:kernel-repo && git push --quiet origin HEAD)
+(set -e && cd branch1/test/morphs && git push --quiet origin HEAD)
+(set -e && cd branch1/test/kernel-repo && git push --quiet origin HEAD)
"$SRCDIR/scripts/test-morph" petrify
# Build with the petrified morphologies.