summaryrefslogtreecommitdiff
path: root/yarns
diff options
context:
space:
mode:
Diffstat (limited to 'yarns')
-rw-r--r--yarns/deployment.yarn30
-rw-r--r--yarns/implementations.yarn10
-rw-r--r--yarns/morph.shell-lib8
3 files changed, 41 insertions, 7 deletions
diff --git a/yarns/deployment.yarn b/yarns/deployment.yarn
index 855ecc52..f98d2751 100644
--- a/yarns/deployment.yarn
+++ b/yarns/deployment.yarn
@@ -9,7 +9,7 @@ Morph Deployment Tests
THEN morph failed
AND the deploy error message includes the string "morph deploy is only supported for cluster morphologies"
- SCENARIO deploying a cluster morphology
+ SCENARIO deploying a cluster morphology as a tarfile
GIVEN a workspace
AND a git server
WHEN the user checks out the system branch called master
@@ -17,3 +17,31 @@ Morph Deployment Tests
WHEN the user builds the system test-system in branch master
AND the user attempts to deploy the cluster test-cluster in branch master with options system.location=test.tar
THEN morph succeeded
+
+Some deployment types support upgrades, but some do not and Morph needs to make
+this clear.
+
+ SCENARIO attempting to upgrade a tarfile deployment
+ GIVEN a workspace
+ AND a git server
+ WHEN the user checks out the system branch called master
+ GIVEN a cluster called test-cluster for deploying only the test-system system as type tar in system branch master
+ WHEN the user builds the system test-system in branch master
+ AND the user attempts to upgrade the cluster test-cluster in branch master with options system.location=test.tar
+ THEN morph failed
+
+The rawdisk write extension supports both initial deployment and subsequent
+upgrades. Note that the rawdisk upgrade code needs bringing up to date to use
+the new Baserock OS version manager tool. Also, the test deploys an identical
+base OS as an upgrade. While pointless, this is permitted and does exercise
+the same code paths as a real upgrade.
+
+ SCENARIO deploying a cluster morphology as rawdisk and then upgrading it
+ GIVEN a workspace
+ AND a git server
+ WHEN the user checks out the system branch called master
+ GIVEN a cluster called test-cluster for deploying only the test-system system as type rawdisk in system branch master
+ WHEN the user builds the system test-system in branch master
+ AND the user attempts to deploy the cluster test-cluster in branch master with options system.location=test.img system.DISK_SIZE=10M system.VERSION_LABEL=test1
+ AND the user attempts to upgrade the cluster test-cluster in branch master with options system.location=test.img system.VERSION_LABEL=test2
+ THEN morph succeeded
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn
index ccebabca..1e1b2fd5 100644
--- a/yarns/implementations.yarn
+++ b/yarns/implementations.yarn
@@ -663,6 +663,16 @@ 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 upgrade|upgrades) the (system|cluster) (\S+) in branch (\S+)( with options (.*))?
+ cd "$DATADIR/workspace/$MATCH_4"
+ set -- deploy --upgrade "$MATCH_3"
+ if [ "$MATCH_5" != '' ]; then
+ # eval used so word splitting in the text is preserved
+ eval set -- '"$@"' $MATCH_6
+ fi
+ if [ $MATCH_1 == "upgrades" ]; then run_morph "$@"
+ else attempt_morph "$@"; fi
+
To successfully deploy systems, we need a cluster morphology. Since the
common case is to just have one system, we generate a stub morphology
with only the minimal information.
diff --git a/yarns/morph.shell-lib b/yarns/morph.shell-lib
index 31dcc7af..e025f8f5 100644
--- a/yarns/morph.shell-lib
+++ b/yarns/morph.shell-lib
@@ -22,17 +22,13 @@
# Run Morph from the source tree, ignoring any configuration files.
# This way the test suite is not affected by any configuration the user
# or system may have. Instead, we'll use the `$DATADIR/morph.conf` file,
-# which tests can create, if they want to. Unfortunately, currently yarn
-# does not set a $SRCDIR that points at the source tree, so if the test
-# needs to cd away from there, things can break. We work around this
-# by allowing the caller to set $SRCDIR if they want to, and if it isn't
-# set, we default to . (current working directory).
+# which tests can create, if they want to.
run_morph()
{
{
set +e
- "${SRCDIR:-.}"/morph \
+ PYTHONPATH="$SRCDIR" "$SRCDIR"/morph \
--cachedir-min-space=0 --tempdir-min-space=0 \
--no-default-config --config "$DATADIR/morph.conf" "$@" \
2> "$DATADIR/result-$1"