All of lore.kernel.org
 help / color / mirror / Atom feed
From: enh <enh@google.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] android: pty01: Fix pty01 test for Android.
Date: Tue, 29 Aug 2017 08:17:33 -0700	[thread overview]
Message-ID: <CAJgzZoqWAFonKprb2rWEXj47mus52Mj_kYtoFhu9EJ5sCkqUeA@mail.gmail.com> (raw)
In-Reply-To: <20170829090825.lgjzm5kqnnbhldhr@dell5510>

On Tue, Aug 29, 2017 at 2:08 AM, Petr Vorel <pvorel@suse.cz> wrote:
>> 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.
>
>> Signed-off-by: Sandeep Patil <sspatil@google.com>
>> ---
>> v1->v2
>> ------
>> - Change the check from __ANDROID__ to __BIONIC__
>
>>  testcases/kernel/pty/pty01.c | 3 +++
>>  1 file changed, 3 insertions(+)
>
>> diff --git a/testcases/kernel/pty/pty01.c b/testcases/kernel/pty/pty01.c
>> index cbcc65c97..283612d55 100644
>> --- a/testcases/kernel/pty/pty01.c
>> +++ b/testcases/kernel/pty/pty01.c
>> @@ -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) {
>
> LGTM (tested on Android API level 16).
>
> I wonder, whether it's really better to use __BIONIC__ instead of __ANDROID__ (works with
> both), but assume it is if it's really bionic specific.

yeah, grantpt unconditionally does nothing in bionic, regardless of
whether you're running on an Android device or a desktop/server Linux
box.

> Kind regards,
> Petr

  reply	other threads:[~2017-08-29 15:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-29  0:26 [LTP] [PATCH v2] android: pty01: Fix pty01 test for Android Sandeep Patil
2017-08-29  9:08 ` Petr Vorel
2017-08-29 15:17   ` enh [this message]
2017-08-30  7:06     ` Petr Vorel
2017-08-30 15:07       ` enh
  -- strict thread matches above, loose matches on Subject: below --
2017-08-29  0:21 Sandeep Patil
2017-08-29  0:24 ` Sandeep Patil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJgzZoqWAFonKprb2rWEXj47mus52Mj_kYtoFhu9EJ5sCkqUeA@mail.gmail.com \
    --to=enh@google.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.