Mark J. Nelson wrote:
I'm looking for code review and test advice for
6572 ability to trigger repository index refresh desired
6573 ability to control publication refresh-index behaviour desired
http://cr.opensolaris.org/~mjnelson/webrev.pkg-index-control/
src/man/pkgsend.1.txt:
line 93: (suggestion) With --no-index, do not update the repository's
search indices.
line 109: (suggestion) Update the repository's search indices.
Changes seem fine otherwise.
For 6572, I chose "rebuild-index" for the pkgsend subcommand. That
seemed natural to me, but if folks prefer, I can easily change it to
"refresh-index." The "refresh" term just shows up a lot already.
Well, there's somewhat of a nitpick difference between rebuild and
refresh :) rebuild implies re-creating the search indices, while
refresh (to me anyway) implies *updating* the search indices.
For consistency's sake (with the command, the token in the request path,
the existing --refresh-index option to pkg.depotd, etc.) I'd prefer it
be refresh-index and it say 'refresh' or 'update' in the manpage, etc.
What do these call for in the way of automated testing? The existing
pkgsend CLI tests are pretty much black box; do I simply need to
validate that using the new pkgsend subcommand, and the new option to
the close subcommand, returns successfully? Or do I need to also
validate that the indices are/are not rebuilt? If the latter, can
somebody point me to some examples or other information to help?
Basically, add a new test to tests/cli/t_pkgsend.py, it should use the
following process (roughly):
* get the http URI and the file URI to the depot
dhurl = self.dc.get_depot_url()
dfurl = "file://%s" % self.dc.get_repodir()
* publish a package with --no-index using something like for each protocol:
self.pkgsend(dhurl, "open [email protected]")
self.pkgsend(dhurl, "close --no-index")
self.pkgsend(dfurl, "open [email protected]")
self.pkgsend(dfurl, "close --no-index")
* tell the depot server to reload the catalog (since you published to
the repository directly using a file URI without restarting it):
self.dc.refresh()
* create an image pointing at the depot:
self.image_create(dhurl)
* attempt a search for each package name with an expected failure (no
result found):
self.pkg("search http:::", exit=1)
self.pkg("search file:::", exit=1)
* then execute the new index command:
self.pkgsend(depot_url, "rebuild-index")
* then attempt the search again, expecting success:
self.pkg("search http:::")
self.pkg("search file:::")
* finally, destroy the image
self.image_destroy()
Cheers,
--
Shawn Walker
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss