knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pzamp...@apache.org
Subject knox git commit: KNOX-1093 - Fix missed functional tests
Date Fri, 28 Sep 2018 16:09:40 GMT
Repository: knox
Updated Branches:
  refs/heads/master a5376e6c8 -> 9229dd36c


KNOX-1093 - Fix missed functional tests


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/9229dd36
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/9229dd36
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/9229dd36

Branch: refs/heads/master
Commit: 9229dd36c624917cf2149eead13f49079958895d
Parents: a5376e6
Author: Phil Zampino <pzampino@apache.org>
Authored: Fri Sep 28 11:46:39 2018 -0400
Committer: Phil Zampino <pzampino@apache.org>
Committed: Fri Sep 28 11:48:20 2018 -0400

----------------------------------------------------------------------
 .../apache/knox/gateway/WebHdfsHaFuncTest.java  | 72 +++-----------------
 1 file changed, 11 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/9229dd36/gateway-test/src/test/java/org/apache/knox/gateway/WebHdfsHaFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/knox/gateway/WebHdfsHaFuncTest.java b/gateway-test/src/test/java/org/apache/knox/gateway/WebHdfsHaFuncTest.java
index eecd3e7..d024190 100644
--- a/gateway-test/src/test/java/org/apache/knox/gateway/WebHdfsHaFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/knox/gateway/WebHdfsHaFuncTest.java
@@ -361,15 +361,14 @@ public class WebHdfsHaFuncTest {
             .queryParam("destination", "/user/hdfs/foo.txt")
             .then()
             .log().ifError()
-            .statusCode(HttpStatus.SC_OK)
-            .body("boolean", is(true))
+            .statusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR)
             .when().post(driver.getUrl("WEBHDFS") + "/v1/user/hdfs/foo.txt");
       masterServer.isEmpty();
       LOG_EXIT();
    }
 
    @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
-   public void testServerInSafeModeRetriableException() throws IOException {
+   public void testServerInSafeModeFailover() throws IOException {
       LOG_ENTER();
       String username = "hdfs";
       String password = "hdfs-password";
@@ -383,6 +382,15 @@ public class WebHdfsHaFuncTest {
             .status(HttpStatus.SC_FORBIDDEN)
             .content(driver.getResourceBytes("webhdfs-mkdirs-safemode.json"))
             .contentType("application/json");
+      standbyServer.expect()
+            .method("POST")
+            .pathInfo("/webhdfs/v1/user/hdfs/new")
+            .queryParam("op", "MKDIRS")
+            .queryParam("user.name", username)
+            .respond()
+            .status(HttpStatus.SC_FORBIDDEN)
+            .content(driver.getResourceBytes("webhdfs-liststatus-standby.json"))
+            .contentType("application/json");
       masterServer.expect()
             .method("POST")
             .pathInfo("/webhdfs/v1/user/hdfs/new")
@@ -405,62 +413,4 @@ public class WebHdfsHaFuncTest {
       LOG_EXIT();
    }
 
-   @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
-   public void testServerInSafeModeRetryLimit() throws IOException {
-      LOG_ENTER();
-      String username = "hdfs";
-      String password = "hdfs-password";
-      //master is in safe mode
-      masterServer.expect()
-            .method("POST")
-            .pathInfo("/webhdfs/v1/user/hdfs/foo.txt")
-            .queryParam("op", "RENAME")
-            .queryParam("destination", "/user/hdfs/foo.txt")
-            .queryParam("user.name", username)
-            .respond()
-            .status(HttpStatus.SC_FORBIDDEN)
-            .content(driver.getResourceBytes("webhdfs-rename-safemode.json"))
-            .contentType("application/json");
-      masterServer.expect()
-            .method("POST")
-            .pathInfo("/webhdfs/v1/user/hdfs/foo.txt")
-            .queryParam("op", "RENAME")
-            .queryParam("destination", "/user/hdfs/foo.txt")
-            .queryParam("user.name", username)
-            .respond()
-            .status(HttpStatus.SC_FORBIDDEN)
-            .content(driver.getResourceBytes("webhdfs-rename-safemode.json"))
-            .contentType("application/json");
-      masterServer.expect()
-            .method("POST")
-            .pathInfo("/webhdfs/v1/user/hdfs/foo.txt")
-            .queryParam("op", "RENAME")
-            .queryParam("destination", "/user/hdfs/foo.txt")
-            .queryParam("user.name", username)
-            .respond()
-            .status(HttpStatus.SC_FORBIDDEN)
-            .content(driver.getResourceBytes("webhdfs-rename-safemode.json"))
-            .contentType("application/json");
-      masterServer.expect()
-            .method("POST")
-            .pathInfo("/webhdfs/v1/user/hdfs/foo.txt")
-            .queryParam("op", "RENAME")
-            .queryParam("destination", "/user/hdfs/foo.txt")
-            .queryParam("user.name", username)
-            .respond()
-            .status(HttpStatus.SC_FORBIDDEN)
-            .content(driver.getResourceBytes("webhdfs-rename-safemode.json"))
-            .contentType("application/json");
-      given()
-            .auth().preemptive().basic(username, password)
-            .header("X-XSRF-Header", "jksdhfkhdsf")
-            .queryParam("op", "RENAME")
-            .queryParam("destination", "/user/hdfs/foo.txt")
-            .then()
-//            .log().ifError()
-            .statusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR)
-            .when().post(driver.getUrl("WEBHDFS") + "/v1/user/hdfs/foo.txt");
-      masterServer.isEmpty();
-      LOG_EXIT();
-   }
 }


Mime
View raw message