1atf_test_case pwhash_blowfish_r12 2pwhash_blowfish_r12_head() { 3 atf_set "descr" "ATF test for pwhash using blowfish 12 rounds" 4} 5 6pwhash_blowfish_r12_body() { 7 atf_check -s exit:0 -o match:"^\\\$2a\\\$" -x \ 8 'echo -n password | pwhash -b 12' 9} 10 11atf_test_case pwhash_md5 12pwhash_md5_head() { 13 atf_set "descr" "ATF test for pwhash using MD5" 14} 15 16pwhash_md5_body() { 17 atf_check -s exit:0 -o match:"^\\\$1\\\$" -x \ 18 'echo -n password | pwhash -m' 19} 20 21atf_test_case pwhash_sha1 22pwhash_sha1_head() { 23 atf_set "descr" "ATF test for pwhash using SHA1" 24} 25 26pwhash_sha1_body() { 27 atf_check -s exit:0 -o match:"^\\\$sha1\\\$" -x \ 28 'echo -n password | pwhash' 29} 30 31atf_test_case pwhash_des 32pwhash_des_head() { 33 atf_set "descr" "ATF test for pwhash using DES" 34} 35 36pwhash_des_body() { 37 atf_check -s exit:0 -o ignore -e ignore -x \ 38 'echo -n password | pwhash -s somesalt' 39} 40 41atf_init_test_cases() 42{ 43 atf_add_test_case pwhash_blowfish_r12 44 atf_add_test_case pwhash_md5 45 atf_add_test_case pwhash_sha1 46 atf_add_test_case pwhash_des 47} 48