@@ -53,6 +53,7 @@ test_hadoop(){
53
53
local version=" $1 "
54
54
section2 " Setting up Hadoop $version test container"
55
55
VERSION=" $version " docker-compose up -d
56
+ hr
56
57
echo " getting Hadoop dynamic port mappings:"
57
58
docker_compose_port HADOOP_NAMENODE_PORT " HDFS NN"
58
59
docker_compose_port HADOOP_DATANODE_PORT " HDFS DN"
@@ -77,15 +78,16 @@ test_hadoop(){
77
78
# 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
78
79
# when_url_content "$HADOOP_HOST:$HADOOP_DATANODE_PORT" 'DataNode on|url=datanode\.html'
79
80
fi
81
+ hr
80
82
echo " waiting for RM cluster page to come up before testing for active resource manager:"
81
83
when_url_content " $HADOOP_HOST :$HADOOP_YARN_RESOURCE_MANAGER_PORT /ws/v1/cluster" resourceManager
82
84
hr
83
- hr
84
85
# echo "waiting for NM node page to come up:"
85
86
# Hadoop 2.8 content = NodeManager information
86
87
# when_url_content "$HADOOP_HOST:$HADOOP_YARN_NODE_MANAGER_PORT/node" 'Node Manager Version|NodeManager information'
87
88
hr
88
- cat > /dev/null << EOFCOMMENTED
89
+ [ -z " ${NOSETUP:- } " ] &&
90
+ cat > /dev/null << EOFCOMMENTED
89
91
echo "setting up HDFS for tests"
90
92
#docker-compose exec "$DOCKER_SERVICE " /bin/bash <<-EOF
91
93
docker exec -i "$DOCKER_CONTAINER " /bin/bash <<-EOF
@@ -105,11 +107,10 @@ cat >/dev/null <<EOFCOMMENTED
105
107
exit
106
108
EOF
107
109
EOFCOMMENTED
108
- echo
110
+ hr
109
111
if [ -n " ${NOTESTS:- } " ]; then
110
112
exit 0
111
113
fi
112
- hr
113
114
if [ " $version " = " latest" ]; then
114
115
local version=" .*"
115
116
fi
@@ -119,17 +120,17 @@ EOFCOMMENTED
119
120
# echo 'Failed to determine hostname of container via docker-compose exec, cannot continue with tests!'
120
121
# exit 1
121
122
# fi
122
- hr
123
+
123
124
# 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
124
125
# 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 :- } " ] ||
133
134
docker-compose down
134
135
echo
135
136
echo
0 commit comments