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 1356799 - upstream tests throw AttributeError due to build_command()
Summary: upstream tests throw AttributeError due to build_command()
Keywords:
Status: CLOSED UPSTREAM
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 04:56 UTC by Alois Mahdal
Modified: 2016-07-18 12:02 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-18 12:02:40 UTC


Attachments (Terms of Use)

Description Alois Mahdal 2016-07-15 04:56:30 UTC
Description of problem
======================

tests in test_api.py throw AttributeError due to build_command():


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

    :: [  BEGIN   ] :: Run all tests in file: ./tests/test_api.py :: actually running ' nosetests -vv ./tests/test_api.py'
    nose.config: INFO: Excluding tests matching ['test_compose|test_final_compose|generate_test_xml']
    test_check_inplace_risk_extreme (tests.test_api.TestRiskCheck) ... ERROR
    test_check_inplace_risk_high (tests.test_api.TestRiskCheck) ... ERROR
    test_check_inplace_risk_medium (tests.test_api.TestRiskCheck) ... ERROR
    test_check_inplace_risk_none (tests.test_api.TestRiskCheck) ... ERROR
    test_check_inplace_risk_slight (tests.test_api.TestRiskCheck) ... ERROR
    test_check_inplace_risk_unknown (tests.test_api.TestRiskCheck) ... ERROR

    ======================================================================
    ERROR: test_check_inplace_risk_extreme (tests.test_api.TestRiskCheck)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_api.py", line 84, in test_check_inplace_risk_extreme
        self._generate_result(temp_file)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_api.py", line 37, in _generate_result
        self.assertEqual(a.run_scan(), 0)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preup/application.py", line 231, in run_scan
        cmd = self.openscap_helper.build_command()
    AttributeError: 'NoneType' object has no attribute 'build_command'

    ======================================================================
    ERROR: test_check_inplace_risk_high (tests.test_api.TestRiskCheck)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_api.py", line 52, in test_check_inplace_risk_high
        self._generate_result(temp_file)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_api.py", line 37, in _generate_result
        self.assertEqual(a.run_scan(), 0)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preup/application.py", line 231, in run_scan
        cmd = self.openscap_helper.build_command()
    AttributeError: 'NoneType' object has no attribute 'build_command'

    ======================================================================
    ERROR: test_check_inplace_risk_medium (tests.test_api.TestRiskCheck)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_api.py", line 60, in test_check_inplace_risk_medium
        self._generate_result(temp_file)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_api.py", line 37, in _generate_result
        self.assertEqual(a.run_scan(), 0)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preup/application.py", line 231, in run_scan
        cmd = self.openscap_helper.build_command()
    AttributeError: 'NoneType' object has no attribute 'build_command'

    ======================================================================
    ERROR: test_check_inplace_risk_none (tests.test_api.TestRiskCheck)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_api.py", line 76, in test_check_inplace_risk_none
        self._generate_result(temp_file)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_api.py", line 37, in _generate_result
        self.assertEqual(a.run_scan(), 0)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preup/application.py", line 231, in run_scan
        cmd = self.openscap_helper.build_command()
    AttributeError: 'NoneType' object has no attribute 'build_command'

    ======================================================================
    ERROR: test_check_inplace_risk_slight (tests.test_api.TestRiskCheck)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_api.py", line 68, in test_check_inplace_risk_slight
        self._generate_result(temp_file)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_api.py", line 37, in _generate_result
        self.assertEqual(a.run_scan(), 0)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preup/application.py", line 231, in run_scan
        cmd = self.openscap_helper.build_command()
    AttributeError: 'NoneType' object has no attribute 'build_command'

    ======================================================================
    ERROR: test_check_inplace_risk_unknown (tests.test_api.TestRiskCheck)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_api.py", line 92, in test_check_inplace_risk_unknown
        self._generate_result(temp_file)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_api.py", line 37, in _generate_result
        self.assertEqual(a.run_scan(), 0)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preup/application.py", line 231, in run_scan
        cmd = self.openscap_helper.build_command()
    AttributeError: 'NoneType' object has no attribute 'build_command'

    ----------------------------------------------------------------------
    Ran 6 tests in 0.010s



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

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

