This is an archive of the discontinued LLVM Phabricator instance.

[TestAttachDenied] Use a file instead of a pipe for synchronization.
ClosedPublic

Authored by sivachandra on May 13 2015, 5:35 PM.

Details

Summary

One cannot use mknod or mkfifo on user Android devices. This commit
changes the use of pipe to a file to synchronize between the inferior
and the test.

Diff Detail

Event Timeline

sivachandra retitled this revision from to [TestAttachDenied] Use a file instead of a pipe for synchronization..
sivachandra updated this object.
sivachandra edited the test plan for this revision. (Show Details)
sivachandra added reviewers: ovyalov, chaoren.
sivachandra added a subscriber: Unknown Object (MLST).
ovyalov edited edge metadata.May 13 2015, 6:00 PM

Did you try it remotely?

test/functionalities/process_attach/attach_denied/TestAttachDenied.py
53

Please add retcode to the assert message.

test/functionalities/process_attach/attach_denied/main.cpp
27–30

s/512/PATH_MAX ?

33

s/file_name/tmp_file_name

chaoren added inline comments.May 13 2015, 6:10 PM
test/functionalities/process_attach/attach_denied/TestAttachDenied.py
41

for _ in range(5)?

49

Maybe a shorter sleep at the beginning of the loop?

test/functionalities/process_attach/attach_denied/main.cpp
30

Why not fopen/fprintf?

sivachandra edited edge metadata.

Address comments.

sivachandra added inline comments.May 13 2015, 6:36 PM
test/functionalities/process_attach/attach_denied/TestAttachDenied.py
41

Done.

49

Implemented exponential backoff!

53

Done.

test/functionalities/process_attach/attach_denied/main.cpp
27–30

Done.

30

The idea of this change is to fix it for Android. Would prefer to stick to the minimum that is required for it.

33

Done.

chaoren accepted this revision.May 13 2015, 6:37 PM
chaoren edited edge metadata.
This revision is now accepted and ready to land.May 13 2015, 6:37 PM

BTW, I have tested it with a real nexus player.

sivachandra closed this revision.May 13 2015, 6:40 PM

Looks good.

emaste added a subscriber: emaste.May 14 2015, 9:31 AM
emaste added inline comments.
test/functionalities/process_attach/attach_denied/main.cpp
8

Please don't put Linux-specific headers in common tests!

The workaround is for Android, the timeout is for Linux. I don't think
they're related.