gnunet-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GNUnet-developers] Impact of GNUNET_TEST_HOME


From: Christian Grothoff
Subject: Re: [GNUnet-developers] Impact of GNUNET_TEST_HOME
Date: Fri, 16 Jan 2015 09:40:44 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0

On 01/16/2015 09:24 AM, DocMalloc wrote:
> Hi, 
> 
> I have an issue running tests in statistics when a gnunet peer is
> runnning since these tests were not configured to use a dedicated test
> home directory. Therefore unix path was conflicting with the path used
> by the running peer...
> 
> ./test_statistics_api
> Jan 16 09:18:40-707153 test-statistics-api-17901 ERROR Assertion failed
> at test_statistics_api.c:40.
> Aborted
> $:~/gnunet/src/statistics$ Jan 16 09:18:40-712669 statistics-17915 ERROR
> `mkdir' failed on file
> `/tmp/gnunet-system-runtime//gnunet-service-statistics.sock' at
> service.c:640 with error: Permission denied
> 
> Question:
> 
> What is the impact of configuring GNUNET_TEST_HOME?
> 
> [PATHS]
> GNUNET_TEST_HOME= /tmp/test-gnunet-statistics/
> 
> The UNIX path for the service was not automatically modified but I had
> to additionally set:
> 
> [statistics]
> UNIXPATH = $GNUNET_TEST_HOME/gnunet-service-statistics.sock 
>
> What is best practice for tests and test specific home directories?

As you wrote above, setting GNUNET_TEST_HOME is the (preferred) method
for making sure that all test-specific, test-generated files end up in
one directory and thus can be easily cleaned up afterwards.

This works, because in util/util.conf, we have:

#
# We usually want $HOME for $GNUNET_HOME, but we allow testcases to
# easily override this by setting $GNUNET_TEST_HOME.
#
GNUNET_HOME = ${GNUNET_TEST_HOME:-${HOME:-${USERPROFILE}}}

and then entries like:

# Persistant data storage
GNUNET_DATA_HOME = ${XDG_DATA_HOME:-$GNUNET_HOME/.local/share}/gnunet/

# Configuration files
GNUNET_CONFIG_HOME = ${XDG_CONFIG_HOME:-$GNUNET_HOME/.config}/gnunet/

# Cached data, no big deal if lost
GNUNET_CACHE_HOME = ${XDG_CACHE_HOME:-$GNUNET_HOME/.cache}/gnunet/

and then all data should end up in $GNUNET_TEST_HOME unless
$XDG_-variables are set --- I'm not exactly sure what to do in that case.


Anyway, all of this has little to do with UNIXPATH, as the default for
UNIXPATHs is based on GNUNET_RUNTIME_DIR

GNUNET_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/gnunet-system-runtime/

and

# Runtime data for per-user services
GNUNET_USER_RUNTIME_DIR
 = ${TMPDIR:-${TMP:-/tmp}}/gnunet-${USERHOME:-${USER:-user}}-runtime/

Thus, services like core, transport or statistics that are "global" for
the entire peer, have a UNIXPATH like this:


[statistics]
UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-statistics.sock

which does not depend on GNUNET_TEST_HOME -- it should got to /tmp and
"just work".   Also, testcases should never have to change those
defaults.  Now, given that this is always the same directory, there can
be problems when testcases don't clean up properly after themselves
(i.e. old service processes are left alive), and in particular we have
#3256 which may also be relevant in your case.

Attachment: 0xE29FC3CC.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]