Commit:    0b2aa377c97f51eeb670f6473084d5f8d3dc6e0f
Author:    Matt Ficken <v-maf...@microsoft.com>         Fri, 11 Oct 2013 
12:03:35 -0700
Parents:   a2771085ae4e2796ec1e8eb2b2aa838cba2680e3
Branches:  master

Link:       
http://git.php.net/?p=pftt2.git;a=commitdiff;h=0b2aa377c97f51eeb670f6473084d5f8d3dc6e0f

Log:
temp dir writable smoke test


Former-commit-id: 38fd30bff2f779808809e9db35315d19d9697ce7

Changed paths:
  A  src/com/mostc/pftt/model/smoke/TempDirWritableSmokeTest.java


Diff:
diff --git a/src/com/mostc/pftt/model/smoke/TempDirWritableSmokeTest.java 
b/src/com/mostc/pftt/model/smoke/TempDirWritableSmokeTest.java
new file mode 100644
index 0000000..d4c4eca
--- /dev/null
+++ b/src/com/mostc/pftt/model/smoke/TempDirWritableSmokeTest.java
@@ -0,0 +1,37 @@
+package com.mostc.pftt.model.smoke;
+
+import com.mostc.pftt.host.AHost;
+import com.mostc.pftt.model.core.ESAPIType;
+import com.mostc.pftt.model.core.PhpBuild;
+import com.mostc.pftt.results.ConsoleManager;
+import com.mostc.pftt.results.EPrintType;
+import com.mostc.pftt.results.PhpResultPackWriter;
+
+/** Smoke test that ensures that the Temporary directory is writable.
+ * 
+ * Many features must fail if it is not. This detects/avoids those false 
failures.
+ * 
+ * @author Matt Ficken
+ *
+ */
+
+public class TempDirWritableSmokeTest extends SmokeTest {
+       public ESmokeTestStatus test(PhpBuild build, ConsoleManager cm, AHost 
host, ESAPIType type, PhpResultPackWriter tmgr) {
+               try {
+                       String tmp_name = host.mktempname(getClass(), ".txt");
+                       host.saveTextFile(tmp_name, "test_string");
+                       host.delete(tmp_name);
+                       cm.println(EPrintType.CLUE, "TempDir", "Can write to 
TEMP dir: "+host.getTempDir());
+                       return ESmokeTestStatus.PASS;
+               } catch ( Exception ex ) {
+                       cm.println(EPrintType.CLUE, "TempDir", "Could NOT write 
to TEMP dir: "+host.getTempDir());
+                       return ESmokeTestStatus.FAIL;
+               }
+       }
+
+       @Override
+       public String getName() {
+               return "Temp-Dir-Writable";
+       }
+       
+} // end public class TempDirWritableSmokeTest

Reply via email to