# HG changeset patch # User dsamersoff # Date 1453468337 -10800 # Node ID 70293223d5533fa446f3ffb68edb8c187262a737 # Parent 0fdc333ccf869ec77e33a2421792fd0707349e00 8002116: This JdbReadTwiceTest.sh gets an exit 1 Summary: Explicitly check readability of file in question Reviewed-by: sla, dholmes, olagneau diff -r 0fdc333ccf86 -r 70293223d553 test/com/sun/jdi/JdbReadTwiceTest.sh --- a/test/com/sun/jdi/JdbReadTwiceTest.sh Mon Jan 18 10:49:47 2016 -0800 +++ b/test/com/sun/jdi/JdbReadTwiceTest.sh Fri Jan 22 16:12:17 2016 +0300 @@ -213,10 +213,17 @@ # If the file exists, we try to read it. The # read will fail. mkFiles $HOME/jdb.ini - chmod a-r $HOME/jdb.ini - doit - failIfNot 1 "open: $HOME/jdb.ini" - clean + id > $HOME/jdb.ini + chmod a-r $HOME/jdb.ini + if grep -q "uid=" $HOME/jdb.ini ; then + echo "Unable to make file unreadable, so test will fail. chmod: $HOME/jdb.ini" + if grep -q "uid=0" $HOME/jdb.ini ; then + echo "The test is running as root. Fix infrastructure!" + fi + fi + doit + failIfNot 1 "open: $HOME/jdb.ini" + clean fi