[blivet:master 1/4] Add a simple test of generateBackupPassphrase() result format

mulhern amulhern at redhat.com
Tue Jul 8 13:55:56 UTC 2014


Signed-off-by: mulhern <amulhern at redhat.com>
---
 tests/devicelibs_test/crypto_test.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/devicelibs_test/crypto_test.py b/tests/devicelibs_test/crypto_test.py
index d62da4b..9bf4af6 100755
--- a/tests/devicelibs_test/crypto_test.py
+++ b/tests/devicelibs_test/crypto_test.py
@@ -199,5 +199,11 @@ class CryptoTestCase2(loopbackedtestcase.LoopBackedTestCase):
            crypto.luks_close,
            "encrypted")
 
+class CryptoTestCase3(unittest.TestCase):
+    def testPassphrase(self):
+        exp = r"([0-9A-Za-z./]{5}-)*[0-9A-Za-z./]{0,4}"
+        bp = crypto.generateBackupPassphrase()
+        self.assertRegexpMatches(bp, exp)
+
 if __name__ == "__main__":
     unittest.main()
-- 
1.9.3



More information about the anaconda-patches mailing list