Skip to content

Commit df3b928

Browse files
committed
update tests/test_hadoop.sh
1 parent 27812b5 commit df3b928

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

tests/test_hadoop.sh

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ test_hadoop(){
5353
local version="$1"
5454
section2 "Setting up Hadoop $version test container"
5555
VERSION="$version" docker-compose up -d
56+
hr
5657
echo "getting Hadoop dynamic port mappings:"
5758
docker_compose_port HADOOP_NAMENODE_PORT "HDFS NN"
5859
docker_compose_port HADOOP_DATANODE_PORT "HDFS DN"
@@ -77,15 +78,16 @@ test_hadoop(){
7778
# Hadoop 2.8 uses /datanode.html but this isn't available on older versions eg. 2.6 so change the regex to find the redirect in 2.8 instead
7879
#when_url_content "$HADOOP_HOST:$HADOOP_DATANODE_PORT" 'DataNode on|url=datanode\.html'
7980
fi
81+
hr
8082
echo "waiting for RM cluster page to come up before testing for active resource manager:"
8183
when_url_content "$HADOOP_HOST:$HADOOP_YARN_RESOURCE_MANAGER_PORT/ws/v1/cluster" resourceManager
8284
hr
83-
hr
8485
#echo "waiting for NM node page to come up:"
8586
# Hadoop 2.8 content = NodeManager information
8687
#when_url_content "$HADOOP_HOST:$HADOOP_YARN_NODE_MANAGER_PORT/node" 'Node Manager Version|NodeManager information'
8788
hr
88-
cat >/dev/null <<EOFCOMMENTED
89+
[ -z "${NOSETUP:-}" ] &&
90+
cat >/dev/null <<EOFCOMMENTED
8991
echo "setting up HDFS for tests"
9092
#docker-compose exec "$DOCKER_SERVICE" /bin/bash <<-EOF
9193
docker exec -i "$DOCKER_CONTAINER" /bin/bash <<-EOF
@@ -105,11 +107,10 @@ cat >/dev/null <<EOFCOMMENTED
105107
exit
106108
EOF
107109
EOFCOMMENTED
108-
echo
110+
hr
109111
if [ -n "${NOTESTS:-}" ]; then
110112
exit 0
111113
fi
112-
hr
113114
if [ "$version" = "latest" ]; then
114115
local version=".*"
115116
fi
@@ -119,17 +120,17 @@ EOFCOMMENTED
119120
# echo 'Failed to determine hostname of container via docker-compose exec, cannot continue with tests!'
120121
# exit 1
121122
# fi
122-
hr
123+
123124
# Docker maps all these 127.0.0.2, 127.0.0.3 etc to go to docker port mappings so is there is a container running it finds it accidentally
124125
# therefore reset the HADOOP PORTS to point to something that should get connection refused like port 1 and so that the failure hosts still fail and return only the expected correct host
125-
HADOOP_NAMENODE_PORT=1 run_output "NO_AVAILABLE_SERVER" ./find_active_hadoop_namenode.py 127.0.0.2 127.0.0.3 "$HADOOP_HOST:$HADOOP_DATANODE_PORT"
126-
hr
127-
HADOOP_NAMENODE_PORT=1 run_output "$HADOOP_HOST:$HADOOP_NAMENODE_PORT" ./find_active_hadoop_namenode.py 127.0.0.2 "$HADOOP_HOST:$HADOOP_DATANODE_PORT" 127.0.0.3 "$HADOOP_HOST:$HADOOP_NAMENODE_PORT"
128-
hr
129-
HADOOP_YARN_RESOURCE_MANAGER_PORT=1 run_output "NO_AVAILABLE_SERVER" ./find_active_hadoop_yarn_resource_manager.py 127.0.0.2 127.0.0.3 "$HADOOP_HOST:$HADOOP_YARN_NODE_MANAGER_PORT"
130-
hr
131-
HADOOP_YARN_RESOURCE_MANAGER_PORT=1 run_output "$HADOOP_HOST:$HADOOP_YARN_RESOURCE_MANAGER_PORT" ./find_active_hadoop_yarn_resource_manager.py 127.0.0.2 "$HADOOP_HOST:$HADOOP_YARN_NODE_MANAGER_PORT" 127.0.0.3 "$HADOOP_HOST:$HADOOP_YARN_RESOURCE_MANAGER_PORT"
132-
hr
126+
HADOOP_NAMENODE_PORT=1 ERRCODE=1 run_grep "^NO_AVAILABLE_SERVER$" ./find_active_hadoop_namenode.py 127.0.0.2 127.0.0.3 "$HADOOP_HOST:$HADOOP_DATANODE_PORT"
127+
128+
HADOOP_NAMENODE_PORT=1 run_grep "^$HADOOP_HOST:$HADOOP_NAMENODE_PORT$" ./find_active_hadoop_namenode.py 127.0.0.2 "$HADOOP_HOST:$HADOOP_DATANODE_PORT" 127.0.0.3 "$HADOOP_HOST:$HADOOP_NAMENODE_PORT"
129+
130+
HADOOP_YARN_RESOURCE_MANAGER_PORT=1 ERRCODE=1 run_grep "^NO_AVAILABLE_SERVER$" ./find_active_hadoop_yarn_resource_manager.py 127.0.0.2 127.0.0.3 "$HADOOP_HOST:$HADOOP_YARN_NODE_MANAGER_PORT"
131+
132+
HADOOP_YARN_RESOURCE_MANAGER_PORT=1 run_grep "^$HADOOP_HOST:$HADOOP_YARN_RESOURCE_MANAGER_PORT$" ./find_active_hadoop_yarn_resource_manager.py 127.0.0.2 "$HADOOP_HOST:$HADOOP_YARN_NODE_MANAGER_PORT" 127.0.0.3 "$HADOOP_HOST:$HADOOP_YARN_RESOURCE_MANAGER_PORT"
133+
[ -z "${KEEPDOCKER:-}" ] ||
133134
docker-compose down
134135
echo
135136
echo

0 commit comments

Comments
 (0)