Page MenuHomeDevCentral

D3030.diff
No OneTemporary

D3030.diff

diff --git a/_tests/pillar/credentials/__init__.py b/_tests/pillar/credentials/__init__.py
new file mode 100644
diff --git a/_tests/pillar/credentials/test_vault.py b/_tests/pillar/credentials/test_vault.py
new file mode 100755
--- /dev/null
+++ b/_tests/pillar/credentials/test_vault.py
@@ -0,0 +1,33 @@
+#!/usr/bin/env python3
+
+from glob import glob
+import os
+import unittest
+import yaml
+
+
+PILLAR_FILE = "../pillar/credentials/vault.sls"
+
+
+class Testinstance(unittest.TestCase):
+ def setUp(self):
+ with open(PILLAR_FILE, "r") as fd:
+ self.pillar = yaml.safe_load(fd)
+
+ def test_policies_files(self):
+ in_pillar = self.pillar.get("vault_policies", [])
+
+ files = glob("../roles/vault/policies/files/*.hcl")
+ in_role = [os.path.basename(file).split(".")[0] for file in files]
+
+ in_pillar.sort()
+ in_role.sort()
+ self.assertEqual(
+ in_pillar,
+ in_role,
+ "Pillar vault_policies and policies files available should match.",
+ )
+
+
+if __name__ == "__main__":
+ unittest.main()

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 09:28 (14 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2313551
Default Alt Text
D3030.diff (1 KB)

Event Timeline