This is an automated email from the ASF dual-hosted git repository.

elek pushed a commit to branch ozone-0.4.1
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/ozone-0.4.1 by this push:
     new 711fd71  HDDS-1793. Acceptance test of ozone-topology cluster is 
failing
711fd71 is described below

commit 711fd71c31023d4199e7802295ef7c5fe4efe305
Author: Doroszlai, Attila <adorosz...@apache.org>
AuthorDate: Tue Jul 16 16:52:14 2019 +0200

    HDDS-1793. Acceptance test of ozone-topology cluster is failing
    
    Closes #1096
---
 .../src/main/compose/ozone-net-topology/test.sh    |  2 +-
 hadoop-ozone/dist/src/main/compose/testlib.sh      | 28 +++++++++++++---------
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/hadoop-ozone/dist/src/main/compose/ozone-net-topology/test.sh 
b/hadoop-ozone/dist/src/main/compose/ozone-net-topology/test.sh
index f36fb48..2843de2 100755
--- a/hadoop-ozone/dist/src/main/compose/ozone-net-topology/test.sh
+++ b/hadoop-ozone/dist/src/main/compose/ozone-net-topology/test.sh
@@ -21,7 +21,7 @@ export COMPOSE_DIR
 # shellcheck source=/dev/null
 source "$COMPOSE_DIR/../testlib.sh"
 
-start_docker_env
+start_docker_env 4
 
 #Due to the limitation of the current auditparser test, it should be the
 #first test in a clean cluster.
diff --git a/hadoop-ozone/dist/src/main/compose/testlib.sh 
b/hadoop-ozone/dist/src/main/compose/testlib.sh
index 410e059..065c53f 100755
--- a/hadoop-ozone/dist/src/main/compose/testlib.sh
+++ b/hadoop-ozone/dist/src/main/compose/testlib.sh
@@ -28,9 +28,12 @@ mkdir -p "$RESULT_DIR"
 #Should be writeable from the docker containers where user is different.
 chmod ogu+w "$RESULT_DIR"
 
-## @description wait until 3 datanodes are up (or 30 seconds)
+## @description wait until datanodes are up (or 30 seconds)
 ## @param the docker-compose file
+## @param number of datanodes to wait for (default: 3)
 wait_for_datanodes(){
+  local compose_file=$1
+  local -i datanode_count=${2:-3}
 
   #Reset the timer
   SECONDS=0
@@ -40,19 +43,19 @@ wait_for_datanodes(){
 
      #This line checks the number of HEALTHY datanodes registered in scm over 
the
      # jmx HTTP servlet
-     datanodes=$(docker-compose -f "$1" exec -T scm curl -s 
'http://localhost:9876/jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo'
 | jq -r '.beans[0].NodeCount[] | select(.key=="HEALTHY") | .value')
-      if [[ "$datanodes" == "3" ]]; then
+     datanodes=$(docker-compose -f "${compose_file}" exec -T scm curl -s 
'http://localhost:9876/jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo'
 | jq -r '.beans[0].NodeCount[] | select(.key=="HEALTHY") | .value')
+     if [[ "$datanodes" ]]; then
+       if [[ ${datanodes} -ge ${datanode_count} ]]; then
 
-        #It's up and running. Let's return from the function.
+         #It's up and running. Let's return from the function.
          echo "$datanodes datanodes are up and registered to the scm"
          return
-      else
+       else
 
-         #Print it only if a number. Could be not a number if scm is not yet 
started
-         if [[ "$datanodes" ]]; then
-            echo "$datanodes datanode is up and healthy (until now)"
+           #Print it only if a number. Could be not a number if scm is not yet 
started
+           echo "$datanodes datanode is up and healthy (until now)"
          fi
-      fi
+     fi
 
       sleep 2
    done
@@ -60,10 +63,13 @@ wait_for_datanodes(){
 }
 
 ## @description  Starts a docker-compose based test environment
+## @param number of datanodes to start and wait for (default: 3)
 start_docker_env(){
+  local -i datanode_count=${1:-3}
+
   docker-compose -f "$COMPOSE_FILE" down
-  docker-compose -f "$COMPOSE_FILE" up -d --scale datanode=3
-  wait_for_datanodes "$COMPOSE_FILE"
+  docker-compose -f "$COMPOSE_FILE" up -d --scale datanode="${datanode_count}"
+  wait_for_datanodes "$COMPOSE_FILE" "${datanode_count}"
   sleep 10
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to