Bug 952876: Add test for bug 952808 (OCSP stapling not honored when there is a error entry in the OCSP cache), r=keeler

--HG--
extra : rebase_source : d83e4b3681b36616441e6fd412969998a19eae4c
extra : amend_source : 475bff5dd333fb54729fdace0f295c6e026c5a18
This commit is contained in:
Brian Smith 2014-01-06 14:45:35 -08:00
Родитель ded0276b7d
Коммит 86906b978c
2 изменённых файлов: 27 добавлений и 1 удалений

Просмотреть файл

@ -81,6 +81,32 @@ function run_test() {
clearSessionCache); clearSessionCache);
add_test(function() { do_check_eq(gFetchCount, 2); run_next_test(); }); add_test(function() { do_check_eq(gFetchCount, 2); run_next_test(); });
//---------------------------------------------------------------------------
// Reset state
add_test(function() { clearOCSPCache(); gFetchCount = 0; run_next_test(); });
// A failure to retrieve an OCSP response will result in an error entry being
// added to the cache.
add_connection_test("ocsp-stapling-none.example.com", Cr.NS_OK,
clearSessionCache);
add_test(function() { do_check_eq(gFetchCount, 1); run_next_test(); });
// The error entry will prevent a fetch from happening for a while.
add_connection_test("ocsp-stapling-none.example.com", Cr.NS_OK,
clearSessionCache);
add_test(function() { do_check_eq(gFetchCount, 1); run_next_test(); });
// The error entry must not prevent a stapled OCSP response from being
// honored.
add_connection_test("ocsp-stapling-revoked.example.com",
getXPCOMStatusFromNSS(SEC_ERROR_REVOKED_CERTIFICATE),
clearSessionCache);
add_test(function() { do_check_eq(gFetchCount, 1); run_next_test(); });
//---------------------------------------------------------------------------
add_test(function() { ocspResponder.stop(run_next_test); run_next_test(); }); add_test(function() { ocspResponder.stop(run_next_test); run_next_test(); });
run_next_test(); run_next_test();

Просмотреть файл

@ -35,7 +35,7 @@ run-sequentially = hardcoded ports
fail-if = os == "android" fail-if = os == "android"
[test_ocsp_stapling_expired.js] [test_ocsp_stapling_expired.js]
run-sequentially = hardcoded ports run-sequentially = hardcoded ports
[test_ocsp_unknown_caching.js] [test_ocsp_caching.js]
run-sequentially = hardcoded ports run-sequentially = hardcoded ports
# Bug 676972: test fails consistently on Android # Bug 676972: test fails consistently on Android
fail-if = os == "android" fail-if = os == "android"