This patch will look for the PKCS11_TEST_USER environemnt variable and if set, 
will run the testsuite as that user instead of root.  If the env var is 
missing, the tests are run as root.

Signed-off-by: Kent Yoder <[email protected]>

 testcases/Makefile.am |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/testcases/Makefile.am b/testcases/Makefile.am
index 05663d3..0308edb 100644
--- a/testcases/Makefile.am
+++ b/testcases/Makefile.am
@@ -25,5 +25,9 @@ installcheck-local: all
        killall -HUP pkcsslotd || true
        @sbindir@/pkcs11_startup
        @sbindir@/pkcsslotd
-       pkcsl...@libdir@/opencryptoki/libopencryptoki.so PKCS11_SO_PIN=76543210 
PKCS11_USER_PIN=01234567 sh ./ock_tests.sh
+       if test ! -z ${PKCS11_TEST_USER}; then \
+               su ${PKCS11_TEST_USER} -c "PKCS11_SO_PIN=76543210 
PKCS11_USER_PIN=01234567 pkcsl...@libdir@/opencryptoki/libopencryptoki.so sh 
./ock_tests.sh"; \
+       else \
+               PKCS11_SO_PIN=76543210 PKCS11_USER_PIN=01234567 
pkcsl...@libdir@/opencryptoki/libopencryptoki.so sh ./ock_tests.sh; \
+       fi
        killall -HUP pkcsslotd

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Opencryptoki-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech

Reply via email to