Skip to content

Instantly share code, notes, and snippets.

@conorsch
Created February 6, 2018 01:10
Show Gist options
  • Select an option

  • Save conorsch/b76b0ae5f81b1a78428d59e1b4666e7a to your computer and use it in GitHub Desktop.

Select an option

Save conorsch/b76b0ae5f81b1a78428d59e1b4666e7a to your computer and use it in GitHub Desktop.
app-test failures on 4.4.115 candidate kernel image for SD
============================= test session starts ==============================
platform linux2 -- Python 2.7.6, pytest-3.3.2, py-1.5.2, pluggy-0.6.0 -- /usr/bin/python
cachedir: .cache
rootdir: /var/www/securedrop, inifile:
plugins: cov-2.5.1
collecting ... collected 229 items
tests/test_2fa.py::TestJournalist2FA::test_bad_token_fails_to_verify_on_admin_new_user_two_factor_page PASSED [ 0%]
tests/test_2fa.py::TestJournalist2FA::test_bad_token_fails_to_verify_on_new_user_two_factor_page PASSED [ 0%]
tests/test_2fa.py::TestJournalist2FA::test_totp_reuse_protections PASSED [ 1%]
tests/test_2fa.py::TestJournalist2FA::test_totp_reuse_protections2 PASSED [ 1%]
tests/test_crypto_util.py::TestCryptoUtil::test_basic_encrypt_then_decrypt_multiple_recipients PASSED [ 2%]
tests/test_crypto_util.py::TestCryptoUtil::test_clean PASSED [ 2%]
tests/test_crypto_util.py::TestCryptoUtil::test_delete_reply_keypair PASSED [ 3%]
tests/test_crypto_util.py::TestCryptoUtil::test_delete_reply_keypair_no_key PASSED [ 3%]
tests/test_crypto_util.py::TestCryptoUtil::test_display_id PASSED [ 3%]
tests/test_crypto_util.py::TestCryptoUtil::test_encrypt_binary_stream PASSED [ 4%]
tests/test_crypto_util.py::TestCryptoUtil::test_encrypt_failure PASSED [ 4%]
tests/test_crypto_util.py::TestCryptoUtil::test_encrypt_fingerprints_not_a_list_or_tuple PASSED [ 5%]
tests/test_crypto_util.py::TestCryptoUtil::test_encrypt_success PASSED [ 5%]
tests/test_crypto_util.py::TestCryptoUtil::test_encrypt_without_output PASSED [ 6%]
tests/test_crypto_util.py::TestCryptoUtil::test_genkeypair PASSED [ 6%]
tests/test_crypto_util.py::TestCryptoUtil::test_genrandomid_default_locale_is_en PASSED [ 6%]
tests/test_crypto_util.py::TestCryptoUtil::test_get_wordlist PASSED [ 7%]
tests/test_crypto_util.py::TestCryptoUtil::test_getkey PASSED [ 7%]
tests/test_crypto_util.py::TestCryptoUtil::test_hash_codename PASSED [ 8%]
tests/test_crypto_util.py::TestCryptoUtil::test_word_list_does_not_contain_empty_strings PASSED [ 8%]
tests/test_db.py::TestDatabase::test_get_one_or_else_multiple_results PASSED [ 9%]
tests/test_db.py::TestDatabase::test_get_one_or_else_no_result_found PASSED [ 9%]
tests/test_db.py::TestDatabase::test_get_one_or_else_returns_one PASSED [ 10%]
tests/test_db.py::TestDatabase::test_journalist_string_representation PASSED [ 10%]
tests/test_db.py::TestDatabase::test_reply_string_representation PASSED [ 10%]
tests/test_db.py::TestDatabase::test_source_string_representation PASSED [ 11%]
tests/test_db.py::TestDatabase::test_submission_string_representation PASSED [ 11%]
tests/test_db.py::TestDatabase::test_throttle_login PASSED [ 12%]
tests/test_i18n.py::TestI18N::test_get_supported_locales PASSED [ 12%]
tests/test_i18n.py::TestI18N::test_html_en_lang_correct PASSED [ 13%]
tests/test_i18n.py::TestI18N::test_html_fr_lang_correct PASSED [ 13%]
tests/test_i18n.py::TestI18N::test_i18n PASSED [ 13%]
tests/test_i18n.py::TestI18N::test_locale_to_rfc_5646 PASSED [ 14%]
tests/test_i18n.py::TestI18N::test_verify_default_locale_en_us_if_not_defined_in_config PASSED [ 14%]
tests/test_integration.py::TestIntegration::test_delete_collection FAILED [ 15%]
tests/test_integration.py::TestIntegration::test_delete_collections FAILED [ 15%]
tests/test_integration.py::TestIntegration::test_filenames PASSED [ 16%]
tests/test_integration.py::TestIntegration::test_filenames_delete FAILED [ 16%]
tests/test_integration.py::TestIntegration::test_login_after_regenerate_hotp PASSED [ 17%]
tests/test_integration.py::TestIntegration::test_reply_normal FAILED [ 17%]
tests/test_integration.py::TestIntegration::test_submit_file FAILED [ 17%]
tests/test_integration.py::TestIntegration::test_submit_message FAILED [ 18%]
tests/test_integration.py::TestIntegration::test_unicode_reply_with_ansi_env FAILED [ 18%]
tests/test_integration.py::TestIntegration::test_user_change_password PASSED [ 19%]
tests/test_journalist.py::TestJournalistApp::test_admin_add_user PASSED [ 19%]
tests/test_journalist.py::TestJournalistApp::test_admin_add_user_integrity_error PASSED [ 20%]
tests/test_journalist.py::TestJournalistApp::test_admin_add_user_password_too_long_warning PASSED [ 20%]
tests/test_journalist.py::TestJournalistApp::test_admin_add_user_too_short_username PASSED [ 20%]
tests/test_journalist.py::TestJournalistApp::test_admin_add_user_when_username_already_in_use PASSED [ 21%]
tests/test_journalist.py::TestJournalistApp::test_admin_add_user_without_username PASSED [ 21%]
tests/test_journalist.py::TestJournalistApp::test_admin_add_user_yubikey_correct_length_with_whitespace PASSED [ 22%]
tests/test_journalist.py::TestJournalistApp::test_admin_add_user_yubikey_odd_length PASSED [ 22%]
tests/test_journalist.py::TestJournalistApp::test_admin_add_user_yubikey_valid_length PASSED [ 23%]
tests/test_journalist.py::TestJournalistApp::test_admin_cannot_delete_self PASSED [ 23%]
tests/test_journalist.py::TestJournalistApp::test_admin_delete_user PASSED [ 24%]
tests/test_journalist.py::TestJournalistApp::test_admin_deletes_invalid_user_404 PASSED [ 24%]
tests/test_journalist.py::TestJournalistApp::test_admin_edits_user_invalid_username PASSED [ 24%]
tests/test_journalist.py::TestJournalistApp::test_admin_edits_user_password_error_response PASSED [ 25%]
tests/test_journalist.py::TestJournalistApp::test_admin_edits_user_password_success_response PASSED [ 25%]
tests/test_journalist.py::TestJournalistApp::test_admin_edits_user_password_too_long_warning PASSED [ 26%]
tests/test_journalist.py::TestJournalistApp::test_admin_has_link_to_admin_index_page_in_index_page PASSED [ 26%]
tests/test_journalist.py::TestJournalistApp::test_admin_has_link_to_edit_account_page_in_index_page PASSED [ 27%]
tests/test_journalist.py::TestJournalistApp::test_admin_index PASSED [ 27%]
tests/test_journalist.py::TestJournalistApp::test_admin_login_redirects_to_index PASSED [ 27%]
tests/test_journalist.py::TestJournalistApp::test_admin_logout_redirects_to_index PASSED [ 28%]
tests/test_journalist.py::TestJournalistApp::test_admin_new_user_2fa_redirect PASSED [ 28%]
tests/test_journalist.py::TestJournalistApp::test_admin_page_restriction_http_gets PASSED [ 29%]
tests/test_journalist.py::TestJournalistApp::test_admin_page_restriction_http_posts PASSED [ 29%]
tests/test_journalist.py::TestJournalistApp::test_admin_renames_user PASSED [ 30%]
tests/test_journalist.py::TestJournalistApp::test_admin_resets_hotp_with_missing_otp_secret_key PASSED [ 30%]
tests/test_journalist.py::TestJournalistApp::test_admin_resets_user_hotp PASSED [ 31%]
tests/test_journalist.py::TestJournalistApp::test_admin_resets_user_hotp_error PASSED [ 31%]
tests/test_journalist.py::TestJournalistApp::test_admin_resets_user_hotp_format_non_hexa PASSED [ 31%]
tests/test_journalist.py::TestJournalistApp::test_admin_resets_user_hotp_format_odd PASSED [ 32%]
tests/test_journalist.py::TestJournalistApp::test_admin_resets_user_totp PASSED [ 32%]
tests/test_journalist.py::TestJournalistApp::test_admin_sets_user_to_admin PASSED [ 33%]
tests/test_journalist.py::TestJournalistApp::test_col_process_aborts_with_bad_action PASSED [ 33%]
tests/test_journalist.py::TestJournalistApp::test_col_process_successfully_deletes_multiple_sources PASSED [ 34%]
tests/test_journalist.py::TestJournalistApp::test_col_process_successfully_stars_sources PASSED [ 34%]
tests/test_journalist.py::TestJournalistApp::test_col_process_successfully_unstars_sources PASSED [ 34%]
tests/test_journalist.py::TestJournalistApp::test_creation_of_ossec_test_log_event PASSED [ 35%]
tests/test_journalist.py::TestJournalistApp::test_csrf_error_page PASSED [ 35%]
tests/test_journalist.py::TestJournalistApp::test_delete_collection_updates_db PASSED [ 36%]
tests/test_journalist.py::TestJournalistApp::test_delete_source_deletes_docs_on_disk FAILED [ 36%]
tests/test_journalist.py::TestJournalistApp::test_delete_source_deletes_source_key PASSED [ 37%]
tests/test_journalist.py::TestJournalistApp::test_delete_source_deletes_submissions PASSED [ 37%]
tests/test_journalist.py::TestJournalistApp::test_download_all_selected_sources PASSED [ 37%]
tests/test_journalist.py::TestJournalistApp::test_download_selected_submissions_from_source PASSED [ 38%]
tests/test_journalist.py::TestJournalistApp::test_download_unread_all_sources PASSED [ 38%]
tests/test_journalist.py::TestJournalistApp::test_edit_hotp PASSED [ 39%]
tests/test_journalist.py::TestJournalistApp::test_empty_replies_are_rejected PASSED [ 39%]
tests/test_journalist.py::TestJournalistApp::test_http_get_on_admin_add_user_page PASSED [ 40%]
tests/test_journalist.py::TestJournalistApp::test_http_get_on_admin_new_user_two_factor_page PASSED [ 40%]
tests/test_journalist.py::TestJournalistApp::test_incorrect_current_password_change PASSED [ 41%]
tests/test_journalist.py::TestJournalistApp::test_journalist_session_expiration PASSED [ 41%]
tests/test_journalist.py::TestJournalistApp::test_login_invalid_credentials PASSED [ 41%]
tests/test_journalist.py::TestJournalistApp::test_login_throttle PASSED [ 42%]
tests/test_journalist.py::TestJournalistApp::test_login_valid_credentials PASSED [ 42%]
tests/test_journalist.py::TestJournalistApp::test_logo_upload_with_empty_input_field_fails PASSED [ 43%]
tests/test_journalist.py::TestJournalistApp::test_logo_upload_with_invalid_filetype_fails PASSED [ 43%]
tests/test_journalist.py::TestJournalistApp::test_logo_upload_with_valid_image_succeeds PASSED [ 44%]
tests/test_journalist.py::TestJournalistApp::test_make_password PASSED [ 44%]
tests/test_journalist.py::TestJournalistApp::test_max_password_length PASSED [ 44%]
tests/test_journalist.py::TestJournalistApp::test_min_password_length PASSED [ 45%]
tests/test_journalist.py::TestJournalistApp::test_nonempty_replies_are_accepted PASSED [ 45%]
tests/test_journalist.py::TestJournalistApp::test_regenerate_totp PASSED [ 46%]
tests/test_journalist.py::TestJournalistApp::test_reply_error_flashed_message PASSED [ 46%]
tests/test_journalist.py::TestJournalistApp::test_reply_error_logging PASSED [ 47%]
tests/test_journalist.py::TestJournalistApp::test_single_source_is_successfully_starred PASSED [ 47%]
tests/test_journalist.py::TestJournalistApp::test_single_source_is_successfully_unstarred PASSED [ 48%]
tests/test_journalist.py::TestJournalistApp::test_too_long_user_password_change PASSED [ 48%]
tests/test_journalist.py::TestJournalistApp::test_unauthorized_access_redirects_to_login PASSED [ 48%]
tests/test_journalist.py::TestJournalistApp::test_user_authorization_for_gets PASSED [ 49%]
tests/test_journalist.py::TestJournalistApp::test_user_authorization_for_posts PASSED [ 49%]
tests/test_journalist.py::TestJournalistApp::test_user_edits_password_error_reponse PASSED [ 50%]
tests/test_journalist.py::TestJournalistApp::test_user_edits_password_expires_session PASSED [ 50%]
tests/test_journalist.py::TestJournalistApp::test_user_edits_password_success_response PASSED [ 51%]
tests/test_journalist.py::TestJournalistApp::test_user_edits_password_too_long_warning PASSED [ 51%]
tests/test_journalist.py::TestJournalistApp::test_user_has_link_to_edit_account_page_in_index_page PASSED [ 51%]
tests/test_journalist.py::TestJournalistApp::test_user_lacks_link_to_admin_index_page_in_index_page PASSED [ 52%]
tests/test_journalist.py::TestJournalistApp::test_user_login_redirects_to_index PASSED [ 52%]
tests/test_journalist.py::TestJournalistApp::test_user_logout_redirects_to_index PASSED [ 53%]
tests/test_journalist.py::TestJournalistApp::test_user_resets_hotp PASSED [ 53%]
tests/test_journalist.py::TestJournalistApp::test_user_resets_totp PASSED [ 54%]
tests/test_journalist.py::TestJournalistApp::test_valid_user_password_change PASSED [ 54%]
tests/test_journalist.py::TestJournalistApp::test_validate_redirect PASSED [ 55%]
tests/test_journalist.py::TestJournalistLocale::test_render_locales PASSED [ 55%]
tests/test_journalist.py::TestJournalistLogin::test_login_with_invalid_password_doesnt_call_scrypt PASSED [ 55%]
tests/test_journalist.py::TestJournalistLogin::test_valid_login_calls_scrypt PASSED [ 56%]
tests/test_manage.py::TestManagePy::test_parse_args PASSED [ 56%]
tests/test_manage.py::TestManagePy::test_not_verbose PASSED [ 57%]
tests/test_manage.py::TestManagePy::test_verbose PASSED [ 57%]
tests/test_manage.py::TestManagementCommand::test_delete_non_existent_user PASSED [ 58%]
tests/test_manage.py::TestManagementCommand::test_delete_user PASSED [ 58%]
tests/test_manage.py::TestManagementCommand::test_exception_handling_when_duplicate_username PASSED [ 58%]
tests/test_manage.py::TestManagementCommand::test_get_username_fail PASSED [ 59%]
tests/test_manage.py::TestManagementCommand::test_get_username_success PASSED [ 59%]
tests/test_manage.py::TestManagementCommand::test_get_username_to_delete PASSED [ 60%]
tests/test_manage.py::TestManagementCommand::test_get_yubikey_usage_no PASSED [ 60%]
tests/test_manage.py::TestManagementCommand::test_get_yubikey_usage_yes PASSED [ 61%]
tests/test_manage.py::TestManagementCommand::test_handle_invalid_secret PASSED [ 61%]
tests/test_manage.py::TestManagementCommand::test_reset PASSED [ 62%]
tests/test_manage.py::TestManage::test_get_username PASSED [ 62%]
tests/test_manage.py::TestManage::test_translate_desktop_l10n PASSED [ 62%]
tests/test_manage.py::TestManage::test_translate_messages_l10n PASSED [ 63%]
tests/test_manage.py::TestManage::test_translate_messages_compile_arg PASSED [ 63%]
tests/test_manage.py::TestManage::test_clean_tmp_do_nothing PASSED [ 64%]
tests/test_manage.py::TestManage::test_clean_tmp_too_young PASSED [ 64%]
tests/test_manage.py::TestManage::test_clean_tmp_removed PASSED [ 65%]
tests/test_manage.py::TestSh::test_sh PASSED [ 65%]
tests/test_manage.py::TestSh::test_sh_progress PASSED [ 65%]
tests/test_manage.py::TestSh::test_sh_input PASSED [ 66%]
tests/test_manage.py::TestSh::test_sh_fail PASSED [ 66%]
tests/test_secure_tempfile.py::TestSecureTempfile::test_SecureTemporaryFile_is_a_STREAMLIKE_TYPE PASSED [ 67%]
tests/test_secure_tempfile.py::TestSecureTempfile::test_buffered_read PASSED [ 67%]
tests/test_secure_tempfile.py::TestSecureTempfile::test_file_is_removed_from_disk PASSED [ 68%]
tests/test_secure_tempfile.py::TestSecureTempfile::test_file_seems_encrypted PASSED [ 68%]
tests/test_secure_tempfile.py::TestSecureTempfile::test_read_before_writing PASSED [ 68%]
tests/test_secure_tempfile.py::TestSecureTempfile::test_read_write_unicode PASSED [ 69%]
tests/test_secure_tempfile.py::TestSecureTempfile::test_tmp_file_id_omits_invalid_chars PASSED [ 69%]
tests/test_secure_tempfile.py::TestSecureTempfile::test_write_then_read_once PASSED [ 70%]
tests/test_secure_tempfile.py::TestSecureTempfile::test_write_then_read_then_write PASSED [ 70%]
tests/test_secure_tempfile.py::TestSecureTempfile::test_write_then_read_twice PASSED [ 71%]
tests/test_secure_tempfile.py::TestSecureTempfile::test_write_twice_then_read_once PASSED [ 71%]
tests/test_securedrop-admin.py::TestSecureDropAdmin::test_verbose PASSED [ 72%]
tests/test_securedrop-admin.py::TestSecureDropAdmin::test_not_verbose PASSED [ 72%]
tests/test_securedrop-admin.py::TestSecureDropAdmin::test_run_command PASSED [ 72%]
tests/test_securedrop-admin.py::TestSecureDropAdmin::test_install_pip_dependencies_up_to_date PASSED [ 73%]
tests/test_securedrop-admin.py::TestSecureDropAdmin::test_install_pip_dependencies_upgraded PASSED [ 73%]
tests/test_securedrop-admin.py::TestSecureDropAdmin::test_install_pip_dependencies_fail PASSED [ 74%]
tests/test_source.py::TestSourceApp::test_all_words_in_wordlist_validate PASSED [ 74%]
tests/test_source.py::TestSourceApp::test_create_duplicate_codename PASSED [ 75%]
tests/test_source.py::TestSourceApp::test_create_new_source PASSED [ 75%]
tests/test_source.py::TestSourceApp::test_csrf_error_page PASSED [ 75%]
tests/test_source.py::TestSourceApp::test_delete_all_replies_already_deleted PASSED [ 76%]
tests/test_source.py::TestSourceApp::test_delete_all_successfully_deletes_replies PASSED [ 76%]
tests/test_source.py::TestSourceApp::test_failed_normalize_timestamps_logs_warning PASSED [ 77%]
tests/test_source.py::TestSourceApp::test_generate PASSED [ 77%]
tests/test_source.py::TestSourceApp::test_generate_already_logged_in PASSED [ 78%]
tests/test_source.py::TestSourceApp::test_generate_too_long_codename PASSED [ 78%]
tests/test_source.py::TestSourceApp::test_index PASSED [ 79%]
tests/test_source.py::TestSourceApp::test_initial_submission_notification PASSED [ 79%]
tests/test_source.py::TestSourceApp::test_login_and_logout PASSED [ 79%]
tests/test_source.py::TestSourceApp::test_login_with_invalid_codename PASSED [ 80%]
tests/test_source.py::TestSourceApp::test_login_with_overly_long_codename PASSED [ 80%]
tests/test_source.py::TestSourceApp::test_login_with_whitespace PASSED [ 81%]
tests/test_source.py::TestSourceApp::test_lookup PASSED [ 81%]
tests/test_source.py::TestSourceApp::test_metadata_route PASSED [ 82%]
tests/test_source.py::TestSourceApp::test_page_not_found PASSED [ 82%]
tests/test_source.py::TestSourceApp::test_source_is_deleted_while_logged_in PASSED [ 82%]
tests/test_source.py::TestSourceApp::test_submit_big_message PASSED [ 83%]
tests/test_source.py::TestSourceApp::test_submit_both PASSED [ 83%]
tests/test_source.py::TestSourceApp::test_submit_empty_message PASSED [ 84%]
tests/test_source.py::TestSourceApp::test_submit_file PASSED [ 84%]
tests/test_source.py::TestSourceApp::test_submit_message PASSED [ 85%]
tests/test_source.py::TestSourceApp::test_submit_message_with_enough_entropy PASSED [ 85%]
tests/test_source.py::TestSourceApp::test_submit_message_with_low_entropy PASSED [ 86%]
tests/test_source.py::TestSourceApp::test_submit_sanitizes_filename PASSED [ 86%]
tests/test_source.py::TestSourceApp::test_tor2web_warning PASSED [ 86%]
tests/test_source.py::TestSourceApp::test_tor2web_warning_headers PASSED [ 87%]
tests/test_source.py::TestSourceApp::test_user_must_log_in_for_protected_views PASSED [ 87%]
tests/test_source.py::TestSourceApp::test_why_journalist_key PASSED [ 88%]
tests/test_source.py::TestSourceApp::test_why_use_tor_browser PASSED [ 88%]
tests/test_store.py::TestStore::test_get_zip PASSED [ 89%]
tests/test_store.py::TestStore::test_path_returns_filename_of_folder PASSED [ 89%]
tests/test_store.py::TestStore::test_path_returns_filename_of_items_within_folder PASSED [ 89%]
tests/test_store.py::TestStore::test_rename_submission_with_invalid_filename PASSED [ 90%]
tests/test_store.py::TestStore::test_rename_valid_submission PASSED [ 90%]
tests/test_store.py::TestStore::test_verify_flagged_file_in_sourcedir_returns_true PASSED [ 91%]
tests/test_store.py::TestStore::test_verify_in_store_dir PASSED [ 91%]
tests/test_store.py::TestStore::test_verify_invalid_file_extension_in_sourcedir_raises_exception PASSED [ 92%]
tests/test_store.py::TestStore::test_verify_invalid_filename_in_sourcedir_raises_exception PASSED [ 92%]
tests/test_store.py::TestStore::test_verify_path_not_absolute PASSED [ 93%]
tests/test_store.py::TestStore::test_verify_store_dir_not_absolute PASSED [ 93%]
tests/test_template_filters.py::TestTemplateFilters::test_filters PASSED [ 93%]
tests/functional/test_admin_interface.py::TestAdminInterface::test_admin_interface <- tests/functional/step_helpers.py PASSED [ 94%]
tests/functional/test_admin_interface.py::TestAdminInterface::test_admin_updates_image PASSED [ 94%]
tests/functional/test_admin_interface.py::TestAdminInterface::test_ossec_alert_button PASSED [ 95%]
tests/functional/test_journalist.py::TestJournalist::test_journalist_verifies_deletion_of_one_submission_javascript PASSED [ 95%]
tests/functional/test_source.py::TestSourceInterface::test_lookup_codename_hint PASSED [ 96%]
tests/functional/test_source_notfound.py::TestSourceInterfaceNotFound::test_not_found PASSED [ 96%]
tests/functional/test_source_session_timeout.py::TestSourceSessions::test_source_session_timeout PASSED [ 96%]
tests/functional/test_source_warnings.py::TestSourceInterfaceBannerWarnings::test_warning_appears_if_tor_browser_not_in_use PASSED [ 97%]
tests/functional/test_submission_not_in_memory.py::TestSubmissionNotInMemory::test_message_is_not_retained_in_memory xfail [ 97%]
tests/functional/test_submission_not_in_memory.py::TestSubmissionNotInMemory::test_file_upload_is_not_retained_in_memory xfail [ 98%]
tests/functional/test_submit_and_retrieve_file.py::TestSubmitAndRetrieveFile::test_submit_and_retrieve_happy_path <- tests/functional/step_helpers.py PASSED [ 98%]
tests/functional/test_submit_and_retrieve_file.py::TestSubmitAndRetrieveFile::test_source_cancels_at_login_page <- tests/functional/step_helpers.py PASSED [ 99%]
tests/functional/test_submit_and_retrieve_file.py::TestSubmitAndRetrieveFile::test_source_cancels_at_submit_page <- tests/functional/step_helpers.py PASSED [ 99%]
tests/functional/test_submit_and_retrieve_message.py::TestSubmitAndRetrieveMessage::test_submit_and_retrieve_happy_path <- tests/functional/step_helpers.py PASSED [100%]
=================================== FAILURES ===================================
____________________ TestIntegration.test_delete_collection ____________________
self = <tests.test_integration.TestIntegration testMethod=test_delete_collection>
async_genkey = <MagicMock name='async_genkey' id='3520407047696'>
@patch('source_app.main.async_genkey')
def test_delete_collection(self, async_genkey):
"""Test the "delete collection" button on each collection page"""
# first, add a source
with self.source_app.test_client() as app:
app.get('/generate')
app.post('/create')
resp = app.post('/submit', data=dict(
msg="This is a test.",
fh=(StringIO(''), ''),
), follow_redirects=True)
assert resp.status_code == 200, resp.data.decode('utf-8')
with self.journalist_app.test_client() as app:
self._login_user(app)
resp = app.get('/')
# navigate to the collection page
soup = BeautifulSoup(resp.data, 'html.parser')
first_col_url = soup.select('ul#cols > li a')[0]['href']
resp = app.get(first_col_url)
self.assertEqual(resp.status_code, 200)
# find the delete form and extract the post parameters
soup = BeautifulSoup(resp.data, 'html.parser')
delete_form_inputs = soup.select(
'form#delete-collection')[0]('input')
filesystem_id = delete_form_inputs[1]['value']
col_name = delete_form_inputs[2]['value']
resp = app.post('/col/delete/' + filesystem_id,
follow_redirects=True)
self.assertEquals(resp.status_code, 200)
self.assertIn(escape("%s's collection deleted" % (col_name,)),
resp.data)
self.assertIn("No documents have been submitted!", resp.data)
self.assertTrue(async_genkey.called)
# Make sure the collection is deleted from the filesystem
utils.async.wait_for_assertion(
> lambda: self.assertFalse(
os.path.exists(store.path(filesystem_id)))
)
tests/test_integration.py:481:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils/async.py:47: in wait_for_assertion
return assertion_expression()
tests/test_integration.py:482: in <lambda>
os.path.exists(store.path(filesystem_id)))
E AssertionError: True is not false
___________________ TestIntegration.test_delete_collections ____________________
self = <tests.test_integration.TestIntegration testMethod=test_delete_collections>
async_genkey = <MagicMock name='async_genkey' id='3520397800464'>
@patch('source_app.main.async_genkey')
def test_delete_collections(self, async_genkey):
"""Test the "delete selected" checkboxes on the index page that can be
used to delete multiple collections"""
# first, add some sources
with self.source_app.test_client() as app:
num_sources = 2
for i in range(num_sources):
app.get('/generate')
app.post('/create')
app.post('/submit', data=dict(
msg="This is a test " + str(i) + ".",
fh=(StringIO(''), ''),
), follow_redirects=True)
app.get('/logout')
with self.journalist_app.test_client() as app:
self._login_user(app)
resp = app.get('/')
# get all the checkbox values
soup = BeautifulSoup(resp.data, 'html.parser')
checkbox_values = [checkbox['value'] for checkbox in
soup.select('input[name="cols_selected"]')]
resp = app.post('/col/process', data=dict(
action='delete',
cols_selected=checkbox_values
), follow_redirects=True)
self.assertEqual(resp.status_code, 200)
self.assertIn("%s collections deleted" % (num_sources,), resp.data)
self.assertTrue(async_genkey.called)
# Make sure the collections are deleted from the filesystem
> utils.async.wait_for_assertion(lambda: self.assertFalse(
any([os.path.exists(store.path(filesystem_id))
for filesystem_id in checkbox_values])))
tests/test_integration.py:518:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils/async.py:47: in wait_for_assertion
return assertion_expression()
tests/test_integration.py:520: in <lambda>
for filesystem_id in checkbox_values])))
E AssertionError: True is not false
____________________ TestIntegration.test_filenames_delete _____________________
self = <tests.test_integration.TestIntegration testMethod=test_filenames_delete>
def test_filenames_delete(self):
"""Test pretty, sequential filenames when journalist deletes files"""
# add a source and submit stuff
with self.source_app.test_client() as app:
app.get('/generate')
app.post('/create')
self.helper_filenames_submit(app)
# navigate to the collection page
with self.journalist_app.test_client() as app:
self._login_user(app)
resp = app.get('/')
soup = BeautifulSoup(resp.data, 'html.parser')
first_col_url = soup.select('ul#cols > li a')[0]['href']
resp = app.get(first_col_url)
self.assertEqual(resp.status_code, 200)
soup = BeautifulSoup(resp.data, 'html.parser')
# delete file #2
> self.helper_filenames_delete(app, soup, 1)
tests/test_integration.py:568:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_integration.py:682: in helper_filenames_delete
utils.async.wait_for_assertion(lambda: self.assertFalse(
tests/utils/async.py:47: in wait_for_assertion
return assertion_expression()
tests/test_integration.py:684: in <lambda>
for doc_name in checkbox_values])))
E AssertionError: True is not false
----------------------------- Captured stderr call -----------------------------
[2018-02-06 00:05:33,620] ERROR in utils: async_genkey for source (filesystem_id=AXT3PQIZMYAMHOZ4MIVX6ZGHCWP3GKWNI5UW2UMMANIGQJ6CUTYH45VTEP63X2DAWPRTS3PUPQBAFCLI4JMOZHVZPOZXGIKWMCFJQ3I=): No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
______________________ TestIntegration.test_reply_normal _______________________
self = <tests.test_integration.TestIntegration testMethod=test_reply_normal>
def test_reply_normal(self):
> self.helper_test_reply("This is a test reply.", True)
tests/test_integration.py:256:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_integration.py:406: in helper_test_reply
self.helper_filenames_delete(app, soup, last_reply_number)
tests/test_integration.py:682: in helper_filenames_delete
utils.async.wait_for_assertion(lambda: self.assertFalse(
tests/utils/async.py:47: in wait_for_assertion
return assertion_expression()
tests/test_integration.py:684: in <lambda>
for doc_name in checkbox_values])))
E AssertionError: True is not false
----------------------------- Captured stderr call -----------------------------
[2018-02-06 00:05:48,413] ERROR in utils: async_genkey for source (filesystem_id=IURGLTZWSFNXNEFU5CYFVEVWLADPWP3S46ANW5FZHGPO3ETLBT65HCTI5RSPVFK2TOODDACAHWWKUV2CAIK537Z5COKS5TOCKOCQ4FY=): No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
_______________________ TestIntegration.test_submit_file _______________________
self = <tests.test_integration.TestIntegration testMethod=test_submit_file>
def test_submit_file(self):
"""When a source creates an account, test that a new entry appears
in the journalist interface"""
test_file_contents = "This is a test file."
test_filename = "test.txt"
with self.source_app.test_client() as app:
resp = app.get('/generate')
resp = app.post('/create', follow_redirects=True)
filesystem_id = g.filesystem_id
# redirected to submission form
resp = app.post('/submit', data=dict(
msg="",
fh=(StringIO(test_file_contents), test_filename),
), follow_redirects=True)
self.assertEqual(resp.status_code, 200)
app.get('/logout')
with self.journalist_app.test_client() as app:
self._login_user(app)
resp = app.get('/')
self.assertEqual(resp.status_code, 200)
self.assertIn("Sources", resp.data)
soup = BeautifulSoup(resp.data, 'html.parser')
# The source should have a "download unread" link that says
# "1 unread"
col = soup.select('ul#cols > li')[0]
unread_span = col.select('span.unread a')[0]
self.assertIn("1 unread", unread_span.get_text())
col_url = soup.select('ul#cols > li a')[0]['href']
resp = app.get(col_url)
self.assertEqual(resp.status_code, 200)
soup = BeautifulSoup(resp.data, 'html.parser')
submission_url = soup.select('ul#submissions li a')[0]['href']
self.assertIn("-doc", submission_url)
span = soup.select('ul#submissions li span.info span')[0]
self.assertRegexpMatches(span['title'], "\d+ bytes")
resp = app.get(submission_url)
self.assertEqual(resp.status_code, 200)
decrypted_data = self.gpg.decrypt(resp.data)
self.assertTrue(decrypted_data.ok)
sio = StringIO(decrypted_data.data)
with gzip.GzipFile(mode='rb', fileobj=sio) as gzip_file:
unzipped_decrypted_data = gzip_file.read()
self.assertEqual(unzipped_decrypted_data, test_file_contents)
# delete submission
resp = app.get(col_url)
self.assertEqual(resp.status_code, 200)
soup = BeautifulSoup(resp.data, 'html.parser')
doc_name = soup.select(
'ul > li > input[name="doc_names_selected"]')[0]['value']
resp = app.post('/bulk', data=dict(
action='confirm_delete',
filesystem_id=filesystem_id,
doc_names_selected=doc_name
))
self.assertEqual(resp.status_code, 200)
soup = BeautifulSoup(resp.data, 'html.parser')
self.assertIn("The following file has been selected for",
resp.data)
# confirm delete submission
doc_name = soup.select
doc_name = soup.select(
'ul > li > input[name="doc_names_selected"]')[0]['value']
resp = app.post('/bulk', data=dict(
action='delete',
filesystem_id=filesystem_id,
doc_names_selected=doc_name,
), follow_redirects=True)
self.assertEqual(resp.status_code, 200)
soup = BeautifulSoup(resp.data, 'html.parser')
self.assertIn("Submission deleted.", resp.data)
# confirm that submission deleted and absent in list of submissions
resp = app.get(col_url)
self.assertEqual(resp.status_code, 200)
self.assertIn("No documents to display.", resp.data)
# the file should be deleted from the filesystem
# since file deletion is handled by a polling worker, this test
# needs to wait for the worker to get the job and execute it
utils.async.wait_for_assertion(
> lambda: self.assertFalse(
os.path.exists(store.path(filesystem_id, doc_name))
)
)
tests/test_integration.py:250:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils/async.py:47: in wait_for_assertion
return assertion_expression()
tests/test_integration.py:251: in <lambda>
os.path.exists(store.path(filesystem_id, doc_name))
E AssertionError: True is not false
----------------------------- Captured stderr call -----------------------------
[2018-02-06 00:06:03,282] ERROR in utils: async_genkey for source (filesystem_id=ZXDUEFLF6IV3EQ26FH47JFXVOTPGWSIDZPZ7MQNI2FJWNZ2XYR5YN6NXFOTQZU75CZDOBQJKPDAHM6NU6PQ44OEW7H725VMH7M2PYTQ=): No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
_____________________ TestIntegration.test_submit_message ______________________
self = <tests.test_integration.TestIntegration testMethod=test_submit_message>
def test_submit_message(self):
"""When a source creates an account, test that a new entry appears
in the journalist interface"""
test_msg = "This is a test message."
with self.source_app.test_client() as app:
resp = app.get('/generate')
resp = app.post('/create', follow_redirects=True)
filesystem_id = g.filesystem_id
# redirected to submission form
resp = app.post('/submit', data=dict(
msg=test_msg,
fh=(StringIO(''), ''),
), follow_redirects=True)
self.assertEqual(resp.status_code, 200)
app.get('/logout')
# Request the Journalist Interface index
with self.journalist_app.test_client() as app:
self._login_user(app)
rv = app.get('/')
self.assertEqual(rv.status_code, 200)
self.assertIn("Sources", rv.data)
soup = BeautifulSoup(rv.data, 'html.parser')
# The source should have a "download unread" link that
# says "1 unread"
col = soup.select('ul#cols > li')[0]
unread_span = col.select('span.unread a')[0]
self.assertIn("1 unread", unread_span.get_text())
col_url = soup.select('ul#cols > li a')[0]['href']
resp = app.get(col_url)
self.assertEqual(resp.status_code, 200)
soup = BeautifulSoup(resp.data, 'html.parser')
submission_url = soup.select('ul#submissions li a')[0]['href']
self.assertIn("-msg", submission_url)
span = soup.select('ul#submissions li span.info span')[0]
self.assertRegexpMatches(span['title'], "\d+ bytes")
resp = app.get(submission_url)
self.assertEqual(resp.status_code, 200)
decrypted_data = self.gpg.decrypt(resp.data)
self.assertTrue(decrypted_data.ok)
self.assertEqual(decrypted_data.data, test_msg)
# delete submission
resp = app.get(col_url)
self.assertEqual(resp.status_code, 200)
soup = BeautifulSoup(resp.data, 'html.parser')
doc_name = soup.select(
'ul > li > input[name="doc_names_selected"]')[0]['value']
resp = app.post('/bulk', data=dict(
action='confirm_delete',
filesystem_id=filesystem_id,
doc_names_selected=doc_name
))
self.assertEqual(resp.status_code, 200)
soup = BeautifulSoup(resp.data, 'html.parser')
self.assertIn("The following file has been selected for",
resp.data)
# confirm delete submission
doc_name = soup.select
doc_name = soup.select(
'ul > li > input[name="doc_names_selected"]')[0]['value']
resp = app.post('/bulk', data=dict(
action='delete',
filesystem_id=filesystem_id,
doc_names_selected=doc_name,
), follow_redirects=True)
self.assertEqual(resp.status_code, 200)
soup = BeautifulSoup(resp.data, 'html.parser')
self.assertIn("Submission deleted.", resp.data)
# confirm that submission deleted and absent in list of submissions
resp = app.get(col_url)
self.assertEqual(resp.status_code, 200)
self.assertIn("No documents to display.", resp.data)
# the file should be deleted from the filesystem
# since file deletion is handled by a polling worker, this test
# needs to wait for the worker to get the job and execute it
utils.async.wait_for_assertion(
> lambda: self.assertFalse(
os.path.exists(store.path(filesystem_id, doc_name))
)
)
tests/test_integration.py:156:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils/async.py:47: in wait_for_assertion
return assertion_expression()
tests/test_integration.py:157: in <lambda>
os.path.exists(store.path(filesystem_id, doc_name))
E AssertionError: True is not false
----------------------------- Captured stderr call -----------------------------
[2018-02-06 00:06:16,835] ERROR in utils: async_genkey for source (filesystem_id=2PV4ED7FHD4YLTJUJ2UIMX67OUM5WX3DUFWUPOYAIFE55HJFVZ6TUVEAPPCNGS6Z572DEEJ2FIQVCRIN4ASNEOPLUW33Q6HMJWV3EVY=): No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
_______________ TestIntegration.test_unicode_reply_with_ansi_env _______________
self = <tests.test_integration.TestIntegration testMethod=test_unicode_reply_with_ansi_env>
def test_unicode_reply_with_ansi_env(self):
# This makes python-gnupg handle encoding equivalent to if we were
# running SD in an environment where os.getenv("LANG") == "C".
# Unfortunately, with the way our test suite is set up simply setting
# that env var here will not have the desired effect. Instead we
# monkey-patch the GPG object that is called crypto_util to imitate the
# _encoding attribute it would have had it been initialized in a "C"
# environment. See
# https://github.com/freedomofpress/securedrop/issues/1360 for context.
old_encoding = crypto_util.gpg._encoding
crypto_util.gpg._encoding = "ansi_x3.4_1968"
try:
> self.helper_test_reply("ᚠᛇᚻ᛫ᛒᛦᚦ᛫ᚠᚱᚩᚠᚢᚱ᛫ᚠᛁᚱᚪ᛫ᚷᛖᚻᚹᛦᛚᚳᚢᛗ", True)
tests/test_integration.py:270:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_integration.py:406: in helper_test_reply
self.helper_filenames_delete(app, soup, last_reply_number)
tests/test_integration.py:682: in helper_filenames_delete
utils.async.wait_for_assertion(lambda: self.assertFalse(
tests/utils/async.py:47: in wait_for_assertion
return assertion_expression()
tests/test_integration.py:684: in <lambda>
for doc_name in checkbox_values])))
E AssertionError: True is not false
----------------------------- Captured stderr call -----------------------------
[2018-02-06 00:06:30,420] ERROR in utils: async_genkey for source (filesystem_id=4XXCWJM7UFLSVU5REQSVR63OTWUWQ4YE5BV2UHRMG2XYWXPM4DZVEONZQH7HL6C3O7KE5VYU6LFAF5K5GC527TMDTBPXDLNQK5IICVQ=): No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
__________ TestJournalistApp.test_delete_source_deletes_docs_on_disk ___________
self = <tests.test_journalist.TestJournalistApp testMethod=test_delete_source_deletes_docs_on_disk>
def test_delete_source_deletes_docs_on_disk(self):
"""Verify that when a source is deleted, the encrypted documents that
exist on disk is also deleted."""
self._delete_collection_setup()
# Encrypted documents exists
dir_source_docs = os.path.join(config.STORE_DIR,
self.source.filesystem_id)
self.assertTrue(os.path.exists(dir_source_docs))
job = journalist_app.utils.delete_collection(self.source.filesystem_id)
# Wait up to 5s to wait for Redis worker `srm` operation to complete
> utils.async.wait_for_redis_worker(job)
tests/test_journalist.py:968:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
job = Job(u'522ef0c6-70aa-4941-a457-7760e1e90cd6', enqueued_at=datetime.datetime(2018, 2, 6, 0, 7, 30, 362988))
timeout = 60
def wait_for_redis_worker(job, timeout=60):
"""Raise an error if the Redis job doesn't complete successfully
before a timeout.
:param rq.job.Job job: A Redis job to wait for.
:param int timeout: Seconds to wait for the job to finish.
:raises: An :exc:`AssertionError`.
"""
start_time = time.time()
while time.time() - start_time < timeout:
if job.result == REDIS_SUCCESS_RETURN_VALUE:
return
elif job.result not in (None, REDIS_SUCCESS_RETURN_VALUE):
assert False, 'Redis worker failed!'
time.sleep(0.1)
> assert False, 'Redis worker timed out!'
E AssertionError: Redis worker timed out!
tests/utils/async.py:27: AssertionError
============== 8 failed, 219 passed, 2 xfailed in 641.70 seconds ===============
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment