Renaming BaseTestCase/BaseFuzzTestCase methods
This updates the BTC/BFTC class methods based on the changes we agreed on in our 7/13 meeting. Details here: https://etherpad.openstack.org/p/syntribos-planning Change-Id: I05e426ee1832385ec42d64ba930caea9ddd5374f
This commit is contained in:
parent
a42cf2895b
commit
879a76a488
|
@ -173,7 +173,7 @@ class Runner(object):
|
|||
"""
|
||||
suite = unittest.TestSuite()
|
||||
|
||||
suite.addTest(test("run_test"))
|
||||
suite.addTest(test("run_test_case"))
|
||||
if dry_run:
|
||||
for test in suite:
|
||||
print(test)
|
||||
|
|
|
@ -162,7 +162,7 @@ class BaseTestCase(unittest.TestCase):
|
|||
tags="EXCEPTION_RAISED")[0]
|
||||
raise sig.data["exception"]
|
||||
|
||||
def run_test(self):
|
||||
def run_test_case(self):
|
||||
"""This kicks off the test(s) for a given TestCase class
|
||||
|
||||
After running the tests, an `AssertionError` is raised if any tests
|
||||
|
@ -178,7 +178,7 @@ class BaseTestCase(unittest.TestCase):
|
|||
def test_case(self):
|
||||
"""This method is overwritten by individual TestCase classes
|
||||
|
||||
It represents the actual test that is called in :func:`run_test`,
|
||||
It represents the actual test that is called in :func:`run_test_case`,
|
||||
and handles populating `self.failures`
|
||||
"""
|
||||
pass
|
||||
|
|
|
@ -60,7 +60,7 @@ class BaseFuzzTestCase(base.BaseTestCase):
|
|||
def tearDownClass(cls):
|
||||
super(BaseFuzzTestCase, cls).tearDownClass()
|
||||
|
||||
def test_default_issues(self):
|
||||
def run_default_checks(self):
|
||||
"""Tests for some default issues
|
||||
|
||||
These issues are not specific to any test type, and can be raised as a
|
||||
|
@ -69,7 +69,7 @@ class BaseFuzzTestCase(base.BaseTestCase):
|
|||
by test cases that inherit from BaseFuzzTestCase.
|
||||
|
||||
Any extension to this class should call
|
||||
self.test_default_issues() in order to test for the Issues
|
||||
self.run_default_checks() in order to test for the Issues
|
||||
defined here
|
||||
"""
|
||||
|
||||
|
@ -102,7 +102,7 @@ class BaseFuzzTestCase(base.BaseTestCase):
|
|||
The test runner will call test_case on every TestCase class, and will
|
||||
report any AssertionError raised by this method to the results.
|
||||
"""
|
||||
self.test_default_issues()
|
||||
self.run_default_checks()
|
||||
|
||||
@classmethod
|
||||
def get_test_cases(cls, filename, file_content):
|
||||
|
|
|
@ -38,7 +38,7 @@ class BufferOverflowBody(base_fuzz.BaseFuzzTestCase):
|
|||
]
|
||||
|
||||
def test_case(self):
|
||||
self.test_default_issues()
|
||||
self.run_default_checks()
|
||||
self.test_signals.register(has_string(self))
|
||||
if "FAILURE_KEYS_PRESENT" in self.test_signals:
|
||||
failed_strings = self.test_signals.find(
|
||||
|
|
|
@ -29,7 +29,7 @@ class CommandInjectionBody(base_fuzz.BaseFuzzTestCase):
|
|||
'[boot loader]']
|
||||
|
||||
def test_case(self):
|
||||
self.test_default_issues()
|
||||
self.run_default_checks()
|
||||
self.test_signals.register(has_string(self))
|
||||
if "FAILURE_KEYS_PRESENT" in self.test_signals:
|
||||
failed_strings = self.test_signals.find(
|
||||
|
|
|
@ -42,7 +42,7 @@ class SQLInjectionBody(base_fuzz.BaseFuzzTestCase):
|
|||
]
|
||||
|
||||
def test_case(self):
|
||||
self.test_default_issues()
|
||||
self.run_default_checks()
|
||||
self.test_signals.register(has_string(self))
|
||||
if "FAILURE_KEYS_PRESENT" in self.test_signals:
|
||||
failed_strings = self.test_signals.find(
|
||||
|
|
|
@ -79,7 +79,7 @@ class XMLExternalEntityBody(base_fuzz.BaseFuzzTestCase):
|
|||
{"request": request})
|
||||
|
||||
def test_case(self):
|
||||
self.test_default_issues()
|
||||
self.run_default_checks()
|
||||
self.test_signals.register(has_string(self))
|
||||
if "FAILURE_KEYS_PRESENT" in self.test_signals:
|
||||
failed_strings = self.test_signals.find(
|
||||
|
|
|
@ -22,7 +22,7 @@ class XSSBody(base_fuzz.BaseFuzzTestCase):
|
|||
data_key = "xss.txt"
|
||||
|
||||
def test_case(self):
|
||||
self.test_default_issues()
|
||||
self.run_default_checks()
|
||||
self.failure_keys = self._get_strings()
|
||||
self.test_signals.register(has_string(self))
|
||||
|
||||
|
|
Loading…
Reference in New Issue