Skip to contentSkip to conversation

android: pty01: Fix pty01 test for Android.

PATCH RESEND New Sandeep Patil 2 participants 2 messages Sep 5, 2017 – Sep 8, 2017

lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 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 __BIONIC__ is defined so the rest of the test(s) can proceed and detect other failures if any.

---
v1->v2
------
- Change the check from __ANDROID__ to __BIONIC__
- Added "Acked-by" from [email protected]

 testcases/kernel/pty/pty01.c | 3 +++
 1 file changed, 3 insertions(+)
testcases/kernel/pty/pty01.c +3 -0
index cbcc65c97..283612d55 100644
@@ -99,9 +99,12 @@ static int test1(void)
 		tst_brkm(TBROK, NULL, "uid mismatch");
 	}
 
+	 /* grantpt() is a no-op in bionic. */
+#ifndef __BIONIC__
 	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.581.gf28d330327-goog