From 1342bf9006f28a08d1b32dc8218717ebda701dc2 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Mon, 29 Oct 2012 16:02:42 +0000 Subject: Split merge tests out from the other branching tests Merge is by far the most complex of the branching and merging commands. --- tests.merging/setup | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100755 tests.merging/setup (limited to 'tests.merging/setup') diff --git a/tests.merging/setup b/tests.merging/setup new file mode 100755 index 00000000..f075e7b1 --- /dev/null +++ b/tests.merging/setup @@ -0,0 +1,115 @@ +#!/bin/bash +# 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 up $DATADIR. +# +# - a morph.conf configuration file +# - an empty morph workspace directory +# - a git repository called "morphs" for fake system, stratum morphologies +# - a git repository calle "hello" for a dummy chunk + +set -eu + +source "$SRCDIR/scripts/fix-committer-info" + +# Create a morph configuration file +cat < "$DATADIR/morph.conf" +[config] +repo-alias = baserock=file://$DATADIR/%s#file://$DATADIR/%s +cachedir = $DATADIR/workspace/.morph/cache +log = $DATADIR/morph.log +keep-path = true +no-distcc = true +quiet = true +EOF + + +# Create an empty directory to be used as a morph workspace +mkdir "$DATADIR/workspace" + + +# Create a fake morphs repository +mkdir "$DATADIR/morphs" + +## Create a link to this repo that has a .git suffix +ln -s "$DATADIR/morphs" "$DATADIR/morphs.git" + +cat < "$DATADIR/morphs/hello-system.morph" +{ + "name": "hello-system", + "kind": "system", + "system-kind": "syslinux-disk", + "arch": "$(uname -m)", + "disk-size": "1G", + "strata": [ + { + "morph": "hello-stratum", + "repo": "baserock:morphs", + "ref": "master" + } + ] +} +EOF + +cat < "$DATADIR/morphs/hello-stratum.morph" +{ + "name": "hello-stratum", + "kind": "stratum", + "chunks": [ + { + "name": "hello", + "repo": "baserock:hello", + "ref": "master", + "build-depends": [] + } + ] +} +EOF + +scripts/run-git-in "$DATADIR/morphs" init +scripts/run-git-in "$DATADIR/morphs" add . +scripts/run-git-in "$DATADIR/morphs" commit -m initial + + +# Add an extra branch to the morphs repo. +scripts/run-git-in "$DATADIR/morphs" checkout -b alfred +touch "$DATADIR/morphs/this.is.alfred" +scripts/run-git-in "$DATADIR/morphs" add this.is.alfred +scripts/run-git-in "$DATADIR/morphs" commit --quiet -m 'mark as alfred' +scripts/run-git-in "$DATADIR/morphs" checkout master + + +# Create a dummy chunk repository +mkdir "$DATADIR/hello" + +cat < "$DATADIR/hello/hello.morph" +{ + "name": "hello", + "kind": "chunk", + "build-system": "dummy" +} +EOF + +scripts/run-git-in "$DATADIR/hello" init +scripts/run-git-in "$DATADIR/hello" add . +scripts/run-git-in "$DATADIR/hello" commit -m initial + + +# Add an extra branch to the hello repo. +scripts/run-git-in "$DATADIR/hello" checkout -b alfred +scripts/run-git-in "$DATADIR/hello" checkout master + -- cgit v1.2.1