Home | History | Annotate | Line # | Download | only in pwhash
t_pwhash.sh revision 1.1.4.2
      1 atf_test_case pwhash_blowfish_r12
      2 pwhash_blowfish_r12_head() {
      3 	atf_set "descr" "ATF test for pwhash using blowfish 12 rounds"
      4 }
      5 
      6 pwhash_blowfish_r12_body() {
      7 	atf_check -s exit:0 -o match:"^\\\$2a\\\$" -x \
      8 		'echo -n password | pwhash -b 12'
      9 }
     10 
     11 atf_test_case pwhash_md5
     12 pwhash_md5_head() {
     13 	atf_set "descr" "ATF test for pwhash using MD5"
     14 }
     15 
     16 pwhash_md5_body() {
     17 	atf_check -s exit:0 -o match:"^\\\$1\\\$" -x \
     18 		'echo -n password | pwhash -m'
     19 }
     20 
     21 atf_test_case pwhash_sha1
     22 pwhash_sha1_head() {
     23 	atf_set "descr" "ATF test for pwhash using SHA1"
     24 }
     25 
     26 pwhash_sha1_body() {
     27 	atf_check -s exit:0 -o match:"^\\\$sha1\\\$" -x \
     28 		'echo -n password | pwhash'
     29 }
     30 
     31 atf_test_case pwhash_des
     32 pwhash_des_head() {
     33 	atf_set "descr" "ATF test for pwhash using DES"
     34 }
     35 
     36 pwhash_des_body() {
     37 	atf_check -s exit:0 -o ignore -e ignore -x \
     38 		'echo -n password | pwhash -s somesalt'
     39 }
     40 
     41 atf_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