From 54c81674db48d5c9eb151199ef1bc434fd1bd4a6 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Wed, 24 Sep 2014 20:37:29 +0000 Subject: Move the branch-from-image test to a yarn --- yarns/deployment.yarn | 45 +++++++++++++++++++++++++++++++++++++++++++++ yarns/implementations.yarn | 4 ++++ 2 files changed, 49 insertions(+) (limited to 'yarns') diff --git a/yarns/deployment.yarn b/yarns/deployment.yarn index 40b50432..0782c7c1 100644 --- a/yarns/deployment.yarn +++ b/yarns/deployment.yarn @@ -283,3 +283,48 @@ deployment. WHEN the user attempts to deploy test-system.sysroot from cluster test-cluster.morph in branch master THEN morph failed FINALLY the git server is shut down + +Deploying branch-from-image produced systems +============================================ + +We have this nifty subcommand called branch-from-image, which can be +used to build the same thing as an existing image. + +There's no special requirements for making the image reproducible. + + SCENARIO reproducing systems + 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 + GIVEN a cluster called test-cluster.morph in system branch master + AND a system in cluster test-cluster.morph in branch master called test-system + AND system test-system in cluster test-cluster.morph in branch master builds systems/test-system.morph + AND system test-system in cluster test-cluster.morph in branch master has deployment type: sysroot + AND system test-system in cluster test-cluster.morph in branch master has deployment location: test-system + WHEN the user attempts to deploy the cluster test-cluster.morph in branch master + THEN morph succeeded + AND file workspace/master/test/morphs/test-system exists + +To reproduce an existing image, do a checkout with the extracted root +filesystem's /baserock directory as the `--metadata-dir` argument. + + WHEN the user attempts to check out the system branch from workspace/master/test/morphs/test-system called mybranch + THEN morph succeeded + AND the system branch mybranch is checked out + +After it is checked-out, the system can be rebuilt. + + WHEN the user attempts to build the system systems/test-system.morph in branch mybranch + THEN morph succeeded + +Once it is rebuilt, it can be deployed. + + GIVEN a cluster called test-cluster.morph in system branch mybranch + AND a system in cluster test-cluster.morph in branch mybranch called test-system + AND system test-system in cluster test-cluster.morph in branch mybranch builds systems/test-system.morph + AND system test-system in cluster test-cluster.morph in branch mybranch has deployment type: tar + AND system test-system in cluster test-cluster.morph in branch mybranch has deployment location: test-system.tar + WHEN the user attempts to deploy the cluster test-cluster.morph in branch mybranch + THEN morph succeeded + AND file workspace/mybranch/test/morphs/test-system.tar exists diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index e99c1817..9cf497fc 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -382,6 +382,10 @@ Attempt to check out a system branch from a root that has no systems. cd "$DATADIR/workspace" attempt_morph checkout test:test-chunk master + IMPLEMENTS WHEN the user attempts to check out the system branch from (\S+) called (\S+) + cd "$DATADIR/workspace" + attempt_morph branch-from-image --metadata-dir "$DATADIR/$MATCH_1/baserock" "$MATCH_2" + We also need to verify that a system branch has been checked out. IMPLEMENTS THEN the system branch (\S+) is checked out -- cgit v1.2.1