]> eyrie.org Git - kerberos/krb5-strength.git/blobdiff - tests/tools/cdbmake-wordlist-t
Support filtering wordlists by regex in cdbmake-wordlist
[kerberos/krb5-strength.git] / tests / tools / cdbmake-wordlist-t
index e22587dd1fa1fdad90fa65e9b5e16c925d500b56..ca4b53df9a5e142625e8a4f3e96f49969056b5eb 100755 (executable)
@@ -17,7 +17,7 @@ if ! command -v cdb >/dev/null 2>&1 ; then
 fi
 
 # Output the test plan.
-plan 14
+plan 18
 
 # Create a temporary directory and wordlist and ensure it's writable.
 tmpdir=`test_tmpdir`
@@ -69,6 +69,16 @@ ok_program 'Database still contains bitterbane' 0 '1' \
 ok_program 'Database does not contain happenstance' 100 '' \
     cdb -q "$tmpdir/wordlist.cdb" happenstance
 
+# Regenerate the database, filtering out words starting with b or ending in d.
+ok_program 'Database generation with no b passwords' 0 '' \
+    "$cdbmake" -x '\Ab' -x '.*d' "$tmpdir/wordlist"
+ok_program 'Database does not contain bitterbane' 100 '' \
+    cdb -q "$tmpdir/wordlist.cdb" bitterbane
+ok_program 'Database still contains happenstance' 0 '1' \
+    cdb -q "$tmpdir/wordlist.cdb" happenstance
+ok_program 'Database does not contain password' 100 '' \
+    cdb -q "$tmpdir/wordlist.cdb" password
+
 # Clean up.
 rm -f "$tmpdir/wordlist.cdb"
 rm -f "$tmpdir/wordlist"