diff --git a/docs/source/guides/user/chapters/operations.rst b/docs/source/guides/user/chapters/operations.rst index 0383784a03..eb3ad9fb1e 100644 --- a/docs/source/guides/user/chapters/operations.rst +++ b/docs/source/guides/user/chapters/operations.rst @@ -305,7 +305,6 @@ output might look like this:: INSTRUMENTED /usr/share/doc/avocado/tests/abort.py INSTRUMENTED /usr/share/doc/avocado/tests/datadir.py INSTRUMENTED /usr/share/doc/avocado/tests/doublefail.py - INSTRUMENTED /usr/share/doc/avocado/tests/doublefree.py INSTRUMENTED /usr/share/doc/avocado/tests/errortest.py INSTRUMENTED /usr/share/doc/avocado/tests/failtest.py INSTRUMENTED /usr/share/doc/avocado/tests/fiotest.py diff --git a/examples/tests/doublefree.py b/examples/tests/doublefree.py deleted file mode 100644 index 6ea225991d..0000000000 --- a/examples/tests/doublefree.py +++ /dev/null @@ -1,49 +0,0 @@ -import os -import shutil -import sys - -from avocado import Test -from avocado.utils import build, process - - -class DoubleFreeTest(Test): - - """ - Double free test case. - - :avocado: tags=requires_c_compiler - - :param source: name of the source file located in a data directory - """ - - def setUp(self): - """ - Build 'doublefree'. - """ - source = self.params.get('source', default='doublefree.c') - c_file = self.get_data(source) - if c_file is None: - self.cancel('Test is missing data file %s' % source) - c_file_name = os.path.basename(c_file) - dest_c_file = os.path.join(self.workdir, c_file_name) - shutil.copy(c_file, dest_c_file) - build.make(self.workdir, - env={'CFLAGS': '-g -O0'}, - extra_args='doublefree') - - def test(self): - """ - Execute 'doublefree'. - """ - cmd = os.path.join(self.workdir, 'doublefree') - cmd_result = process.run(cmd, ignore_status=True, - env={'MALLOC_CHECK_': '1'}) - self.log.info(cmd_result) - output = cmd_result.stdout + cmd_result.stderr - if sys.platform.startswith('darwin'): - pattern = b'pointer being freed was not allocated' - else: - pattern = b'free(): invalid pointer' - self.assertTrue(pattern in output, - msg='Could not find pattern %s in output %s' % - (pattern, output)) diff --git a/examples/tests/doublefree.py.data/doublefree.c b/examples/tests/doublefree.py.data/doublefree.c deleted file mode 100644 index 9de07ef3e9..0000000000 --- a/examples/tests/doublefree.py.data/doublefree.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -int main(int argc, char *argv[]) -{ - void *p = malloc(1024); - free(p); - free(p); - return 0; -} diff --git a/examples/tests/doublefree_nasty.py b/examples/tests/doublefree_nasty.py deleted file mode 100644 index 27a4ba3501..0000000000 --- a/examples/tests/doublefree_nasty.py +++ /dev/null @@ -1,40 +0,0 @@ -import os -import shutil - -from avocado import Test -from avocado.utils import build, process - - -class DoubleFreeTest(Test): - - """ - 10% chance to execute double free exception. - - :avocado: tags=failure_expected,requires_c_compiler - - :param source: name of the source file located in a data directory - """ - - __binary = None # filename of the compiled program - - def setUp(self): - """ - Build 'doublefree'. - """ - source = self.params.get('source', default='doublefree.c') - c_file = self.get_data(source) - if c_file is None: - self.cancel('Test is missing data file %s' % source) - shutil.copy(c_file, self.workdir) - self.__binary = source.rsplit('.', 1)[0] - build.make(self.workdir, - env={'CFLAGS': '-g -O0'}, - extra_args=self.__binary) - - def test(self): - """ - Execute 'doublefree'. - """ - cmd = os.path.join(self.workdir, self.__binary) - cmd_result = process.run(cmd) - self.log.info(cmd_result) diff --git a/examples/tests/doublefree_nasty.py.data/doublefree.c b/examples/tests/doublefree_nasty.py.data/doublefree.c deleted file mode 100644 index ae807e24e1..0000000000 --- a/examples/tests/doublefree_nasty.py.data/doublefree.c +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include -#include - -void handle_exception() { - void *p = malloc(1024); - free(p); - free(p); -} - -int main(int argc, char *argv[]) -{ - int num; - srand(time(NULL)); - num = rand(); - if (num < (RAND_MAX / 10)) { - handle_exception(); - } - return 0; -} diff --git a/examples/tests/doublefree_nasty.py.data/gdb_pre b/examples/tests/doublefree_nasty.py.data/gdb_pre deleted file mode 100644 index 51b75fb6cd..0000000000 --- a/examples/tests/doublefree_nasty.py.data/gdb_pre +++ /dev/null @@ -1 +0,0 @@ -break handle_exception diff --git a/examples/tests/doublefree_nasty.py.data/iterations.yaml b/examples/tests/doublefree_nasty.py.data/iterations.yaml deleted file mode 100644 index d83d968a8d..0000000000 --- a/examples/tests/doublefree_nasty.py.data/iterations.yaml +++ /dev/null @@ -1,101 +0,0 @@ -iterations: !mux - 1: - 2: - 3: - 4: - 5: - 6: - 7: - 8: - 9: - 10: - 11: - 12: - 13: - 14: - 15: - 16: - 17: - 18: - 19: - 20: - 21: - 22: - 23: - 24: - 25: - 26: - 27: - 28: - 29: - 30: - 31: - 32: - 33: - 34: - 35: - 36: - 37: - 38: - 39: - 40: - 41: - 42: - 43: - 44: - 45: - 46: - 47: - 48: - 49: - 50: - 51: - 52: - 53: - 54: - 55: - 56: - 57: - 58: - 59: - 60: - 61: - 62: - 63: - 64: - 65: - 66: - 67: - 68: - 69: - 70: - 71: - 72: - 73: - 74: - 75: - 76: - 77: - 78: - 79: - 80: - 81: - 82: - 83: - 84: - 85: - 86: - 87: - 88: - 89: - 90: - 91: - 92: - 93: - 94: - 95: - 96: - 97: - 98: - 99: - 100: diff --git a/man/avocado.rst b/man/avocado.rst index 39610a939a..577d9a842e 100644 --- a/man/avocado.rst +++ b/man/avocado.rst @@ -583,7 +583,6 @@ The output looks like:: INSTRUMENTED /usr/share/doc/avocado/tests/abort.py INSTRUMENTED /usr/share/doc/avocado/tests/datadir.py INSTRUMENTED /usr/share/doc/avocado/tests/doublefail.py - INSTRUMENTED /usr/share/doc/avocado/tests/doublefree.py INSTRUMENTED /usr/share/doc/avocado/tests/errortest.py INSTRUMENTED /usr/share/doc/avocado/tests/failtest.py INSTRUMENTED /usr/share/doc/avocado/tests/fiotest.py diff --git a/selftests/functional/test_output.py b/selftests/functional/test_output.py index 8d97d19205..082317d1d7 100644 --- a/selftests/functional/test_output.py +++ b/selftests/functional/test_output.py @@ -216,22 +216,6 @@ def missing_binary(binary): class OutputTest(TestCaseTmpDir): - @unittest.skipIf(missing_binary('cc'), - "C compiler is required by the underlying doublefree.py test") - def test_output_doublefree(self): - cmd_line = ('%s run --job-results-dir %s --disable-sysinfo ' - 'examples/tests/doublefree.py' % (AVOCADO, self.tmpdir.name)) - result = process.run(cmd_line, ignore_status=True) - expected_rc = exit_codes.AVOCADO_ALL_OK - output = result.stdout + result.stderr - self.assertEqual(result.exit_status, expected_rc, - "Avocado did not return rc %d:\n%s" % - (expected_rc, result)) - bad_string = b'double free or corruption' - self.assertNotIn(bad_string, output, - "Libc double free can be seen in avocado " - "doublefree output:\n%s" % output) - def test_log_to_debug(self): test = script.Script(os.path.join(self.tmpdir.name, "output_test.py"), OUTPUT_TEST_CONTENT) diff --git a/spell.ignore b/spell.ignore index 1f20c3c6f7..272cd563f5 100644 --- a/spell.ignore +++ b/spell.ignore @@ -571,7 +571,6 @@ logdirs workdir datasize getoutput -doublefree synctest getstatusoutput rtd