qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V4 2/5] runner: Tool for fuzz tests execution


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH V4 2/5] runner: Tool for fuzz tests execution
Date: Fri, 1 Aug 2014 06:46:24 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Jul 21, 2014 at 02:18:09PM +0400, Maria Kustova wrote:
> +    def execute(self, input_commands=None, fuzz_config=None):
> +        """ Execute a test.
> +
> +        The method creates backing and test images, runs test app and 
> analyzes
> +        its exit status. If the application was killed by a signal, the test
> +        is marked as failed.
> +        """
> +        if input_commands is None:
> +            commands = self.commands
> +        else:
> +            commands = input_commands
> +        os.chdir(self.current_dir)
> +        backing_file_name, backing_file_fmt = self._create_backing_file()
> +        img_size = image_generator.create_image('test_image',
> +                                                backing_file_name,
> +                                                backing_file_fmt,
> +                                                fuzz_config)
> +        for item in commands:
> +            start = random.randint(0, img_size)
> +            end = random.randint(start, img_size)
> +            current_cmd = list(self.__dict__[item[0].replace('-', '_')])

This special case for self.qemu_img and self.qemu_io is not obvious to
me when reading the code.  It would be clearer to use the same
$qemu_img/$qemu_io substitution mechanism as for $test_img/$off/$len
below.

Attachment: pgpYHaGPCC1WN.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]