summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@gmail.com>2014-10-22 19:13:20 +0000
committerRichard Maw <richard.maw@gmail.com>2014-10-22 19:13:20 +0000
commite1da65e6aee3ed2eb9cd04913080d8365a906b62 (patch)
treebc06f34ce479df273fe4f4de1d262577a437af93
parentcdd06ea486b4d990831442051b5ef2a50cf5d578 (diff)
downloadmorph-e1da65e6aee3ed2eb9cd04913080d8365a906b62.tar.gz
yarns: Add yarns for system-integrationsbaserock/richardmaw/test-system-integrations
These were previously completely untested, so their unsafe mounting wasn't noticed, but now both are fixed.
-rw-r--r--yarns/building.yarn30
-rw-r--r--yarns/implementations.yarn8
2 files changed, 38 insertions, 0 deletions
diff --git a/yarns/building.yarn b/yarns/building.yarn
index 52742ac8..253b3b3c 100644
--- a/yarns/building.yarn
+++ b/yarns/building.yarn
@@ -9,6 +9,36 @@ Morph Building Tests
THEN morph build the system systems/base-system.morph of the branch master
FINALLY the git server is shut down
+System integrations
+-------------------
+
+`system-integration` is a field in chunk morphologies that allows you to
+have some scripts run at system artifact construction time, because some
+things need to be done after every chunk is built, such as `ldconfig`,
+so every library path in `/etc/ld.so.conf` can be found, and it can look
+up libraries more quickly.
+
+ SCENARIO using system integrations
+ GIVEN a workspace
+ AND a git server
+ WHEN the user checks out the system branch called master
+ AND the user attempts to build the system systems/test-system.morph in branch master
+ THEN morph succeeded
+
+In our example, we have a system integration that creates /etc/passwd,
+so when we deploy the system, we can check whether it exists.
+
+ 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: tar
+ WHEN the user attempts to deploy the cluster test-cluster.morph in branch master with options test-system.location="$DATADIR/test.tar"
+ THEN morph succeeded
+ AND tarball test.tar contains etc/passwd
+
+Distbuilding
+------------
+
SCENARIO distbuilding
ASSUMING the morph-cache-server can be run
GIVEN a workspace
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn
index c6d245d0..6110148e 100644
--- a/yarns/implementations.yarn
+++ b/yarns/implementations.yarn
@@ -300,6 +300,14 @@ another to hold a chunk.
install-commands:
- copy files
+ system-integration:
+ test-chunk-bins:
+ 00-passwd:
+ - |
+ create file /etc/passwd
+ root:x:0:0:Super user:/root:/bin/sh
+ daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+ nobody:x:65534:65534:nobody:/nonexistent:/bin/false
EOF
install -m644 -D /dev/stdin << 'EOF' "stage2-chunk.morph"