diff mbox series

ANDROID: Fix ioctl03 test for Android

Message ID 20190506153836.232148-1-paullawrence@google.com
State Accepted
Delegated to: Petr Vorel
Headers show
Series ANDROID: Fix ioctl03 test for Android | expand

Commit Message

Paul Lawrence May 6, 2019, 3:38 p.m. UTC
Android has tun file at /dev/tun not /dev/net/tun

Signed-off-by: Paul Lawrence <paullawrence@google.com>
---
 testcases/kernel/syscalls/ioctl/ioctl03.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Steve Muckle May 6, 2019, 6:06 p.m. UTC | #1
Reviewed-by: Steve Muckle <smuckle@google.com>

On 5/6/19 8:38 AM, 'Paul Lawrence' via kernel-team wrote:
> Android has tun file at /dev/tun not /dev/net/tun
> 
> Signed-off-by: Paul Lawrence <paullawrence@google.com>
> ---
>   testcases/kernel/syscalls/ioctl/ioctl03.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/testcases/kernel/syscalls/ioctl/ioctl03.c b/testcases/kernel/syscalls/ioctl/ioctl03.c
> index b1b50edb4..cc9a2edaf 100644
> --- a/testcases/kernel/syscalls/ioctl/ioctl03.c
> +++ b/testcases/kernel/syscalls/ioctl/ioctl03.c
> @@ -79,6 +79,11 @@ static void verify_features(void)
>   	unsigned int features, i;
>   
>   	int netfd = open("/dev/net/tun", O_RDWR);
> +
> +	/* Android has tun at /dev/tun */
> +	if (netfd == -1 && (errno == ENODEV || errno == ENOENT))
> +		netfd = open("/dev/tun", O_RDWR);
> +
>   	if (netfd == -1) {
>   		if (errno == ENODEV || errno == ENOENT)
>   			tst_brk(TCONF, "TUN support is missing?");
>
Petr Vorel May 6, 2019, 8:04 p.m. UTC | #2
Hi,

> Reviewed-by: Steve Muckle <smuckle@google.com>
Acked-by: Petr Vorel <pvorel@suse.cz>
Thanks for your patch!

I guess this could be merged before release, but
leave the decision for Cyril.

Kind regards,
Petr
Cyril Hrubis May 13, 2019, 9:39 a.m. UTC | #3
Hi!
> > Reviewed-by: Steve Muckle <smuckle@google.com>
> Acked-by: Petr Vorel <pvorel@suse.cz>
> Thanks for your patch!
> 
> I guess this could be merged before release, but
> leave the decision for Cyril.

This is pretty much safe ack from me as well, so please go ahead and
apply it.
Petr Vorel May 13, 2019, 1:23 p.m. UTC | #4
Hi,

> > > Reviewed-by: Steve Muckle <smuckle@google.com>
> > Acked-by: Petr Vorel <pvorel@suse.cz>
> > Thanks for your patch!

> > I guess this could be merged before release, but
> > leave the decision for Cyril.

> This is pretty much safe ack from me as well, so please go ahead and
> apply it.
Thanks for info, pushed.

Kind regards,
Petr
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/ioctl/ioctl03.c b/testcases/kernel/syscalls/ioctl/ioctl03.c
index b1b50edb4..cc9a2edaf 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl03.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl03.c
@@ -79,6 +79,11 @@  static void verify_features(void)
 	unsigned int features, i;
 
 	int netfd = open("/dev/net/tun", O_RDWR);
+
+	/* Android has tun at /dev/tun */
+	if (netfd == -1 && (errno == ENODEV || errno == ENOENT))
+		netfd = open("/dev/tun", O_RDWR);
+
 	if (netfd == -1) {
 		if (errno == ENODEV || errno == ENOENT)
 			tst_brk(TCONF, "TUN support is missing?");