On 03/25/2014 10:43 PM, Nathan Scott wrote:
One minor issue - the output has dependencies on the version of
coreutils installed (also unlikely to work cross-platform, if we
ever did secure socket builds somewhere else someday)...
[ ... ]
Would ...
if $withcerts
then
nss_setup_certificates $fqdn $host
$sudo chmod -R 0644 $collectordb/*
$sudo chown -R pcp:pcp $collectordb
else
echo "Skipping addition of certificates to certdb"
fi
and remaking 966.out do the trick here?
The problem is that test 712 depends on the existence of an empty
$collectordb with the correct permissions when 'false' is passed in for
$withcerts. On the other hand, for the new test 966, I wanted the
directory to not exist at all, so that NSS would fail to start. I got a
little tricky and passed in the name of a function that removes
$collectordb and returns with a failing exit code. I guess the
alternative would be to define several exit codes for $withcerts (e.g.
1: leave empty $collectordb, 2: leave no $collectordb).
Alternatively, this also solves the problem:
$withcerts && nss_setup_certificates $fqdn $host
if [ -d $collectordb ]
then
$sudo chmod -R 0644 $collectordb/*
$sudo chown -R pcp:pcp $collectordb
fi
Dave
|