From 46c37a048a49a513e1fd4ce89b2f5851694a3aa3 Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Mon, 23 Mar 2015 16:00:23 +0000 Subject: Add a test for partial deployment --- yarns/deployment.yarn | 22 ++++++++++++++++++++++ yarns/implementations.yarn | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/yarns/deployment.yarn b/yarns/deployment.yarn index 6ec8c0af..85bb2c9d 100644 --- a/yarns/deployment.yarn +++ b/yarns/deployment.yarn @@ -301,6 +301,28 @@ deployment. THEN morph failed FINALLY the git server is shut down +Deploying only part of a system +------------------------------- + +It is possible to only deploy one or more strata or chunks from a system +when deploying to a tarball or sysroot. + + SCENARIO partially deploying a system + GIVEN a workspace + AND a git server + WHEN the user checks out the system branch called master + AND the user builds the system systems/test-system.morph in branch master + AND the user attempts to partially deploy tar from cluster clusters/partial-test-cluster.morph in branch master + THEN morph succeeded + WHEN the user attempts to partially deploy sysroot from cluster clusters/partial-test-cluster.morph in branch master + THEN morph succeeded + +However, it is not possible to do this when the deployment type is +something other than tarball or sysroot. + + WHEN the user attempts to partially deploy rawdisk from cluster clusters/partial-test-cluster.morph in branch master + THEN morph failed + Deploying branch-from-image produced systems ============================================ diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index 3277075e..13d06cae 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -332,6 +332,29 @@ another to hold a chunk. - copy files EOF + install -m644 -D /dev/stdin << EOF "clusters/partial-test-cluster.morph" + name: partial-test-cluster + kind: cluster + systems: + - morph: systems/test-system.morph + deploy: + tar: + type: tar + location: test.tar + partial-deploy-components: + - strata/build-essential.morph + sysroot: + type: sysroot + location: test.sysroot + partial-deploy-components: + - strata/build-essential.morph + rawdisk: + type: rawdisk + location: test.img + partial-deploy-components: + - strata/build-essential.morph + EOF + git add . git commit -m Initial. git tag -a "test-tag" -m "Tagging test-tag" @@ -440,7 +463,6 @@ You need an architecture to build a system, we don't default to the host archite run_in "$DATADIR/gits/morphs" git add "$MATCH_1" run_in "$DATADIR/gits/morphs" git commit -m "Added $MATCH_1." - Implementation sections for system branch operations ---------------------------------------------------- @@ -782,6 +804,15 @@ them, so they can be added to the end of the implements section. if [ "$MATCH_1" = "deploys" ]; then run_morph "$@" else attempt_morph "$@"; fi + IMPLEMENTS WHEN the user (attempts to partially deploy|partially deploys) (.*) from cluster (\S+) in branch (\S+) + cd "$DATADIR/workspace/$MATCH_4/test/morphs" + set -- deploy "$MATCH_3" + systems=$(echo "$MATCH_2" | sed -e 's/, /\n/g' -e 's/ and /\n/g') + echo "partial=True" >> "$DATADIR/morph.conf" + set -- "$@" $systems + if [ "$MATCH_1" = "deploys" ]; then run_morph "$@" + else attempt_morph "$@"; fi + IMPLEMENTS WHEN the user (attempts to upgrade|upgrades) the (system|cluster) (\S+) in branch (\S+)( with options (.*))? cd "$DATADIR/workspace/$MATCH_4/test/morphs" set -- upgrade "$MATCH_3" -- cgit v1.2.1