This is an automated email from the ASF dual-hosted git repository.

bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit e29cf7bb9f26ceec418c1880c6fa73c352bc5fcb
Author: Jason Zhou <jasonzhou...@gmail.com>
AuthorDate: Fri Jul 26 22:38:33 2024 -0400

    [devices] Fix DeviceManager tests.
    
    Changes when merging previous changes caused some DeviceManager
    testcases to fail.
    
    This patch updates the tests to pass it.
    
    Review: https://reviews.apache.org/r/75117/
---
 src/tests/device_manager_tests.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/tests/device_manager_tests.cpp 
b/src/tests/device_manager_tests.cpp
index aebf9014c..3778eeff8 100644
--- a/src/tests/device_manager_tests.cpp
+++ b/src/tests/device_manager_tests.cpp
@@ -393,7 +393,7 @@ INSTANTIATE_TEST_CASE_P(
       vector<devices::Entry>{},
       vector<devices::Entry>{
         *devices::Entry::parse("c 3:* rm"),
-        *devices::Entry::parse("c 3:1 rwm")
+        *devices::Entry::parse("c 3:1 rw")
       },
       vector<devices::Entry>{*devices::Entry::parse("c 3:1 m")}
     },
@@ -424,6 +424,12 @@ TEST(DeviceManagerCgroupDeviceAccessTest, 
IsAccessGrantedTest)
   EXPECT_FALSE(
       cgroup_device_access.is_access_granted(*devices::Entry::parse("b 1:3 w"))
   );
+
+  // Character devices with minor number 3 can do write only:
+  cgroup_device_access = CHECK_NOTERROR(
+      DeviceManager::CgroupDeviceAccess::create(
+      {*devices::Entry::parse("c *:3 w")}, {}
+  ));
   EXPECT_TRUE(
       cgroup_device_access.is_access_granted(*devices::Entry::parse("c 4:3 w"))
   );

Reply via email to