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: M.Kustova
Subject: Re: [Qemu-devel] [PATCH V4 2/5] runner: Tool for fuzz tests execution
Date: Mon, 4 Aug 2014 13:28:29 +0400

On Fri, Aug 1, 2014 at 9:46 AM, Stefan Hajnoczi <address@hidden> wrote:
> 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.
Separate processing of test programs is due to the impossibility to
laconically replace a string with an unpacked list of strings.
But I agree that using of __dict__ is not safe and have to be redesigned.

BR, M.



reply via email to

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