summaryrefslogtreecommitdiff
path: root/subplot
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-11-21 18:35:20 +0200
committerLars Wirzenius <liw@liw.fi>2021-11-21 18:59:47 +0200
commiteaee7a8c6409ec2f26ed2d8d9bcb66220f912228 (patch)
tree8d512c201de8da2ba408bd60a299349cd20d67a3 /subplot
parentb76c33d32bffe1a4528cdc8eb7598c881db0e29f (diff)
downloadobnam2-eaee7a8c6409ec2f26ed2d8d9bcb66220f912228.tar.gz
refactor: add simple scenario step to setup Obnam for a scenario
Make the setup of an installed Obnam and a running Obnam server be one step instead of two. This is not a huge change, but even a little helps, given how many scenarios need it. Sponsored-by: author
Diffstat (limited to 'subplot')
-rw-r--r--subplot/client.py12
-rw-r--r--subplot/client.yaml6
2 files changed, 18 insertions, 0 deletions
diff --git a/subplot/client.py b/subplot/client.py
index bea3b18..09b1556 100644
--- a/subplot/client.py
+++ b/subplot/client.py
@@ -3,6 +3,18 @@ import os
import yaml
+def start_obnam(ctx):
+ start_chunk_server = globals()["start_chunk_server"]
+ install_obnam(ctx)
+ start_chunk_server(ctx)
+
+
+def stop_obnam(ctx):
+ stop_chunk_server = globals()["stop_chunk_server"]
+ stop_chunk_server(ctx)
+ uninstall_obnam(ctx)
+
+
def install_obnam(ctx):
runcmd_prepend_to_path = globals()["runcmd_prepend_to_path"]
srcdir = globals()["srcdir"]
diff --git a/subplot/client.yaml b/subplot/client.yaml
index 9817186..ec41344 100644
--- a/subplot/client.yaml
+++ b/subplot/client.yaml
@@ -1,3 +1,9 @@
+- given: "a working Obnam system"
+ impl:
+ python:
+ function: start_obnam
+ cleanup: stop_obnam
+
- given: "an installed obnam"
impl:
python: