Re: [PATCH 2/2] nfs-utils: add initial tests for statd that run via "make check"

Jeff Layton
2009-12-29T16:09:21Z

On Tue, 29 Dec 2009 10:38:38 -0500
Chuck Lever <chuck.lever@oracle.com> wrote:

> >>> +grep -q $COOKIE /var/lib/nfs/statd/sm/$MON_NAME
> >> This is a distro specific path... The default is /var/lib/nfs/sm
> >> It would be nice if somehow we could pull in the NFS_STATEDIR define
> >> from support/include/config.h file...
> >>
> >
> > Good point. I'll need to think on how we can deal with that. Maybe
> > what
> > I should do is add a new "statdtest" command that prints out this
> > directory? Unless someone has a better idea, I'll respin this set with
> > that change soon.
>
> We'd be better off, I think, if you did this test using calls to
> libnsm.a, rather than naked greps. You're adding yet another
> invisible and undocumented dependency on the "formal API" that is the
> state directory. I'd rather see the C API tested here, and then
> deprecate direct accesses over time.
>

Ok, maybe I need to sit down and write a "statdb" utility that can
read/manipulate the statd DB via the libnsm.a interfaces? That might be
handy for other purposes too. I'll look at that when I get back from
vacation...

--
Jeff Layton <jlayton@redhat.com>