commit d8db04e88cc82272f6fba5102c38d4cac1c64517 Author: Nalin Dahyabhai Date: Thu Aug 1 16:14:13 2013 -0400 Fixup tests for recent certutil changes * Skip certutil's certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" message, which is printed at a different point(?) now. * If a certutil error message includes an error name, strip out the name, because it didn't always used to be there. diff --git a/tests/015-lockedkey-dbm/expected.out b/tests/015-lockedkey-dbm/expected.out index e2ffc54..4378b91 100644 --- a/tests/015-lockedkey-dbm/expected.out +++ b/tests/015-lockedkey-dbm/expected.out @@ -36,40 +36,32 @@ OK (2048). [Not pre-creating database.] [Generating key (dbm) without PIN.] OK. -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Providing Unnecessary PIN.] [Reading Key Info With Unnecessary PIN.] Failed to read key "dbm:$tmpdir/dbmdb":"Test". (Need PIN.) -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Generating CSR With Unnecessary PIN.] -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Creating database, without PIN.] [Generating key (dbm) without PIN.] OK. -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Providing Unnecessary PIN.] [Reading Key Info With Unnecessary PIN.] Failed to read key "dbm:$tmpdir/dbmdb":"Test". (Need PIN.) -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Generating CSR With Unnecessary PIN.] -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Not pre-creating database, with PIN.] [Generating key (dbm) with PIN.] OK. -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Reading Key Info Without PIN.] Failed to read key "dbm:$tmpdir/dbmdb":"Test". (Need PIN.) -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" Incorrect password/PIN entered. certutil: could not authenticate to token NSS Certificate DB.: The security password entered is incorrect. [Reading Key Info With Bogus PIN Location.] @@ -85,12 +77,10 @@ OK (2048). [Creating database with PIN.] [Generating key (dbm) with PIN.] OK. -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Reading Key Info Without PIN.] Failed to read key "dbm:$tmpdir/dbmdb":"Test". (Need PIN.) -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" Incorrect password/PIN entered. certutil: could not authenticate to token NSS Certificate DB.: The security password entered is incorrect. [Reading Key Info With Bogus PIN Location.] diff --git a/tests/015-lockedkey-sql/expected.out b/tests/015-lockedkey-sql/expected.out index 48a1a90..a739284 100644 --- a/tests/015-lockedkey-sql/expected.out +++ b/tests/015-lockedkey-sql/expected.out @@ -36,40 +36,32 @@ OK (2048). [Not pre-creating database.] [Generating key (sql) without PIN.] OK. -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Providing Unnecessary PIN.] [Reading Key Info With Unnecessary PIN.] Failed to read key "sql:$tmpdir/sqldb":"Test". (Need PIN.) -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Generating CSR With Unnecessary PIN.] -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Creating database, without PIN.] [Generating key (sql) without PIN.] OK. -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Providing Unnecessary PIN.] [Reading Key Info With Unnecessary PIN.] Failed to read key "sql:$tmpdir/sqldb":"Test". (Need PIN.) -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Generating CSR With Unnecessary PIN.] -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Not pre-creating database, with PIN.] [Generating key (sql) with PIN.] OK. -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Reading Key Info Without PIN.] Failed to read key "sql:$tmpdir/sqldb":"Test". (Need PIN.) -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" Incorrect password/PIN entered. certutil: could not authenticate to token NSS Certificate DB.: The security password entered is incorrect. [Reading Key Info With Bogus PIN Location.] @@ -85,12 +77,10 @@ OK (2048). [Creating database with PIN.] [Generating key (sql) with PIN.] OK. -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Reading Key Info Without PIN.] Failed to read key "sql:$tmpdir/sqldb":"Test". (Need PIN.) -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" Incorrect password/PIN entered. certutil: could not authenticate to token NSS Certificate DB.: The security password entered is incorrect. [Reading Key Info With Bogus PIN Location.] diff --git a/tests/015-lockedkey/expected.out b/tests/015-lockedkey/expected.out index 779308e..eae75dc 100644 --- a/tests/015-lockedkey/expected.out +++ b/tests/015-lockedkey/expected.out @@ -36,40 +36,32 @@ OK (2048). [Not pre-creating database.] [Generating key without PIN.] OK. -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Providing Unnecessary PIN.] [Reading Key Info With Unnecessary PIN.] Failed to read key "$tmpdir/db":"Test". (Need PIN.) -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Generating CSR With Unnecessary PIN.] -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Creating database, without PIN.] [Generating key without PIN.] OK. -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Providing Unnecessary PIN.] [Reading Key Info With Unnecessary PIN.] Failed to read key "$tmpdir/db":"Test". (Need PIN.) -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Generating CSR With Unnecessary PIN.] -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Not pre-creating database, with PIN.] [Generating key with PIN.] OK. -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Reading Key Info Without PIN.] Failed to read key "$tmpdir/db":"Test". (Need PIN.) -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" Incorrect password/PIN entered. certutil: could not authenticate to token NSS Certificate DB.: The security password entered is incorrect. [Reading Key Info With Bogus PIN Location.] @@ -85,12 +77,10 @@ OK (2048). [Creating database with PIN.] [Generating key with PIN.] OK. -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa PRIVATE-KEY Test [Reading Key Info Without PIN.] Failed to read key "$tmpdir/db":"Test". (Need PIN.) -certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" Incorrect password/PIN entered. certutil: could not authenticate to token NSS Certificate DB.: The security password entered is incorrect. [Reading Key Info With Bogus PIN Location.] diff --git a/tests/015-lockedkey/run.sh b/tests/015-lockedkey/run.sh index 7f1d973..1f6340d 100755 --- a/tests/015-lockedkey/run.sh +++ b/tests/015-lockedkey/run.sh @@ -10,7 +10,8 @@ echo $pin > pin.txt echo "" > empty.txt clean() { - sed 's|'"$tmpdir"'|$tmpdir|g' + sed -r -e 's|'"$tmpdir"'|$tmpdir|g' -e 's,: SEC_ERROR_[^:]+: ,: ,g' |\ + grep -vF 'certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services"' } echo '['Generate Key Without PIN.']'