Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1356803 - upstream tests in test_xml.py raise UnicodeDecodeError on backslash (0xc5)
Summary: upstream tests in test_xml.py raise UnicodeDecodeError on backslash (0xc5)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: preupgrade-assistant
Version: 6.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Petr Hracek
QA Contact: Alois Mahdal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-15 05:13 UTC by Alois Mahdal
Modified: 2016-12-14 13:01 UTC (History)
6 users (show)

Fixed In Version: preupgrade-assistant-2.2.0-1.el6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-14 13:01:37 UTC


Attachments (Terms of Use)

Description Alois Mahdal 2016-07-15 05:13:54 UTC
Description of problem
======================

some tests in test_xml.py raise UnicodeDecodeError on backslash (0xc5):

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: [   LOG    ] :: file: ./tests/test_xml.py
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    :: [  BEGIN   ] :: Run all tests in file: ./tests/test_xml.py :: actually running ' nosetests -vv ./tests/test_xml.py'
    nose.config: INFO: Excluding tests matching ['test_compose|test_final_compose|generate_test_xml']
    Test if list of strings is escaped well ... ok
    Test whether ampersand is not being expanded multiple times ... ok
    Basic test with quotation ... ok
    Test if single string is escaped well ... ok
    Basic test creation group.xml file ... ok
    Directory as input instead of regular file is incorrect input ... ok
    Test of missing 'check_script' file ... ok
    Test of missing 'solution' file - SystemExit should be raised ... ok
    Check occurrence of incorrect tag ... ok
    Basic test for whole program ... ok
    Test of missing tag 'solution' - SystemExit should be raised ... ok
    Check occurrence of secret file for check script ... ok
    test_check_script_applies_to (tests.test_xml.TestXML) ... ok
    test_check_script_author (tests.test_xml.TestXML) ... ok
    test_check_script_common (tests.test_xml.TestXML) ... ok
    test_check_script_requires (tests.test_xml.TestXML) ... ok
    Basic test for whole program ... ok
    test_values_id (tests.test_xml.TestXML) ... ok
    test_xml_check_export_tmp_preupgrade (tests.test_xml.TestXML) ... ok
    test_xml_check_script_reference (tests.test_xml.TestXML) ... ok
    test_xml_config_file (tests.test_xml.TestXML) ... ok
    test_xml_current_directory (tests.test_xml.TestXML) ... ok
    test_xml_fix_text (tests.test_xml.TestXML) ... ok
    test_xml_migrate_and_upgrade (tests.test_xml.TestXML) ... ok
    test_xml_migrate_not_upgrade (tests.test_xml.TestXML) ... ok
    test_xml_not_migrate_not_upgrade (tests.test_xml.TestXML) ... ok
    test_xml_profile_id (tests.test_xml.TestXML) ... ok
    test_xml_rule_id (tests.test_xml.TestXML) ... ok
    test_xml_rule_title (tests.test_xml.TestXML) ... ok
    test_xml_solution_type_html (tests.test_xml.TestXML) ... ok
    test_xml_solution_type_text (tests.test_xml.TestXML) ... ok
    test_xml_upgrade_not_migrate (tests.test_xml.TestXML) ... ok
    Test processing of non-ascii characters for author section ... ERROR
    Test processing of non-ascii characters inside title and description ... ERROR

    ======================================================================
    ERROR: Test processing of non-ascii characters for author section
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_xml.py", line 47, in setUp
        self.target_tree = ComposeXML.run_compose(self.tree, self.result_dir)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preuputils/compose.py", line 317, in run_compose
        group_xmls = cls.collect_group_xmls(dir_name, content=content, level=0, generate_from_ini=generate_from_ini)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preuputils/compose.py", line 101, in collect_group_xmls
        oscap_group.write_xml()
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preuputils/oscap_group_xml.py", line 99, in write_xml
        self.rule = xml_utils.prepare_sections()
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preuputils/xml_utils.py", line 215, in prepare_sections
        self.create_xml_from_ini(main)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preuputils/xml_utils.py", line 338, in create_xml_from_ini
        function(key, k)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preuputils/xml_utils.py", line 238, in fnc_check_script
        self.check_script_modification(key, name)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preuputils/xml_utils.py", line 201, in check_script_modification
        self.mh.update_check_script(updates, author=author)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preuputils/script_utils.py", line 123, in update_check_script
        generated_section, functions = ModuleHelper.generate_common_stuff(settings.license % author,
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 9: ordinal not in range(128)

    ======================================================================
    ERROR: Test processing of non-ascii characters inside title and description
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_xml.py", line 47, in setUp
        self.target_tree = ComposeXML.run_compose(self.tree, self.result_dir)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preuputils/compose.py", line 317, in run_compose
        group_xmls = cls.collect_group_xmls(dir_name, content=content, level=0, generate_from_ini=generate_from_ini)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preuputils/compose.py", line 101, in collect_group_xmls
        oscap_group.write_xml()
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preuputils/oscap_group_xml.py", line 99, in write_xml
        self.rule = xml_utils.prepare_sections()
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preuputils/xml_utils.py", line 215, in prepare_sections
        self.create_xml_from_ini(main)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preuputils/xml_utils.py", line 338, in create_xml_from_ini
        function(key, k)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preuputils/xml_utils.py", line 238, in fnc_check_script
        self.check_script_modification(key, name)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preuputils/xml_utils.py", line 201, in check_script_modification
        self.mh.update_check_script(updates, author=author)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preuputils/script_utils.py", line 123, in update_check_script
        generated_section, functions = ModuleHelper.generate_common_stuff(settings.license % author,
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 9: ordinal not in range(128)

    ----------------------------------------------------------------------
    Ran 34 tests in 1.739s

    FAILED (errors=2)
    :: [   FAIL   ] :: Run all tests in file: ./tests/test_xml.py (Expected 0, got 1)


Version-Release number of selected component
============================================

preupgrade-assistant-2.1.7.post18-1.el6.noarch

Comment 4 Michal Bocek 2016-12-14 13:01:37 UTC
All tests in test_xml.py pass with current preupgrade-assistant-2.2.0-1.el6.


Note You need to log in before you can comment on or make changes to this bug.