Skip to contentSkip to conversation

ANDROID: Fix ioctl03 test for Android

PATCH New Paul Lawrence 4 participants 5 messages May 6, 2019 – May 13, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ANDROID: Fix ioctl03 test for Android

Android has tun file at /dev/tun not /dev/net/tun

---
 testcases/kernel/syscalls/ioctl/ioctl03.c | 5 +++++
 1 file changed, 5 insertions(+)
testcases/kernel/syscalls/ioctl/ioctl03.c +5 -0
index b1b50edb4..cc9a2edaf 100644
@@ -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?");
Signature · 1 line
2.21.0.1020.gf2820cf01a-goog
#1 lore raw

PATCH 1/1 ANDROID: Fix ioctl03 test for Android

Quoted 24 lines · Paul Lawrence' via kernel-team

Android has tun file at /dev/tun not /dev/net/tun

---
  testcases/kernel/syscalls/ioctl/ioctl03.c | 5 +++++
  1 file changed, 5 insertions(+)
testcases/kernel/syscalls/ioctl/ioctl03.c +5 -0
index b1b50edb4..cc9a2edaf 100644
@@ -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?");
#4 lore raw

PATCH 1/1 ANDROID: Fix ioctl03 test for Android

Hi,

Quoted 9 lines
Quoted 6 lines
Quoted 1 line

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