X-Git-Url: https://git.eyrie.org/?a=blobdiff_plain;f=tests%2Ftools%2Fcdbmake-wordlist-t;h=08d8d91eaddb62aa63f3826f13f48e016544ebfa;hb=df0c85456e4e51e0ab35560a62a87dea046e5fe8;hp=ca4b53df9a5e142625e8a4f3e96f49969056b5eb;hpb=d834e4532202c83096e1f342799f52cc9619a6c1;p=kerberos%2Fkrb5-strength.git diff --git a/tests/tools/cdbmake-wordlist-t b/tests/tools/cdbmake-wordlist-t index ca4b53d..08d8d91 100755 --- a/tests/tools/cdbmake-wordlist-t +++ b/tests/tools/cdbmake-wordlist-t @@ -17,7 +17,7 @@ if ! command -v cdb >/dev/null 2>&1 ; then fi # Output the test plan. -plan 18 +plan 20 # Create a temporary directory and wordlist and ensure it's writable. tmpdir=`test_tmpdir` @@ -79,6 +79,14 @@ ok_program 'Database still contains happenstance' 0 '1' \ ok_program 'Database does not contain password' 100 '' \ cdb -q "$tmpdir/wordlist.cdb" password +# Try filtering the wordlist into a new wordlist. +ok_program 'Wordlist filtering' 0 '' \ + "$cdbmake" -a -x '.*d' -l 8 -o "$tmpdir/wordlist.new" "$tmpdir/wordlist" +( echo 'bitterbane'; echo 'happenstance' ) > "$tmpdir/wordlist.expected" +ok_program 'Filtered wordlist is correct' 0 '' \ + cmp "$tmpdir/wordlist.expected" "$tmpdir/wordlist.new" +rm -f "$tmpdir/wordlist.expected" "$tmpdir/wordlist.new" + # Clean up. rm -f "$tmpdir/wordlist.cdb" rm -f "$tmpdir/wordlist"