On 07/ 9/12 07:39 PM, Dan Price wrote:
On Mon 09 Jul 2012 at 03:45PM, Tim Foster wrote:
but I'm not really particularly bothered either way.

Yeah, it's hard to know what the right thing is.  I mean, I guess I
could rip out the -q and just do the stdout redirection.  I was sort-of
trying to follow along with the way we'd done things elsewhere, and
when I socialized 'refresh -q' various other folks said (roughly) "yes,
that's good."

Yeah, that seems grand, as I say, I'm not too worried about this.

src/tests/api/t_printengine.py

Rather than using sys.stdout, could you use a StringIO?

That's a good call.  I had to restructure things a bit because
inside the printengine test routine we are calling fileno() on the input
file handle to see if the associated fd isatty(), and that of course
fails if you hand it a stringio.  So I fixed that interaction up.

Cool, thanks.

that, I wonder would you be able to then check for some of the test
patterns written by printengine.py?

Definitely it could be further improved... I think I'd like to put this
in for now, and then we can expand upon it.  The idea here is more to
have a "smoke test" of the functionality.  So much of the tricky parts
of what the printengine does has to be validated by a human anyway
looking at a screen anyway, so my main idea here was to make sure that
the test code for doing that doesn't rot.

Sure thing.

src/modules/client/printengine.py

Not this bug, but was hoping this would fix a minor pkglint-related
glitch
.
>  File a bug if not already done, and let's work on it.

Will do.

src/tests/api/t_elf.py, line 55

My original rewrite was to scan every elf binary in core-os and
system/kernel which was present on the current image-- since I thought
that would build up a nice test corpus and really exercise the code, but
the testsuite has logic to specifically forbid access to the system's
image, and defeating that seemed wrong, so I threw that code away and
invented this code :p

I like the idea of taking advantage of a large test corpus for free, as it were. I wonder would parsing file(1) output on a few directories of differing ELF flavour get us the best of both worlds?
eg.

interesting_paths = files_in_dir(dirlist)
for path in interesting_paths:
        output, retcode = self.cmdlinerun("/usr/bin/file %s" % path)
        if "ELF" in output and "ELF" not in path:
                # do tests on elf object

Not a big deal either way, if you want to go with what you've got, that's fine.

        cheers,
                        tim

_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to