On Thu, Oct 18, 2018 at 07:52:58PM -0400, Cleber Rosa wrote: [...] > >>> + expected_msg = r'.*initrd is too large.*max: \d+, need \d+.*' > >> > >> I'd be a bit more assertive here and do something like: > >> > >> expected_msg = r'.*initrd is too large.*max: \d+, need %d\)' % > >> max_size > >> > >> And if "134053887" (which appears in "max"), is a QEMU constant, that > >> can be added there as well. > > > > I was going to suggest the opposite: just checking if the error > > message contains "initrd is too large". If we ensure the exit > > status is 1, the exact format of the error message isn't very > > important. > > > > It's certainly a matter of style here, and both are fine to me, but I'd > rather have someone touching that part of the code to also have to touch > the test if the message changes. > > Note that I can't predict if this will eventually catch a regression > that the simpler message you suggest wouldn't, but, I, personally, > prefer to be safe than sorry.
I see your point, and I would probably prefer your approach if we already had QEMU developers used to writing and running acceptance tests once in a while. Anyway, both approaches would be good enough to me. -- Eduardo