Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3935773
D3030.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3030.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D3030: Test Vault pillar
Attached
Detach File
Event Timeline
Log In to Comment