diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-03-26 15:12:07 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-03-26 15:12:07 +0100 |
commit | 7d7d597afd0a562916f106d259f4ff78383f9631 (patch) | |
tree | c7c188f5905310331a31e6e70aa87e3d72089d17 /tests | |
parent | 712ac2bcd856c864e34c337fc23fe86216a88049 (diff) | |
download | morph-7d7d597afd0a562916f106d259f4ff78383f9631.tar.gz |
Separate tests that need to be run as root in their own directory
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/make-patch.script | 86 | ||||
-rw-r--r-- | tests/make-patch.stderr | 16 | ||||
-rw-r--r-- | tests/make-patch.stdout | 3 |
3 files changed, 0 insertions, 105 deletions
diff --git a/tests/make-patch.script b/tests/make-patch.script deleted file mode 100755 index cc2af3b6..00000000 --- a/tests/make-patch.script +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/sh -# -# Test making a patch between two different system images -# -# Copyright (C) 2012 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 -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -set -eu - -( # make the dummy stratum contain a chunk for a fake kernel - mkdir -p "$DATADIR/dummykernel" - cd "$DATADIR/dummykernel" - git init --quiet - cat <<EOF >dummykernel.morph -{ - "name": "dummykernel", - "kind": "chunk", - "install-commands": [ - "mkdir -p \"\$DESTDIR/boot\"", - "touch \"\$DESTDIR\"/extlinux.conf", - "touch \"\$DESTDIR\"/boot/vmlinuz", - "touch \"\$DESTDIR\"/boot/System.map" - ] -} -EOF - - - git add . - git commit --quiet -m "Make dummy boot files" - - cd "$DATADIR/morphs-repo" - git checkout --quiet master - sed -i -e 's/^.*sources.*$/&\ - {\ - "name": "dummykernel",\ - "ref": "master"\ - },\ -/' hello-stratum.morph - - git commit --quiet -m "add dummy kernel" hello-stratum.morph -) - -tests/morph build morphs-repo master hello-system.morph - -# save the stratum as we will apply the patch on top of this later -cp "$DATADIR/cache/"*stratum* "$DATADIR"/farrokh-stratum - - -( # make an evil stratum - cd "$DATADIR/chunk-repo" - git checkout --quiet -b evil farrokh - sed -i -e 's/hello/goodbye/g' hello.c - git add hello.c - git commit --quiet -m "Make the program evil" - - cd "$DATADIR/morphs-repo" - git checkout --quiet -b evil master - sed -i -e 's/farrokh/evil/g' hello-stratum.morph - git add hello-stratum.morph - git commit --quiet -m "Build evil systems" -) - -tests/morph build morphs-repo evil hello-system.morph - -# make a patch to make the system evil -PATCH="$DATADIR"/patchfile -tests/morph make-patch "$PATCH" morphs-repo master hello-system.morph \ - morphs-repo evil hello-system.morph - -UNPACKED="$DATADIR"/unpacked -mkdir -p "$UNPACKED" -tar -C "$UNPACKED" -xf "$DATADIR"/farrokh-stratum -(cd "$UNPACKED" && tbdiff-deploy "$PATCH") -"$UNPACKED"/bin/hello diff --git a/tests/make-patch.stderr b/tests/make-patch.stderr deleted file mode 100644 index 9ed08116..00000000 --- a/tests/make-patch.stderr +++ /dev/null @@ -1,16 +0,0 @@ -cmd_dir_delta baserock -cmd_dir_enter baserock -cmd_metadata_update hello-stratum.meta -cmd_metadata_update hello.meta -cmd_dir_leave -cmd_dir_delta etc -cmd_dir_enter etc -cmd_metadata_update fstab -cmd_dir_leave -cmd_metadata_update extlinux.conf -cmd_dir_enter boot -cmd_dir_leave -cmd_dir_delta bin -cmd_dir_enter bin -cmd_file_delta hello -cmd_dir_leave diff --git a/tests/make-patch.stdout b/tests/make-patch.stdout deleted file mode 100644 index e8bb667c..00000000 --- a/tests/make-patch.stdout +++ /dev/null @@ -1,3 +0,0 @@ -morphs-repo master hello-system.morph -morphs-repo evil hello-system.morph -goodbye, world |