[ovs-dev] [PATCH] tests: Fix "make check" as non-root.

Ben Pfaff blp at nicira.com
Mon Mar 12 17:07:59 UTC 2012


The autoconf manual says:

`PWD'
     Posix 1003.1-2001 requires that `cd' and `pwd' must update the
     `PWD' environment variable to point to the logical name of the
     current directory, but traditional shells do not support this.
     This can cause confusion if one shell instance maintains `PWD' but
     a subsidiary and different shell does not know about `PWD' and
     executes `cd'; in this case `PWD' points to the wrong directory.
     Use ``pwd`' rather than `$PWD'.

so I'll write up a patch to get rid of $PWD.

On Mon, Mar 12, 2012 at 10:06:21AM -0700, Justin Pettit wrote:
> Thanks for fixing this; I was running into it this weekend.
> 
> It seems like the tests in that directory use both "`pwd`" and
> "$PWD"--with a slight greater tendency towards using "$PWD".  Is
> there a reason to prefer "`pwd`" over "$PWD"?  If it works the same,
> "$PWD" seems like it would be more efficient.
> 
> --Justin
> 
> 
> On Mar 12, 2012, at 9:49 AM, Ben Pfaff wrote:
> 
> > Without this change, these tests try to write to /var/run, which fails
> > unless "make check" is run as root.
> > 
> > Signed-off-by: Ben Pfaff <blp at nicira.com>
> > ---
> > tests/ovs-monitor-ipsec.at |    1 +
> > tests/ovs-xapi-sync.at     |    1 +
> > 2 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/tests/ovs-monitor-ipsec.at b/tests/ovs-monitor-ipsec.at
> > index ab14462..c8de1de 100644
> > --- a/tests/ovs-monitor-ipsec.at
> > +++ b/tests/ovs-monitor-ipsec.at
> > @@ -3,6 +3,7 @@ AT_BANNER([ovs-monitor-ipsec])
> > AT_SETUP([ovs-monitor-ipsec])
> > AT_SKIP_IF([test $HAVE_PYTHON = no])
> > 
> > +OVS_RUNDIR=`pwd`; export OVS_RUNDIR
> > OVS_PKGDATADIR=`pwd`; export OVS_PKGDATADIR
> > cp "$top_srcdir/vswitchd/vswitch.ovsschema" .
> > 
> > diff --git a/tests/ovs-xapi-sync.at b/tests/ovs-xapi-sync.at
> > index 1f0f766..d1c091a 100644
> > --- a/tests/ovs-xapi-sync.at
> > +++ b/tests/ovs-xapi-sync.at
> > @@ -8,6 +8,7 @@ cp "$top_srcdir/tests/MockXenAPI.py" XenAPI.py
> > PYTHONPATH=`pwd`:$PYTHONPATH
> > export PYTHONPATH
> > 
> > +OVS_RUNDIR=`pwd`; export OVS_RUNDIR
> > OVS_PKGDATADIR=`pwd`; export OVS_PKGDATADIR
> > cp "$top_srcdir/vswitchd/vswitch.ovsschema" .
> > 
> > -- 
> > 1.7.2.5
> > 
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > http://openvswitch.org/mailman/listinfo/dev
> 



More information about the dev mailing list