Beispiel #1
0
    def test_run_wait7(self, mock_logging, mock_logging_err, mock_jobsubmit):
        """Ensure BeakerRunner.run works."""
        # pylint: disable=W0613

        # abort later on, change last recipe to Aborted
        misc.exec_on(self.myrunner, mock_jobsubmit, 'beaker_aborted_some.xml',
                     2, 'Aborted')
Beispiel #2
0
    def test_run_wait6(self, mock_logging, mock_logging_err, mock_jobsubmit):
        """Ensure BeakerRunner.run works."""
        # pylint: disable=W0613

        # abort right-away ( 0 allowed)
        misc.exec_on(self.myrunner, mock_jobsubmit, 'beaker_aborted_some.xml',
                     0)
Beispiel #3
0
    def test_run_wait8(self, mock_logging, mock_logging_err, mock_jobsubmit):
        """Ensure BeakerRunner.run works."""
        # pylint: disable=W0613

        result = misc.exec_on(self.myrunner, mock_jobsubmit,
                              'beaker_aborted_some.xml', 5, 'Cancelled')
        self.assertEqual(SKT_ERROR, result)
Beispiel #4
0
    def test_run_wait5(self, mock_logging, mock_logging_err, mock_jobsubmit):
        """Ensure BeakerRunner.run works."""
        # pylint: disable=W0613

        result = misc.exec_on(self.myrunner, mock_jobsubmit,
                              'beaker_results3.xml', 2, 'Completed')
        self.assertEqual(SKT_SUCCESS, result)
Beispiel #5
0
    def test_fail_and_skip(self, mock_jobsubmit, mock_getresultstree,
                           mock_warning, mock_error):
        """ Ensure that a job with failed tasks, no waiving and skipped tests
            returns SKT_FAIL."""
        # pylint: disable=unused-argument

        beaker_xml = misc.get_asset_content('beaker_skip_and_fail.xml')
        mock_getresultstree.return_value = fromstring(beaker_xml)
        mock_jobsubmit.return_value = "J:0001"

        # no need to wait 60 seconds
        # though beaker_pass_results.xml only needs one iteration
        self.myrunner.watchdelay = 0.1

        # For the purposes of this test it's not necessary to flip the state
        # of the fake Beaker XML job to 'Completed', the asset file already has
        # that state.
        result = misc.exec_on(self.myrunner,
                              mock_jobsubmit,
                              'beaker_skip_and_fail.xml',
                              5,
                              waiving=False)

        # see method description for details why SKT_FAIL
        self.assertEqual(SKT_FAIL, result)
Beispiel #6
0
    def test_run_wait3(self, mock_logging, mock_logging_err, mock_jobsubmit):
        """Ensure BeakerRunner.run works."""
        # pylint: disable=W0613

        # beaker_results2.xml doesn't have passed tasks, so result is SKT_FAIL
        result = misc.exec_on(self.myrunner, mock_jobsubmit,
                              'beaker_results2.xml', 1, 'Completed')
        self.assertEqual(SKT_FAIL, result)
Beispiel #7
0
    def test_run_wait2(self, mock_logging, mock_logging_err, mock_jobsubmit):
        """Ensure BeakerRunner.run works."""
        # pylint: disable=W0613

        # beaker_results.xml has test failures, returncode should be SKT_FAIL
        result = misc.exec_on(self.myrunner, mock_jobsubmit,
                              'beaker_results.xml', 1, 'Completed')
        self.assertEqual(SKT_FAIL, result)
Beispiel #8
0
    def test_waived_hidden(self, mock_jobsubmit, mock_getresultstree):
        """ Ensure that waived tests don't affect overall test result."""

        beaker_xml = misc.get_asset_content('beaker_results.xml')
        mock_getresultstree.return_value = fromstring(beaker_xml)
        mock_jobsubmit.return_value = "J:0001"

        # no need to wait 60 seconds
        # though beaker_pass_results.xml only needs one iteration
        self.myrunner.watchdelay = 0.1

        result = misc.exec_on(self.myrunner, mock_jobsubmit,
                              'beaker_results.xml', 5, 'Completed')
        self.assertEqual(SKT_SUCCESS, result)
Beispiel #9
0
    def test_waived_abort(self, mock_jobsubmit, mock_getresultstree,
                          mock_warning, mock_error):
        """ Ensure that one test failing and one waived test aborting
            leads to failure. """
        # pylint: disable=unused-argument

        beaker_xml = misc.get_asset_content('beaker_aborted_some.xml')
        mock_getresultstree.return_value = fromstring(beaker_xml)
        mock_jobsubmit.return_value = "J:0001"

        # no need to wait 60 seconds
        # though beaker_pass_results.xml only needs one iteration
        self.myrunner.watchdelay = 0.1

        result = misc.exec_on(self.myrunner, mock_jobsubmit,
                              'beaker_aborted_some.xml', 5, 'Aborted')

        self.assertEqual(result, SKT_ERROR)
Beispiel #10
0
    def test_waived_fails(self, mock_jobsubmit, mock_getresultstree):
        """ Ensure that waived tests don't affect overall
            test result. This tests test failure."""

        beaker_xml = misc.get_asset_content('beaker_results.xml')
        mock_getresultstree.return_value = fromstring(beaker_xml)
        mock_jobsubmit.return_value = "J:0001"

        # no need to wait 60 seconds
        # though beaker_pass_results.xml only needs one iteration
        self.myrunner.watchdelay = 0.1

        # waiving=False : failure must show
        result = misc.exec_on(self.myrunner,
                              mock_jobsubmit,
                              'beaker_results.xml',
                              5,
                              'Completed',
                              waiving=False)

        self.assertEqual(result, SKT_FAIL)
Beispiel #11
0
    def test_waived_fails2(self, mock_jobsubmit, mock_getresultstree,
                           mock_warning, mock_error):
        """ Ensure that waived tests don't affect overall
            test result. This tests test abort."""
        # pylint: disable=unused-argument

        beaker_xml = misc.get_asset_content('beaker_aborted_some.xml')
        mock_getresultstree.return_value = fromstring(beaker_xml)
        mock_jobsubmit.return_value = "J:0001"

        # no need to wait 60 seconds
        # though beaker_pass_results.xml only needs one iteration
        self.myrunner.watchdelay = 0.1

        # waiving=False: infrastructure error must be reported
        result = misc.exec_on(self.myrunner,
                              mock_jobsubmit,
                              'beaker_aborted_some.xml',
                              5,
                              'Completed',
                              waiving=False)

        self.assertEqual(result, SKT_ERROR)
Beispiel #12
0
    def test_run_wait4(self, mock_logging, mock_logging_err, mock_jobsubmit):
        """Ensure BeakerRunner.run works."""
        # pylint: disable=W0613

        misc.exec_on(self.myrunner, mock_jobsubmit, 'beaker_results3.xml', 1,
                     'Completed')