Danek Duvall wrote: > On Wed, Nov 05, 2008 at 05:29:50PM -0600, Shawn Walker wrote: >>>> http://cr.opensolaris.org/~swalker/pkg-4489-2/
Updated webrev: http://cr.opensolaris.org/~swalker/pkg-4489-3/ > testutils.py: > > - line 407: wouldn't you want this in the command.startswith("close") > clause? You could combine that test with the retcode test. Only if I change startswith("close ") to startswith("close"). There are a few tests that don't have a space after close. I don't know why the space is assumed to be there. > t_pkg_depotd.py: > > - What happens when this testcase fails? We don't get any access to the > stack trace, do we? Just that the command failed? If the test suite fails, and it finds a traceback in the depot error logs, that will be shown in the test failure output. So, you will see why the command, or in this case the uri request, really failed. Example: ====================================================================== ERROR: cli.t_pkg_depotd.py TestPkgDepot.test_bug_4489 ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/swalker/devel/pkg-tip/src/tests/pkg5unittest.py", line 84, in run testMethod() File "./cli/t_pkg_depotd.py", line 158, in test_bug_4489 misc.versioned_urlopen(depot_url, "info", [0], plist[0]) File "/export/home/swalker/devel/pkg-tip/proto/root_i386/usr/lib/python2.4/vendor-packages/pkg/misc.py", line 147, in versioned_urlopen c = url_opener(req) File "/usr/lib/python2.4/urllib2.py", line 364, in open response = meth(req, response) File "/usr/lib/python2.4/urllib2.py", line 471, in http_response response = self.parent.error( File "/usr/lib/python2.4/urllib2.py", line 402, in error return self._call_chain(*args) File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain result = func(*args) File "/usr/lib/python2.4/urllib2.py", line 480, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) HTTPError: HTTP Error 500: Internal Server Error ====================================================================== ERROR: cli.t_pkg_depotd.py TestPkgDepot.test_bug_4489 ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/swalker/devel/pkg-tip/src/tests/pkg5unittest.py", line 279, in run tdf() File "./cli/t_pkg_depotd.py", line 65, in tearDown testutils.SingleDepotTestCase.tearDown(self) File "./cli/testutils.py", line 561, in tearDown ManyDepotTestCase.tearDown(self) File "./cli/testutils.py", line 536, in tearDown self.check_traceback(dc.get_logpath()) File "./cli/testutils.py", line 518, in check_traceback raise DepotTracebackException(logpath, output) DepotTracebackException: During this test, a depot Traceback was detected. Log file: /tmp/ips.test.1979/cli.t_pkg_depotd.TestPkgDepot.test_bug_4489/depot_logfile1. Log file output is: Output Follows: ,--------------------------------------------------------------------- | [06/Nov/2008:09:41:04] INDEX Search Available | [06/Nov/2008:09:41:04] ENGINE Listening for SIGHUP. | [06/Nov/2008:09:41:04] ENGINE Listening for SIGTERM. | [06/Nov/2008:09:41:04] ENGINE Listening for SIGUSR1. | [06/Nov/2008:09:41:04] ENGINE Bus STARTING | [06/Nov/2008:09:41:04] ENGINE Started monitor thread '_TimeoutMonitor'. | [06/Nov/2008:09:41:05] ENGINE Serving on 0.0.0.0:12001 | [06/Nov/2008:09:41:05] ENGINE Bus STARTED | [06/Nov/2008:09:41:05] HTTP Traceback (most recent call last): | File "/usr/lib/python2.4/vendor-packages/cherrypy/_cprequest.py", line 606, in respond | cherrypy.response.body = self.handler() | File "/usr/lib/python2.4/vendor-packages/cherrypy/_cpdispatch.py", line 24, in __call__ | return self.callable(*self.args, **self.kwargs) | File "/export/home/swalker/devel/pkg-tip/proto/root_i386/usr/lib/python2.4/vendor-packages/pkg/server/repository.py", line 587, in info_0 | return """\ | File "/export/home/swalker/devel/pkg-tip/proto/root_i386/usr/lib/python2.4/vendor-packages/pkg/misc.py", line 380, in bytes_to_str | units = [ | NameError: global name '_' is not defined | | [06/Nov/2008:09:41:05] HTTP | Request Headers: | HOST: localhost:12001 | USER-AGENT: pkg/436253d8df15+ (sunos i86pc; 5.11 snv_100; none) | CONNECTION: close | Remote-Addr: 127.0.0.1 | ACCEPT-ENCODING: identity | `--------------------------------------------------------------------- ---------------------------------------------------------------------- Ran 1 test in 0.997s FAILED (successes=0, failures=0, errors=2, mismatches=2) ====================================================================== BASELINE MISMATCH: The following results didn't match the baseline. ---------------------------------------------------------------------- cli.t_pkg_depotd.py TestPkgDepot.test_bug_4489: error cli.t_pkg_depotd.py TestPkgDepot.test_bug_4489: error ---------------------------------------------------------------------- It is interesting that it reports the same test failing twice... Cheers, -- Shawn Walker _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
