Closed Bug 823741 Opened 12 years ago Closed 6 years ago

unit tests need some way to get writable directory for domain socket binding on non-rooted Android

Categories

(Testing :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: dmosedale, Unassigned)

Details

A new fun and exciting wrinkle in the Android C++ unit-testing wars (and one that might conceivably show up in an xpcshell test at some point too).

The WebRTC signalling code uses unix domain sockets for IPC.  Turns out that /mnt/sdcard will not grant permissions to bind UNIX domain sockets because that filesystem doesn't support it.  So it needs to happen elsewhere (eg under /data).

Since we don't really know whether our tests will be running from /mnt/sdcard or /data/local/tests (or whether /data/local/tests will even exist), we need a mechanism that's independent of that.

The approach I'm taking over in bug 821812 is to use $TMPDIR, because that's how things work in Fennec-land: GeckoAppShell.java sets TMPDIR to a directory that's guaranteed to be writable by the child Gecko process.  The code currently has a fallback of /data/local/tmp, which means that the unit tests will use that, and since the automation runs the unit tests on rooted devices, that ought to just work.  It also means that anyone using a non-rooted device locally may need to execute something like: 

chmod 777 /data/local/tmp

Yuck.  After talking this over with wesj, he suggested that writing a Java appshell that does the same thing as GeckoAppShell.java to run the unit tests under should be about 10 lines of code.  So I suspect that's what we're going to want...
Adding a whole Java appshell just to support this scenario sounds crazy. That would make running the tests way more complicated.
A fair point. After spending a non-trivial amount of time Googling and talking to Android folks, I have yet to find a better alternative. From what I can see, the NDK simply doesn't supply this information; the only way to get it is from Java.  But I'm happy to be proven wrong...
Mass closing bugs with no activity in 2+ years. If this bug is important to you, please re-open.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.