android: pty01: Fix pty01 test for Android.
PATCH 1/1 android: pty01: Fix pty01 test for Android.
The test fails because 'grantpt()' is a no-op in bionic and doesn't set the /dev/pts/X mode to '020600' as expected by the test. The change skips that check if __ANDROID__ is defined so the rest of the test(s) can proceed and detect other failures if any.
--- testcases/kernel/pty/pty01.c | 3 +++ 1 file changed, 3 insertions(+)
testcases/kernel/pty/pty01.c +3 -0
@@ -99,9 +99,12 @@ static int test1(void)tst_brkm (TBROK ,NULL ,"uid mismatch" ); } +/* grantpt() is a no-op in bionic / Android. */ +#ifndef __ANDROID__if (st.st_mode != (S_IFCHR |S_IRUSR |S_IWUSR |S_IWGRP )) {tst_brkm (TBROK ,NULL ,"mode mismatch (mode=%o)" , st.st_mode); } +#endif slavefd =open (slavename,O_RDWR );if (slavefd >=0 ) {
Signature · 1 line
2.14.1.342.g6490525c54-goog
PATCH 1/1 android: pty01: Fix pty01 test for Android.
(should be __BIONIC__ rather than __ANDROID__ since this will be true for host bionic too.)
Quoted 28 lines · Sandeep Patil
The test fails because '
grantpt()' is a no-op in bionic and doesn't set the/dev/pts/Xmode to '020600' as expected by the test. The change skips that check if__ANDROID__is defined so the rest of the test(s) can proceed and detect other failures if any.Signed-off-by Sandeep Patil <[email protected]>--- testcases/kernel/pty/pty01.c | 3 +++ 1 file changed, 3 insertions(+)testcases/kernel/pty/pty01.c +3
-0@@ -99,9 +99,12 @@ static int test1(void)tst_brkm (TBROK ,NULL ,"uid mismatch" ); } +/* grantpt() is a no-op in bionic / Android. */ +#ifndef __ANDROID__if (st.st_mode != (S_IFCHR |S_IRUSR |S_IWUSR |S_IWGRP )) {tst_brkm (TBROK ,NULL ,"mode mismatch (mode=%o)" , st.st_mode); } +#endif slavefd =open (slavename,O_RDWR );if (slavefd >= 0) {
Quoted 4 lines
--
2.14.1.342.g6490525c54-goog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20170828/51fdbae5/attachment.html>
PATCH 1/1 android: pty01: Fix pty01 test for Android.
Quoted 2 lines · enh
(should be
__BIONIC__rather than__ANDROID__since this will be true for host bionic too.)
Thanks, fixing this now in v2.
- ssp
Quoted 35 lines · Sandeep Patil
Quoted 33 lines
The test fails because '
grantpt()' is a no-op in bionic and doesn't set the/dev/pts/Xmode to '020600' as expected by the test. The change skips that check if__ANDROID__is defined so the rest of the test(s) can proceed and detect other failures if any.Signed-off-by Sandeep Patil <[email protected]>--- testcases/kernel/pty/pty01.c | 3 +++ 1 file changed, 3 insertions(+)testcases/kernel/pty/pty01.c +3
-0@@ -99,9 +99,12 @@ static int test1(void)tst_brkm (TBROK ,NULL ,"uid mismatch" ); } +/* grantpt() is a no-op in bionic / Android. */ +#ifndef __ANDROID__if (st.st_mode != (S_IFCHR |S_IRUSR |S_IWUSR |S_IWGRP )) {tst_brkm (TBROK ,NULL ,"mode mismatch (mode=%o)" , st.st_mode); } +#endif slavefd =open (slavename,O_RDWR );if (slavefd >= 0) {--
2.14.1.342.g6490525c54-goog