예제 #1
0
    def test_afl_rsync_pull_all(self):
        server_config = {
            'remote_path': 'testdata/rsync_output_pull',
        }

        fuzzer_config = {
            'sync_dir': 'testdata/sync',
            'session': None,
            'exclude_crashes': True,
            'exclude_hangs': True,
        }

        rsync_config = {
            'get': afl_sync._rsync_default_options[:],
            'put': afl_sync._rsync_default_options[:],
        }

        afl_rsync = AflRsync(server_config, fuzzer_config, rsync_config)
        self.assertIsNone(afl_rsync.pull())
        self.assertTrue(os.path.exists('testdata/sync/other_fuzz000.sync'))
        self.assertTrue(os.path.exists('testdata/sync/other_fuzz001.sync'))
        self.assertFalse(
            os.path.exists('testdata/sync/other_fuzz000.sync/.cur_input'))
        self.assertFalse(
            os.path.exists('testdata/sync/other_fuzz001.sync/.cur_input'))
        self.assertTrue(
            os.path.exists('testdata/sync/other_invalid_fuzz000.sync'))
        self.assertFalse(os.path.exists('testdata/sync/fuzz000.sync'))
        self.assertFalse(os.path.exists('testdata/sync/fuzz001.sync'))
예제 #2
0
    def test_afl_rsync_pull_all(self):
        server_config = {
            'remote_path': 'testdata/rsync_output_pull',
        }

        fuzzer_config = {
            'sync_dir': 'testdata/sync',
            'session': None,
            'exclude_crashes': True,
            'exclude_hangs': True,
        }

        afl_rsync = AflRsync(server_config, fuzzer_config)
        self.assertIsNone(afl_rsync.pull())
        self.assertTrue(os.path.exists('testdata/sync/other_fuzz000.sync'))
        self.assertTrue(os.path.exists('testdata/sync/other_fuzz001.sync'))
        self.assertTrue(os.path.exists('testdata/sync/other_invalid_fuzz000.sync'))
        self.assertFalse(os.path.exists('testdata/sync/fuzz000.sync'))
        self.assertFalse(os.path.exists('testdata/sync/fuzz001.sync'))
예제 #3
0
    def test_afl_rsync_pull_session(self):
        server_config = {
            'remote_path': 'testdata/rsync_output_pull',
        }

        fuzzer_config = {
            'sync_dir': 'testdata/sync',
            'session': 'other_fuzz',
            'exclude_crashes': True,
            'exclude_hangs': True,
        }

        afl_rsync = AflRsync(server_config, fuzzer_config)
        self.assertIsNone(afl_rsync.pull())
        self.assertTrue(os.path.exists('testdata/sync/other_fuzz000.sync'))
        self.assertTrue(os.path.exists('testdata/sync/other_fuzz001.sync'))
        self.assertFalse(
            os.path.exists('testdata/sync/other_invalid_fuzz000.sync'))
        self.assertFalse(os.path.exists('testdata/sync/fuzz000.sync'))
        self.assertFalse(os.path.exists('testdata/sync/fuzz001.sync'))