Beispiel #1
0
    def setUp(self):
        cfg = MockFixupCfg()

        testcase = Mock()
        testcase.fuzzedfile = Mock()
        testcase.fuzzedfile.path = "foo"
        testcase.fuzzedfile.dirname = 'foodir'
        self.vg = Valgrind(cfg, testcase)
Beispiel #2
0
    def setUp(self):
        cfg = Mock()
        cfg.valgrindtimeout = 1
        cfg.get_command_list = lambda x: ['x', 'y', 'z']

        crash = Mock()
        crash.fuzzedfile = Mock()
        crash.fuzzedfile.path = "foo"
        crash.fuzzedfile.dirname = 'foodir'
        crash.killprocname = 'bar'
        self.vg = Valgrind(cfg, crash)
class Test(unittest.TestCase):
    def delete_file(self, f):
        os.remove(f)
        self.assertFalse(os.path.exists(f))

    def setUp(self):
        cfg = MockFixupCfg()

        testcase = Mock()
        testcase.fuzzedfile = Mock()
        testcase.fuzzedfile.path = "foo"
        testcase.fuzzedfile.dirname = 'foodir'
        self.vg = Valgrind(cfg, testcase)

    def tearDown(self):
        pass

    def test_get_valgrind_cmdline(self):
        result = self.vg._get_cmdline()
        self.assertTrue('valgrind' in result)
        self.assertTrue('b' in result)
        self.assertTrue('c' in result)
        self.assertTrue('d' in result)
        self.assertTrue('foo' in result)

    def test_get_valgrind(self):
        # cannot test directly, see test_get_valgrind_cmdline
        pass
Beispiel #4
0
class Test(unittest.TestCase):
    def delete_file(self, f):
        os.remove(f)
        self.assertFalse(os.path.exists(f))

    def setUp(self):
        cfg = MockFixupCfg()

        testcase = Mock()
        testcase.fuzzedfile = Mock()
        testcase.fuzzedfile.path = "foo"
        testcase.fuzzedfile.dirname = 'foodir'
        self.vg = Valgrind(cfg, testcase)

    def tearDown(self):
        pass

    def test_get_valgrind_cmdline(self):
        result = self.vg._get_cmdline()
        self.assertTrue('valgrind' in result)
        self.assertTrue('b' in result)
        self.assertTrue('c' in result)
        self.assertTrue('d' in result)
        self.assertTrue('foo' in result)

    def test_get_valgrind(self):
        # cannot test directly, see test_get_valgrind_cmdline
        pass
Beispiel #5
0
class Test(unittest.TestCase):
    def delete_file(self, f):
        os.remove(f)
        self.assertFalse(os.path.exists(f))

    def setUp(self):
        cfg = Mock()
        cfg.valgrindtimeout = 1
        cfg.get_command_list = lambda x: ['x', 'y', 'z']

        crash = Mock()
        crash.fuzzedfile = Mock()
        crash.fuzzedfile.path = "foo"
        crash.fuzzedfile.dirname = 'foodir'
        crash.killprocname = 'bar'
        self.vg = Valgrind(cfg, crash)

    def tearDown(self):
        pass

    def test_get_valgrind_cmdline(self):
        expected = ["valgrind", "--log-file=foo.valgrind", "x", "y", "z"]

        self.assertEqual(self.vg._get_cmdline(), expected)

    def test_get_valgrind(self):
        # cannot test directly, see test_get_valgrind_cmdline
        pass
Beispiel #6
0
class Test(unittest.TestCase):
    def delete_file(self, f):
        os.remove(f)
        self.assertFalse(os.path.exists(f))

    def setUp(self):
        cfg = Mock()
        cfg.valgrindtimeout = 1
        cfg.get_command_list = lambda x: ['x', 'y', 'z']

        crash = Mock()
        crash.fuzzedfile = Mock()
        crash.fuzzedfile.path = "foo"
        crash.fuzzedfile.dirname = 'foodir'
        crash.killprocname = 'bar'
        self.vg = Valgrind(cfg, crash)

    def tearDown(self):
        pass

    def test_get_valgrind_cmdline(self):
        expected = ["valgrind", "--log-file=foo.valgrind", "x", "y", "z"]

        self.assertEqual(self.vg._get_cmdline(), expected)

    def test_get_valgrind(self):
        # cannot test directly, see test_get_valgrind_cmdline
        pass
    def setUp(self):
        cfg = MockFixupCfg()

        testcase = Mock()
        testcase.fuzzedfile = Mock()
        testcase.fuzzedfile.path = "foo"
        testcase.fuzzedfile.dirname = 'foodir'
        self.vg = Valgrind(cfg, testcase)
Beispiel #8
0
    def setUp(self):
        cfg = Mock()
        cfg.valgrindtimeout = 1
        cfg.get_command_list = lambda x: ['x', 'y', 'z']

        crash = Mock()
        crash.fuzzedfile = Mock()
        crash.fuzzedfile.path = "foo"
        crash.fuzzedfile.dirname = 'foodir'
        crash.killprocname = 'bar'
        self.vg = Valgrind(cfg, crash)