Yubico / yubikey-manager

Python library and command line tool for configuring any YubiKey over all USB interfaces.
https://developers.yubico.com/yubikey-manager/
BSD 2-Clause "Simplified" License
878 stars 124 forks source link

4.0.3: pytest based test suite is failing #420

Closed kloczek closed 3 years ago

kloczek commented 3 years ago

4.0.2 was OK in the same build env

+ /usr/bin/python3 -Bm pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/tkloczko/rpmbuild/BUILD/yubikey-manager-4.0.3, configfile: pyproject.toml, testpaths: tests
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, cov-2.11.1, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, pyfakefs-4.4.0, freezegun-0.4.2, cases-3.4.6, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, mock-3.6.0, hypothesis-6.12.0, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, flaky-3.7.0, requests-mock-1.9.2, aiohttp-0.3.0, checkdocs-2.7.0
collected 261 items / 2 errors / 259 selected

================================================================================== ERRORS ==================================================================================
___________________________________________________________________ ERROR collecting tests/test_util.py ____________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/yubikey-manager-4.0.3/tests/test_util.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_util.py:11: in <module>
    from OpenSSL import crypto
/usr/lib/python3.8/site-packages/OpenSSL/__init__.py:8: in <module>
    from OpenSSL import crypto, SSL
/usr/lib/python3.8/site-packages/OpenSSL/crypto.py:17: in <module>
    from OpenSSL._util import (
/usr/lib/python3.8/site-packages/OpenSSL/_util.py:6: in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
/usr/lib64/python3.8/site-packages/cryptography/hazmat/bindings/openssl/binding.py:14: in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
E   ImportError: /usr/lib64/python3.8/site-packages/_cffi_backend.cpython-38-x86_64-linux-gnu.so: undefined symbol: ffi_type_longdouble
________________________________________________________________ ERROR collecting tests/device/test_piv.py _________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/yubikey-manager-4.0.3/tests/device/test_piv.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/device/test_piv.py:523: in <module>
    class TestMetadata:
tests/device/test_piv.py:579: in TestMetadata
    ???
/usr/lib64/python3.8/site-packages/cryptography/hazmat/backends/__init__.py:15: in default_backend
    from cryptography.hazmat.backends.openssl.backend import backend
/usr/lib64/python3.8/site-packages/cryptography/hazmat/backends/openssl/__init__.py:7: in <module>
    from cryptography.hazmat.backends.openssl.backend import backend
/usr/lib64/python3.8/site-packages/cryptography/hazmat/backends/openssl/backend.py:117: in <module>
    from cryptography.hazmat.bindings.openssl import binding
/usr/lib64/python3.8/site-packages/cryptography/hazmat/bindings/openssl/binding.py:14: in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
E   ImportError: /usr/lib64/python3.8/site-packages/_cffi_backend.cpython-38-x86_64-linux-gnu.so: undefined symbol: ffi_type_longdouble
========================================================================= short test summary info ==========================================================================
ERROR tests/test_util.py
ERROR tests/device/test_piv.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================ 2 errors in 1.08s =============================================================================
dainnilsson commented 3 years ago

Looks like something related to FFI in python-cryptography. You're probably getting a newer version of that now compared to when building ykman 4.0.2. What computer architecture is this running on? Do you know if cryptography is being installed from a pre-built wheel, or if it's being built from source?

kloczek commented 3 years ago

x86_64. When you've mention FFI I've just found that yesterday I've upgraded libffi. https://github.com/libffi/libffi/issues/634 Will try ASP rollback to old package and see if it works after that.

Do you know if cryptography is being installed from a pre-built wheel, or if it's being built from source?

From source. I'm using only my own packages.

kloczek commented 3 years ago

Looks like it was libffi. After rollback to binary packages used before it is ok now

+ /usr/bin/python3 -m nose --verbose test --exclude test_age_restriction.py --exclude test_download.py --exclude test_iqiyi_sdk_interpreter.py --exclude test_socks.py --exclude test_subtitles.py --exclude test_write_annotations.py --exclude test_youtube_lists.py --exclude test_youtube_signature.py
test_download_json (test.test_InfoExtractor.TestInfoExtractor) ... WARNING: [Test] None: Failed to parse JSON Expecting value: line 1 column 9 (char 8)
ok
test_extract_jwplayer_data_realworld (test.test_InfoExtractor.TestInfoExtractor) ... ok
test_html_search_meta (test.test_InfoExtractor.TestInfoExtractor) ... ok
test_html_search_regex (test.test_InfoExtractor.TestInfoExtractor) ... ok
test_ie_key (test.test_InfoExtractor.TestInfoExtractor) ... ok
test_opengraph (test.test_InfoExtractor.TestInfoExtractor) ... ok
test_parse_f4m_formats (test.test_InfoExtractor.TestInfoExtractor) ... ok
test_parse_html5_media_entries (test.test_InfoExtractor.TestInfoExtractor) ... ok
test_parse_m3u8_formats (test.test_InfoExtractor.TestInfoExtractor) ... ok
test_parse_mpd_formats (test.test_InfoExtractor.TestInfoExtractor) ... ok
test_parse_xspf (test.test_InfoExtractor.TestInfoExtractor) ... ok
test_response_with_expected_status_returns_content (test.test_InfoExtractor.TestInfoExtractor) ... ok
test_search_json_ld_realworld (test.test_InfoExtractor.TestInfoExtractor) ... ok
test_audio_only_extractor_format_selection (test.test_YoutubeDL.TestFormatSelection) ... ok
test_default_format_spec (test.test_YoutubeDL.TestFormatSelection) ... ok
test_format_filtering (test.test_YoutubeDL.TestFormatSelection) ... ok
test_format_not_available (test.test_YoutubeDL.TestFormatSelection) ... ok
test_format_selection (test.test_YoutubeDL.TestFormatSelection) ... ok
test_format_selection_audio (test.test_YoutubeDL.TestFormatSelection) ... ok
test_format_selection_audio_exts (test.test_YoutubeDL.TestFormatSelection) ... ok
test_format_selection_issue_10083 (test.test_YoutubeDL.TestFormatSelection) ... ok
test_format_selection_string_ops (test.test_YoutubeDL.TestFormatSelection) ... ok
test_format_selection_video (test.test_YoutubeDL.TestFormatSelection) ... ok
test_invalid_format_specs (test.test_YoutubeDL.TestFormatSelection) ... ok
test_prefer_free_formats (test.test_YoutubeDL.TestFormatSelection) ... ok
test_youtube_format_selection (test.test_YoutubeDL.TestFormatSelection) ... ok
test_add_extra_info (test.test_YoutubeDL.TestYoutubeDL) ... ok
test_do_not_override_ie_key_in_url_transparent (test.test_YoutubeDL.TestYoutubeDL) ... ok
test_format_note (test.test_YoutubeDL.TestYoutubeDL) ... ok
test_ignoreerrors_for_playlist_with_url_transparent_iterable_entries (test.test_YoutubeDL.TestYoutubeDL) ... ok
test_match_filter (test.test_YoutubeDL.TestYoutubeDL) ... ok
test_playlist_items_selection (test.test_YoutubeDL.TestYoutubeDL) ... ok
test_postprocessors (test.test_YoutubeDL.TestYoutubeDL) ... ok
test_prepare_filename (test.test_YoutubeDL.TestYoutubeDL) ... ok
test_subtitles (test.test_YoutubeDL.TestYoutubeDL) ... ok
test_urlopen_no_file_protocol (test.test_YoutubeDL.TestYoutubeDL) ... ok
test_keep_session_cookies (test.test_YoutubeDLCookieJar.TestYoutubeDLCookieJar) ... ok
test_malformed_cookies (test.test_YoutubeDLCookieJar.TestYoutubeDLCookieJar) ... WARNING: skipping cookie file entry due to invalid length 6: 'www.foobar.foobar\tFALSE\t/\tFALSE\t0\tCOOKIE\n'
WARNING: skipping cookie file entry due to invalid expires at 1.7976931348623157e+308: 'www.foobar.foobar\tFALSE\t/\tFALSE\t1.7976931348623157e+308\tCOOKIE\tVALUE\n'
ok
test_strip_httponly_prefix (test.test_YoutubeDLCookieJar.TestYoutubeDLCookieJar) ... ok
test_cbc_decrypt (test.test_aes.TestAES) ... ok
test_cbc_encrypt (test.test_aes.TestAES) ... ok
test_decrypt_text (test.test_aes.TestAES) ... ok
test_encrypt (test.test_aes.TestAES) ... ok
test_facebook_matching (test.test_all_urls.TestAllURLsMatching) ... ok
test_keywords (test.test_all_urls.TestAllURLsMatching) ... ok
test_no_duplicated_ie_names (test.test_all_urls.TestAllURLsMatching) ... ok
test_no_duplicates (test.test_all_urls.TestAllURLsMatching) ... ok
test_pbs (test.test_all_urls.TestAllURLsMatching) ... ok
test_soundcloud_not_matching_sets (test.test_all_urls.TestAllURLsMatching) ... ok
test_tumblr (test.test_all_urls.TestAllURLsMatching) ... ok
test_vimeo_matching (test.test_all_urls.TestAllURLsMatching) ... ok
test_youtube_channel_matching (test.test_all_urls.TestAllURLsMatching) ... ok
test_youtube_feeds (test.test_all_urls.TestAllURLsMatching) ... ok
test_youtube_matching (test.test_all_urls.TestAllURLsMatching) ... ok
test_youtube_playlist_matching (test.test_all_urls.TestAllURLsMatching) ... ok
test_youtube_user_matching (test.test_all_urls.TestAllURLsMatching) ... ok
test_cache (test.test_cache.TestCache) ... ok
test_all_present (test.test_compat.TestCompat) ... ok
test_compat_etree_Element (test.test_compat.TestCompat) ... ok
test_compat_etree_fromstring (test.test_compat.TestCompat) ... ok
test_compat_etree_fromstring_doctype (test.test_compat.TestCompat) ... ok
test_compat_expanduser (test.test_compat.TestCompat) ... ok
test_compat_getenv (test.test_compat.TestCompat) ... ok
test_compat_setenv (test.test_compat.TestCompat) ... ok
test_compat_shlex_split (test.test_compat.TestCompat) ... ok
test_compat_urllib_parse_unquote (test.test_compat.TestCompat) ... ok
test_compat_urllib_parse_unquote_plus (test.test_compat.TestCompat) ... ok
test_compat_urllib_parse_urlencode (test.test_compat.TestCompat) ... ok
test_struct_unpack (test.test_compat.TestCompat) ... ok
test_chunked (test.test_downloader_http.TestHttpFD) ... ok
test_regular (test.test_downloader_http.TestHttpFD) ... ok
test_cmdline_umlauts (test.test_execution.TestExecution) ... ok
test_import (test.test_execution.TestExecution) ... ok
test_lazy_extractors (test.test_execution.TestExecution) ... WARNING: Lazy loading extractors is an experimental feature that may not always work
.............
----------------------------------------------------------------------
Ran 13 tests in 13.414s

OK
ok
test_main_exec (test.test_execution.TestExecution) ... ok
test_module_exec (test.test_execution.TestExecution) ... ok
test_unicode_path_redirection (test.test_http.TestHTTP) ... ok
test_nocheckcertificate (test.test_http.TestHTTPS) ... ok
test_proxy (test.test_http.TestProxy) ... ok
test_proxy_with_idn (test.test_http.TestProxy) ... ok
test_array_access (test.test_jsinterp.TestJSInterpreter) ... ok
test_assignments (test.test_jsinterp.TestJSInterpreter) ... ok
test_basic (test.test_jsinterp.TestJSInterpreter) ... ok
test_calc (test.test_jsinterp.TestJSInterpreter) ... ok
test_call (test.test_jsinterp.TestJSInterpreter) ... ok
Skipping: Not yet fully implemented ... ok
test_empty_return (test.test_jsinterp.TestJSInterpreter) ... ok
test_morespace (test.test_jsinterp.TestJSInterpreter) ... ok
test_operators (test.test_jsinterp.TestJSInterpreter) ... ok
test_parens (test.test_jsinterp.TestJSInterpreter) ... ok
test_precedence (test.test_jsinterp.TestJSInterpreter) ... ok
test_strange_chars (test.test_jsinterp.TestJSInterpreter) ... ok
test_netrc_present (test.test_netrc.TestNetRc) ... ok
test_hide_login_info (test.test_options.TestOptions) ... ok
test_format_to_regex (test.test_postprocessors.TestMetadataFromTitle) ... ok
test_swf_ArrayAccess (test.test_swfinterp.TestSWFInterpreter) ... ok
test_swf_ClassCall (test.test_swfinterp.TestSWFInterpreter) ... ok
test_swf_ClassConstruction (test.test_swfinterp.TestSWFInterpreter) ... ok
test_swf_ConstArrayAccess (test.test_swfinterp.TestSWFInterpreter) ... ok
test_swf_ConstantInt (test.test_swfinterp.TestSWFInterpreter) ... ok
test_swf_DictCall (test.test_swfinterp.TestSWFInterpreter) ... ok
test_swf_EqualsOperator (test.test_swfinterp.TestSWFInterpreter) ... ok
test_swf_LocalVars (test.test_swfinterp.TestSWFInterpreter) ... ok
test_swf_MemberAssignment (test.test_swfinterp.TestSWFInterpreter) ... ok
test_swf_NeOperator (test.test_swfinterp.TestSWFInterpreter) ... ok
test_swf_PrivateCall (test.test_swfinterp.TestSWFInterpreter) ... ok
test_swf_PrivateVoidCall (test.test_swfinterp.TestSWFInterpreter) ... ok
test_swf_StaticAssignment (test.test_swfinterp.TestSWFInterpreter) ... ok
test_swf_StaticRetrieval (test.test_swfinterp.TestSWFInterpreter) ... ok
test_swf_StringBasics (test.test_swfinterp.TestSWFInterpreter) ... ok
test_swf_StringCharCodeAt (test.test_swfinterp.TestSWFInterpreter) ... ok
test_swf_StringConversion (test.test_swfinterp.TestSWFInterpreter) ... ok
test_all_files (test.test_unicode_literals.TestUnicodeLiterals) ... ok
test_rsa_verify (test.test_update.TestUpdate) ... ok
test_age_restricted (test.test_utils.TestUtil) ... ok
test_args_to_str (test.test_utils.TestUtil) ... ok
test_base_url (test.test_utils.TestUtil) ... ok
test_caesar (test.test_utils.TestUtil) ... ok
test_clean_html (test.test_utils.TestUtil) ... ok
test_clean_podcast_url (test.test_utils.TestUtil) ... ok
test_cli_bool_option (test.test_utils.TestUtil) ... ok
test_cli_option (test.test_utils.TestUtil) ... ok
test_cli_valueless_option (test.test_utils.TestUtil) ... ok
test_date_from_str (test.test_utils.TestUtil) ... ok
test_daterange (test.test_utils.TestUtil) ... ok
test_detect_exe_version (test.test_utils.TestUtil) ... ok
test_determine_ext (test.test_utils.TestUtil) ... ok
test_dfxp2srt (test.test_utils.TestUtil) ... ok
test_dict_get (test.test_utils.TestUtil) ... ok
test_encode_base_n (test.test_utils.TestUtil) ... ok
test_encode_compat_str (test.test_utils.TestUtil) ... ok
test_escape_rfc3986 (test.test_utils.TestUtil) ... ok
test_escape_url (test.test_utils.TestUtil) ... ok
test_expand_path (test.test_utils.TestUtil) ... ok
test_extract_attributes (test.test_utils.TestUtil) ... ok
test_find_xpath_attr (test.test_utils.TestUtil) ... ok
test_fix_xml_ampersands (test.test_utils.TestUtil) ... ok
test_float_or_none (test.test_utils.TestUtil) ... ok
test_get_element_by_attribute (test.test_utils.TestUtil) ... ok
test_get_element_by_class (test.test_utils.TestUtil) ... ok
test_get_elements_by_attribute (test.test_utils.TestUtil) ... ok
test_get_elements_by_class (test.test_utils.TestUtil) ... ok
test_int_or_none (test.test_utils.TestUtil) ... ok
test_intlist_to_bytes (test.test_utils.TestUtil) ... ok
test_is_html (test.test_utils.TestUtil) ... ok
test_js_to_json_edgecases (test.test_utils.TestUtil) ... ok
test_js_to_json_malformed (test.test_utils.TestUtil) ... ok
test_js_to_json_realworld (test.test_utils.TestUtil) ... ok
test_limit_length (test.test_utils.TestUtil) ... ok
test_lowercase_escape (test.test_utils.TestUtil) ... ok
test_match_str (test.test_utils.TestUtil) ... ok
test_merge_dicts (test.test_utils.TestUtil) ... ok
test_mimetype2ext (test.test_utils.TestUtil) ... ok
test_month_by_name (test.test_utils.TestUtil) ... ok
test_multipart_encode (test.test_utils.TestUtil) ... ok
test_ohdave_rsa_encrypt (test.test_utils.TestUtil) ... ok
test_ordered_set (test.test_utils.TestUtil) ... ok
test_paged_list (test.test_utils.TestUtil) ... ok
test_parse_age_limit (test.test_utils.TestUtil) ... ok
test_parse_bitrate (test.test_utils.TestUtil) ... ok
test_parse_codecs (test.test_utils.TestUtil) ... WARNING: Unknown codec newcodec
WARNING: Unknown codec unknownvcodec
WARNING: Unknown codec unknownacodec
WARNING: Unknown codec unknown
ok
test_parse_count (test.test_utils.TestUtil) ... ok
test_parse_dfxp_time_expr (test.test_utils.TestUtil) ... ok
test_parse_duration (test.test_utils.TestUtil) ... ok
test_parse_filesize (test.test_utils.TestUtil) ... ok
test_parse_iso8601 (test.test_utils.TestUtil) ... ok
test_parse_resolution (test.test_utils.TestUtil) ... ok
test_pkcs1pad (test.test_utils.TestUtil) ... ok
test_prepend_extension (test.test_utils.TestUtil) ... ok
test_read_batch_urls (test.test_utils.TestUtil) ... ok
test_remove_end (test.test_utils.TestUtil) ... ok
test_remove_quotes (test.test_utils.TestUtil) ... ok
test_remove_start (test.test_utils.TestUtil) ... ok
test_render_table (test.test_utils.TestUtil) ... ok
test_replace_extension (test.test_utils.TestUtil) ... ok
test_rot47 (test.test_utils.TestUtil) ... ok
test_sanitize_filename (test.test_utils.TestUtil) ... ok
test_sanitize_filename_restricted (test.test_utils.TestUtil) ... ok
test_sanitize_ids (test.test_utils.TestUtil) ... ok
test_sanitize_path (test.test_utils.TestUtil) ... ok
test_sanitize_url (test.test_utils.TestUtil) ... ok
test_shell_quote (test.test_utils.TestUtil) ... ok
test_smuggle_url (test.test_utils.TestUtil) ... ok
test_str_to_int (test.test_utils.TestUtil) ... ok
test_strip_jsonp (test.test_utils.TestUtil) ... ok
test_strip_or_none (test.test_utils.TestUtil) ... ok
test_subtitles_filename (test.test_utils.TestUtil) ... ok
test_timeconvert (test.test_utils.TestUtil) ... ok
test_unescape_html (test.test_utils.TestUtil) ... ok
test_unified_dates (test.test_utils.TestUtil) ... ok
test_unified_timestamps (test.test_utils.TestUtil) ... ok
test_update_url_query (test.test_utils.TestUtil) ... ok
test_uppercase_escape (test.test_utils.TestUtil) ... ok
test_url_basename (test.test_utils.TestUtil) ... ok
test_url_or_none (test.test_utils.TestUtil) ... ok
test_urlencode_postdata (test.test_utils.TestUtil) ... ok
test_urljoin (test.test_utils.TestUtil) ... ok
test_urshift (test.test_utils.TestUtil) ... ok
test_version_tuple (test.test_utils.TestUtil) ... ok
test_xpath_attr (test.test_utils.TestUtil) ... ok
test_xpath_element (test.test_utils.TestUtil) ... ok
test_xpath_text (test.test_utils.TestUtil) ... ok
test_xpath_with_ns (test.test_utils.TestUtil) ... ok
test_private_info_arg (test.test_verbose_output.TestVerboseOutput) ... ok
test_private_info_eq (test.test_verbose_output.TestVerboseOutput) ... ok
test_private_info_shortarg (test.test_verbose_output.TestVerboseOutput) ... ok
test_private_info_shortarg_eq (test.test_verbose_output.TestVerboseOutput) ... ok
test_youtube_extract (test.test_youtube_misc.TestYoutubeMisc) ... ok

----------------------------------------------------------------------
Ran 208 tests in 33.972s

Q: what it could be wrong with libffi? Can it be using LTO on generate that library binaries?🤔

dainnilsson commented 3 years ago

Unfortunately my libffi expertise ends just after "something's wrong with libffi". Hopefully you can get a bit more help from someone in that project. Is my understanding correct then that this confirms the problem isn't within yubikey-manager, and this issue can be closed?

kloczek commented 3 years ago

I think yes we can close this ticket. Closing.

Thank you.