You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jp...@apache.org on 2018/05/30 15:21:55 UTC

[2/2] mesos git commit: Switched test devices for the `linux/devices` isolator tests.

Switched test devices for the `linux/devices` isolator tests.

The `cpuid` device is not always available when running tests
in a VM, so switch to `/dev/net/tun`. For the purposes of this
test, is doesn't matter what the device is as long as it is
in a subdirectory.

Review: https://reviews.apache.org/r/67363/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/580f82c5
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/580f82c5
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/580f82c5

Branch: refs/heads/master
Commit: 580f82c5b80415d419c32531eca41d05e58ed236
Parents: 419985d
Author: James Peach <jp...@apache.org>
Authored: Wed May 30 07:44:59 2018 -0700
Committer: James Peach <jp...@apache.org>
Committed: Wed May 30 07:44:59 2018 -0700

----------------------------------------------------------------------
 src/tests/containerizer/linux_devices_isolator_tests.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/580f82c5/src/tests/containerizer/linux_devices_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/linux_devices_isolator_tests.cpp b/src/tests/containerizer/linux_devices_isolator_tests.cpp
index c807576..0d53721 100644
--- a/src/tests/containerizer/linux_devices_isolator_tests.cpp
+++ b/src/tests/containerizer/linux_devices_isolator_tests.cpp
@@ -85,6 +85,7 @@ TEST_P(LinuxDevicesIsolatorTest,
   // All reasonable Linux configuration should have these devices.
   ASSERT_TRUE(os::exists("/dev/kmsg"));
   ASSERT_TRUE(os::exists("/dev/loop-control"));
+  ASSERT_TRUE(os::exists("/dev/net/tun"));
 
   slave::Flags flags = CreateSlaveFlags();
 
@@ -158,12 +159,12 @@ static const std::vector<DevicesTestParam> devicesTestValues {
     })~"},
   // Test that a device in a subdirectory is populated.
   DevicesTestParam{
-    "test -r /dev/cpu/0/cpuid",
+    "test -r /dev/net/tun",
     R"~({
       "allowed_devices": [
         {
           "device": {
-            "path": "/dev/cpu/0/cpuid"
+            "path": "/dev/net/tun"
           },
           "access": {
             "read": true