Parcourir la source

[3056] Skip DataSrcClientsBuilderTest.loadUnreadableZone test when run as the root user

Mukund Sivaraman il y a 11 ans
Parent
commit
949a25220c
1 fichiers modifiés avec 7 ajouts et 0 suppressions
  1. 7 0
      src/bin/auth/tests/datasrc_clients_builder_unittest.cc

+ 7 - 0
src/bin/auth/tests/datasrc_clients_builder_unittest.cc

@@ -528,6 +528,13 @@ TEST_F(DataSrcClientsBuilderTest, loadBrokenZone) {
 }
 
 TEST_F(DataSrcClientsBuilderTest, loadUnreadableZone) {
+    // If the test is run as the root user, it will fail as insufficient
+    // permissions will not stop the root user from using a file.
+    if (getuid() == 0) {
+        std::cerr << "Skipping test as it's run as the root user" << std::endl;
+        return;
+    }
+
     configureZones();
 
     // install the zone file as unreadable