summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/tuntap.cc
diff options
context:
space:
mode:
authorTing-Yu Wang <anivia@google.com>2020-02-28 10:37:52 -0800
committergVisor bot <gvisor-bot@google.com>2020-02-28 10:39:12 -0800
commit6b4d36e3253238dd72d0861ac1220d147e1de8dd (patch)
tree2acf667d438abb55f8b9ed86072cc3e398c9e4aa /test/syscalls/linux/tuntap.cc
parent0f8a9e362337ee684042331c5bf24a3cb43d6fc4 (diff)
Hide /dev/net/tun when using hostinet.
/dev/net/tun does not currently work with hostinet. This has caused some program starts failing because it thinks the feature exists. PiperOrigin-RevId: 297876196
Diffstat (limited to 'test/syscalls/linux/tuntap.cc')
-rw-r--r--test/syscalls/linux/tuntap.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/syscalls/linux/tuntap.cc b/test/syscalls/linux/tuntap.cc
index f6ac9d7b8..f734511d6 100644
--- a/test/syscalls/linux/tuntap.cc
+++ b/test/syscalls/linux/tuntap.cc
@@ -153,6 +153,13 @@ std::string CreateArpPacket(const uint8_t srcmac[ETH_ALEN], const char* srcip,
} // namespace
+TEST(TuntapStaticTest, NetTunExists) {
+ struct stat statbuf;
+ ASSERT_THAT(stat(kDevNetTun, &statbuf), SyscallSucceeds());
+ // Check that it's a character device with rw-rw-rw- permissions.
+ EXPECT_EQ(statbuf.st_mode, S_IFCHR | 0666);
+}
+
class TuntapTest : public ::testing::Test {
protected:
void TearDown() override {