merge -r 60814:60815
[mono.git] / mcs / class / corlib / Test / System.IO / DirectoryTest.cs
index 6bac5d108a3fcebad8741cc0d5805a8e255ad74c..612a86ebac6f8b0b502bed7b78586bbe39e65cc4 100644 (file)
@@ -15,6 +15,7 @@ using System.Text;
 using System;\r
 using System.Globalization;\r
 using System.Threading;\r
+using System.Diagnostics;\r
 \r
 namespace MonoTests.System.IO {\r
 \r
@@ -198,6 +199,28 @@ public class DirectoryTest : Assertion {
        {\r
                AssertEquals ("test#01", false, Directory.Exists (null as string));\r
        }\r
+\r
+       [Test]\r
+       [Category("NotDotNet")]\r
+       public void ExistsAccessDenied ()\r
+       {\r
+               // bug #78239\r
+\r
+               if (Path.DirectorySeparatorChar == '\\')\r
+                       return; // this test does not work on Windows.\r
+\r
+               string path = TempFolder + DSC + "ExistsAccessDenied";\r
+               Process p;\r
+\r
+               Directory.CreateDirectory (path);\r
+               Process.Start ("/bin/chmod", "000 " + path).WaitForExit ();\r
+               try {\r
+                       AssertEquals ("#1", false, Directory.Exists(path + DSC + "b"));\r
+               } finally {\r
+                       Process.Start ("/bin/chmod", "755 " + path).WaitForExit ();\r
+                       Directory.Delete (path);\r
+               }\r
+       }\r
        \r
        [Test]\r
        [ExpectedException(typeof(ArgumentNullException))]      \r
@@ -582,6 +605,7 @@ public class DirectoryTest : Assertion {
 \r
        [Test]\r
        [ExpectedException(typeof(ArgumentException))]\r
+       [Ignore ("On IA64, causes nunit to abort due to bug #76388")]\r
        public void MoveException4 ()\r
        {\r
                string path = TempFolder + DSC + "DirectoryTest.Test.13";\r