Comment 1 Alois Mahdal 2016-07-15 05:04:06 UTC
same goes for test_oscap.py:

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

    :: [  BEGIN   ] :: Run all tests in file: ./tests/test_oscap.py :: actually running ' nosetests -vv ./tests/test_oscap.py'
    nose.config: INFO: Excluding tests matching ['test_compose|test_final_compose|generate_test_xml']
    Basic test for FAIL SCE ... ERROR
    Basic test for FIXED SCE ... ERROR
    Basic test for FAIL SCE ... ERROR
    Basic test for FAIL SCE ... ERROR
    Basic test for NOT_APPLICABLE SCE ... ERROR
    Basic test for PASS SCE ... ERROR

    ======================================================================
    ERROR: Basic test for FAIL SCE
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_oscap.py", line 187, in test_fail
        return_string = ProcessHelper.run_subprocess(a.build_command(), print_output=False, output=test_log)
    AttributeError: 'Application' object has no attribute 'build_command'

    ======================================================================
    ERROR: Basic test for FIXED SCE
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_oscap.py", line 335, in test_fixed
        return_string = ProcessHelper.run_subprocess(a.build_command(), print_output=False, output=test_log)
    AttributeError: 'Application' object has no attribute 'build_command'

    ======================================================================
    ERROR: Basic test for FAIL SCE
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_oscap.py", line 261, in test_needs_action
        return_string = ProcessHelper.run_subprocess(a.build_command(), print_output=False, output=test_log)
    AttributeError: 'Application' object has no attribute 'build_command'

    ======================================================================
    ERROR: Basic test for FAIL SCE
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_oscap.py", line 224, in test_needs_inspection
        return_string = ProcessHelper.run_subprocess(a.build_command(), print_output=False, output=test_log)
    AttributeError: 'Application' object has no attribute 'build_command'

    ======================================================================
    ERROR: Basic test for NOT_APPLICABLE SCE
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_oscap.py", line 298, in test_not_applicable
        return_string = ProcessHelper.run_subprocess(a.build_command(), print_output=False, output=test_log)
    AttributeError: 'Application' object has no attribute 'build_command'

    ======================================================================
    ERROR: Basic test for PASS SCE
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_oscap.py", line 151, in test_pass
        return_string = ProcessHelper.run_subprocess(' '.join(a.build_command()), shell=True, output=test_log)
    AttributeError: 'Application' object has no attribute 'build_command'

    ----------------------------------------------------------------------
    Ran 6 tests in 0.991s

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

Comment 2 Alois Mahdal 2016-07-15 05:05:35 UTC
...and one test in test_preup.py:


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

    :: [  BEGIN   ] :: Run all tests in file: ./tests/test_preup.py :: actually running ' nosetests -vv ./tests/test_preup.py'
    nose.config: INFO: Excluding tests matching ['test_compose|test_final_compose|generate_test_xml']
    basic test of several options ... ok
    test_hashes (tests.test_preup.TestHashes) ... ok
    test_correct_prefix (tests.test_preup.TestPremigratePrefix) ... ok
    test_wrong_prefix (tests.test_preup.TestPremigratePrefix) ... ok
    Basic test for whole program ... ERROR
    test_correct_prefix (tests.test_preup.TestPreupgradePrefix) ... ok
    test_wrong_prefix (tests.test_preup.TestPreupgradePrefix) ... ok
    Basic test for whole program ... ok
    Basic test for whole program ... ok
    Basic test for whole program ... ok
    test_solution_bold_tag (tests.test_preup.TestSolutionReplacement) ... ok
    test_solution_file_bold_tag (tests.test_preup.TestSolutionReplacement) ... ok
    test_solution_file_link_tag (tests.test_preup.TestSolutionReplacement) ... ok
    test_solution_wrong_link_tag (tests.test_preup.TestSolutionReplacement) ... ok
    test_solution_www_bold_tag (tests.test_preup.TestSolutionReplacement) ... ok
    test_solution_www_link_tag (tests.test_preup.TestSolutionReplacement) ... ok
    test_platform_tag (tests.test_preup.TestXMLUpdates) ... ok
    test_result_dirs_current_dir (tests.test_preup.TestXMLUpdates) ... ok
    test_result_dirs_tmp_preupgrade (tests.test_preup.TestXMLUpdates) ... FAIL

    ======================================================================
    ERROR: Basic test for whole program
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/tests/test_preup.py", line 114, in test_upgrade
        self.assertEqual(a.run_scan(), 0)
      File "/tmp/tmp.2cwvALWwAa/preupgrade-assistant/preup/application.py", line 231, in run_scan
        cmd = self.openscap_helper.build_command()
    AttributeError: 'NoneType' object has no attribute 'build_command'


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