summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-06-23 01:09:40 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-06-23 01:09:40 +0000
commit3b2490efd191bee3ae852c44ac6ded6581186edc (patch)
treeee3125462baac37bf751416936b002f84088ad96
parent85379804f5c9a3c2170a5208520cc031abd4c73a (diff)
parentfe2383338f78021ef00974295bbc3a7dd8f25eb3 (diff)
downloadnetd-3b2490efd191bee3ae852c44ac6ded6581186edc.tar.gz
Snap for 7482035 from fe2383338f78021ef00974295bbc3a7dd8f25eb3 to sc-d2-release
Change-Id: I9a13c69cb6a42d23ebdbd60224e28ef1e5ab30ca
-rw-r--r--tests/netd_test.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/netd_test.cpp b/tests/netd_test.cpp
index 872c8a41..fcd538e3 100644
--- a/tests/netd_test.cpp
+++ b/tests/netd_test.cpp
@@ -48,6 +48,22 @@ TEST(NetUtilsWrapperTest, TestFileCapabilities) {
ASSERT_EQ(ENODATA, errno);
}
+// If this test fails most likely your device is lacking device/oem specific
+// selinux genfscon rules, something like .../vendor/.../genfs_contexts:
+// genfscon sysfs /devices/platform/.../net u:object_r:sysfs_net:s0
+// Easiest debugging is via:
+// adb root && sleep 1 && adb shell 'ls -Z /sys/class/net/*/mtu'
+// and look for the mislabeled item(s).
+// Everything should be 'u:object_r:sysfs_net:s0'
+//
+// Another useful command is:
+// adb root && sleep 1 && adb shell find /sys > dump.out
+// or in particular:
+// adb root && sleep 1 && adb shell find /sys | egrep '/net$'
+// which might (among other things) print out something like:
+// /sys/devices/platform/11110000.usb/11110000.dwc3/gadget/net
+// which means you need to add:
+// genfscon sysfs /devices/platform/11110000.usb/11110000.dwc3/gadget/net u:object_r:sysfs_net:s0
TEST(NetdSELinuxTest, CheckProperMTULabels) {
// Since we expect the egrep regexp to filter everything out,
// we thus expect no matches and thus a return code of 1