[LTP] [PATCH] ANDROID: Fix ioctl03 test for Android

Steve Muckle smuckle@google.com
Mon May 6 20:06:25 CEST 2019


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?");
> 



More information about the ltp mailing list