summaryrefslogtreecommitdiff
path: root/subplot/data.py
diff options
context:
space:
mode:
Diffstat (limited to 'subplot/data.py')
-rw-r--r--subplot/data.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/subplot/data.py b/subplot/data.py
index 1455bf4..3833f2e 100644
--- a/subplot/data.py
+++ b/subplot/data.py
@@ -3,6 +3,7 @@ import logging
import os
import random
import socket
+import stat
import yaml
@@ -148,3 +149,17 @@ def manifests_match(ctx, expected=None, actual=None):
assert_eq(actual_objs, [])
logging.debug(f"manifests {expected} and {actual} match")
+
+
+def file_is_readable_by_owner(ctx, filename=None):
+ assert_eq = globals()["assert_eq"]
+
+ st = os.lstat(filename)
+ mode = stat.S_IMODE(st.st_mode)
+ logging.debug("file mode: %o", mode)
+ assert_eq(mode, 0o400)
+
+
+def file_does_not_contain(ctx, filename=None, pattern=None):
+ data = open(filename).read()
+ assert pattern not in data