Browse Source

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

Mukund Sivaraman 11 years ago
parent
commit
949a25220c
1 changed files with 7 additions and 0 deletions
  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) {
 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();
     configureZones();
 
 
     // install the zone file as unreadable
     // install the zone file as unreadable