summaryrefslogtreecommitdiff
path: root/subplot
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-12-12 09:49:01 +0200
committerLars Wirzenius <liw@liw.fi>2020-12-12 09:53:45 +0200
commitd44a1fc45b8f5953f06c13ef3a2936a31fe2a740 (patch)
treeea211c1abb40cf03645a0cc658dc6878e0af910f /subplot
parente6ee241053915d5322a4f9027a38512c7e755466 (diff)
downloadobnam2-d44a1fc45b8f5953f06c13ef3a2936a31fe2a740.tar.gz
test: add scenario for restoring mode bits
Diffstat (limited to 'subplot')
-rw-r--r--subplot/data.py4
-rw-r--r--subplot/data.yaml3
2 files changed, 7 insertions, 0 deletions
diff --git a/subplot/data.py b/subplot/data.py
index 9eadd3f..09df6c5 100644
--- a/subplot/data.py
+++ b/subplot/data.py
@@ -13,6 +13,10 @@ def create_file_with_random_data(ctx, filename=None):
f.write(data)
+def chmod_file(ctx, filename=None, mode=None):
+ os.chmod(filename, int(mode, 8))
+
+
def create_manifest_of_live(ctx, dirname=None, manifest=None):
_create_manifest_of_directory(ctx, dirname=dirname, manifest=manifest)
diff --git a/subplot/data.yaml b/subplot/data.yaml
index 4f9871a..3b4d938 100644
--- a/subplot/data.yaml
+++ b/subplot/data.yaml
@@ -6,6 +6,9 @@
- given: "a file {filename} containing some random data"
function: create_file_with_random_data
+- given: file {filename} has mode {mode}
+ function: chmod_file
+
- given: a manifest of the directory {dirname} in {manifest}
function: create_manifest_of_live