Am 07.04.2013 02:16, schrieb Glen Ogilvie:
>
>
> On Sunday, April 7, 2013 6:21:32 AM UTC+12, Bernhard M. Wiedemann wrote:
>
> Am 06.04.2013 13:07, schrieb Glen Ogilvie:
> > Hi,
> >
> > I've got a few questions.
> >
> > Are the points defined in:
> > set_hash_rects
> >
> > From top left to bottom right, by pixel?, based on the whole
> screenshot?
>
> There is currently work happening in
>
https://github.com/openSUSE-Team/os-autoinst
> <
https://github.com/openSUSE-Team/os-autoinst>
> to drop hash usage altogether in favour of opencv image matching.
>
> Hash matching is good for my use case, as right now, openvc does not
> work on my system.
> Will you be merging the openSUSE-Team work into your git tree soon?
They are putting a lot of effort into it, so sooner or later I will
merge some of their changes. Maybe we could keep hashes as one way to
check results.
> results for single tests are determined in the "check" method in
>
basetest.pm <
http://basetest.pm>
> using either hashes, reference images, OCR or (in case of audio tests)
> multimon
>
>
> OK.
> Are the hashes that are checked, the ones defined in
> sub checklist()
>
> for each test? Are these hashes of the various stage areas, or of the
> entire screenshot?
They can be either. In consoletests I usually use whole-screen-hash
but e.g. in bootloader or X11, I usually use areas / hash_rects, so that
clock, cursor etc are not included... but reference images are more
powerful in the latter case, because you can do inexact matches at
variable positions.
> Also, should I only include hashes for the steps I am going to add to
> the check?
>
> I was wanting to confirm the test result by the outcome of
> waitserial(). Is this possible?
not yet, because the checking happens in a separate step after the test.
But it would be possible to add.
> The other thing I wonder, is when I am finished, should I issue a
> shutdown to the guest OS, as the last test or is the a
> better way of doing things?
yes, you should have code that does shutdown the VM in some way.
https://github.com/bmwiedemann/os-autoinst/blob/master/x11test.d/900_shutdown_kde.pm
E.g. this example exercises KDE UI code, and the path to shutdown as
non-root
https://github.com/bmwiedemann/os-autoinst/blob/master/x11test.d/900_shutdown_others.pm
just uses the power-button to trigger acpid
> Only other question, is have you devised a way to do skip the install,
> and just boot the last installed image?
yes, you can do
export KEEPHDDS=1 ; export NOINSTALL=1
the second one will skip all tests that use "installstep" as base class.
> .. I wonder if shutdown should show something other than na?
"na" just means that you dont have automatic checks. That is OK for such
steps that are just there to do something.
> Thank you for your help so far. Once I've got this passing, I would
> like to submit a pull request, if your happy to merge the Mageia stuff
> into your git tree.
Yes, sure. I am glad to see more people using automated tests to improve
Linux software quality.
> One more question about this.. With the hashes defined in checklist(), are they based on hashes of the screenshot / stage from anytime during the
> running of the test, ie, anytime during
010_consoletest_setup.pm, or are they based on hashes of what is on the screen at the
> end of the
010_consoletest_setup.pm run?
The hash will match if it occurred at any time in the whole testrun,
either in one of the hash_rects or in the whole-screen MD5-hash.
This is why it is normally not a good idea with the hash checklist to
have a consoletest just print "OK" - because other tests could be added
later that do the same.