OSDN Git Service

Ensure dalvikvm sets "user.name" to "root" for our tests.
authorElliott Hughes <enh@google.com>
Tue, 3 Nov 2009 02:16:19 +0000 (18:16 -0800)
committerElliott Hughes <enh@google.com>
Tue, 3 Nov 2009 02:16:19 +0000 (18:16 -0800)
dalvikvm sets "user.name" to $USER, but that environment variable isn't set
when we run the tests. I was looking at our DatagramSocketTest failure, and
it turns out it's another instance of "root can do stuff other users can't".
The typical way harmony tests check whether they're running as root is to
compare "user.name" against "root", but from run-core-tests they see "".

libcore/run-core-tests

index 134a032..723d36f 100755 (executable)
@@ -26,6 +26,7 @@ mkdir $tmp
 chmod 777 $tmp
   
 exec dalvikvm \
+     -Duser.name=root \
      -Duser.language=en \
      -Duser.region=US \
      -Djava.io.tmpdir=$tmp \