Beispiel #1
0
def check_classes_dmesg(test_class, test_args):
    """ Do the actual check on the provided test class for dmesg """
    # There is so much magic in this test that pylint freaks out needlessly,
    # please ignore all of those errors
    # pylint: disable=no-init,too-few-public-methods,super-on-old-class
    # pylint: disable=no-member
    if not os.path.exists('bin'):
        raise SkipTest("This tests requires a working, built version of "
                       "piglit")

    test = _get_dmesg()

    # Create the test and then write to dmesg to ensure that it actually works
    class _localclass(test_class):
        def run(self):
            _write_dev_kmesg()
            super(_localclass, self).run()

    test = _localclass(test_args)

    json = DummyJsonWriter()

    test.execute(None, DummyLog(), json, test)

    nt.assert_in(json.result.result, ['dmesg-warn', 'dmesg-fail'],
                 msg="{0} did not update status with dmesg".format(type(test)))
Beispiel #2
0
def check_classes_dmesg(test_class, test_args):
    """ Do the actual check on the provided test class for dmesg """
    if not os.path.exists('bin'):
        raise SkipTest("This tests requires a working, built version of "
                       "piglit")

    test = _get_dmesg()

    # Create the test and then write to dmesg to ensure that it actually works
    test = test_class(test_args)
    test._test_hook_execute_run = _write_dev_kmesg

    json = DummyJsonWriter()

    test.execute(None, DummyLog(), json, test)

    nt.assert_in(json.result['result'], ['dmesg-warn', 'dmesg-fail'],
                 msg="{0} did not update status with dmesg".format(type(test)))
def check_classes_dmesg(test_class, test_args):
    """ Do the actual check on the provided test class for dmesg """
    if not os.path.exists('bin'):
        raise SkipTest("This tests requires a working, built version of "
                       "piglit")

    test = _get_dmesg()

    # Create the test and then write to dmesg to ensure that it actually works
    test = test_class(test_args)
    test._test_hook_execute_run = _write_dev_kmesg

    json = DummyJsonWriter()

    test.execute(None, DummyLog(), json, test)

    nt.assert_in(json.result['result'], ['dmesg-warn', 'dmesg-fail'],
                 msg="{0} did not update status with dmesg".format(type(test)))
def test_execute_dmesg():
    """test.base.Test.execute: dmesg statuses are applied

    This tests only one contrived test for dmesg handling. It does though test
    that the path in execute to change the status works, which makes it a
    comprehensive test.

    """
    if not os.path.exists("bin"):
        raise SkipTest("This tests requires a working, built version of " "piglit")
    utils.binary_check("true")

    # Create the test and then write to dmesg to ensure that it actually works
    class _localclass(utils.Test):
        def run(self):
            _write_dev_kmesg()
            super(_localclass, self).run()

        def interpret_result(self):
            self.result.result = "pass"

    test = _localclass(["true"])
    test.execute(None, DummyLog(), _get_dmesg())
    nt.eq_(test.result.result, "dmesg-warn")