On 10/18/18 3:11 PM, Caio Carrara wrote:
> Hi Wainer,
>
> On 18-10-2018 13:20, Wainer dos Santos Moschetta wrote:
>> [...]
>> + def test_with_2GB_file_should_exit_error_msg(self):
>> + """
>> + Pretends to boot QEMU with an initrd file with size of 2GB
>> + and expect it exits with error message.
>> + Regression test for bug fixed on commit f3839fda5771596152.
>> + """
>> + kernel_url = ('https://mirrors.kernel.org/fedora/releases/28/'
>> + 'Everything/x86_64/os/images/pxeboot/vmlinuz')
>> + kernel_hash = '238e083e114c48200f80d889f7e32eeb2793e02a'
>> + kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
>> +
>> + with tempfile.NamedTemporaryFile() as initrd:
>> + initrd.seek(2048*(1024**2) -1)
>> + initrd.write(b'\0')
>> + initrd.flush()
>> + cmd = "%s -kernel %s -initrd %s" % (self.qemu_bin, kernel_path,
>> + initrd.name)
>> + res = run(cmd, ignore_status=True)
>> + self.assertNotEqual(res.exit_status, 0)
>> + expected_msg = r'.*initrd is too large.*max: \d+, need \d+.*'
>> + self.assertRegex(res.stderr_text, expected_msg)
>>
>
> At least on my run this test is the first one to fail (with error) due
> Python version (on Py2 there's no assertRegex method). AFIK we're moving
> towards only Py3 support on the acceptance tests, right? The current
> behavior (error) is the expected?
>
We have verbalized and agreed on that indeed. Wainer, can you please
add a simple line in the acceptance tests documentation mentioning that?
- Cleber.
> Since the comment above is just for clarification and not a blocking issue:
>
> Reviewed-by: Caio Carrara <ccarr...@redhat.com>
> Tested-by: Caio Carrara <ccarr...@redhat.com>
>