File tree Expand file tree Collapse file tree 2 files changed +39
-3
lines changed
fault-injection-test/network-tests/src/test/blockade/ozone Expand file tree Collapse file tree 2 files changed +39
-3
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Licensed to the Apache Software Foundation (ASF) under one or more
3+ # contributor license agreements. See the NOTICE file distributed with
4+ # this work for additional information regarding copyright ownership.
5+ # The ASF licenses this file to You under the Apache License, Version 2.0
6+ # (the "License"); you may not use this file except in compliance with
7+ # the License. You may obtain a copy of the License at
8+ #
9+ # http://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # Unless required by applicable law or agreed to in writing, software
12+ # distributed under the License is distributed on an "AS IS" BASIS,
13+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ # See the License for the specific language governing permissions and
15+ # limitations under the License.
16+
17+ DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd ) "
18+ cd " $DIR /../../.." || exit 1
19+
20+ OZONE_VERSION=$( grep " <ozone.version>" " $DIR /../../pom.xml" | sed ' s/<[^>]*>//g' | sed ' s/^[ \t]*//' )
21+ cd " $DIR /../../dist/target/ozone-$OZONE_VERSION /tests" || exit 1
22+
23+ source ${DIR} /../../dist/target/ozone-${OZONE_VERSION} /compose/ozoneblockade/.env
24+ export HADOOP_RUNNER_VERSION
25+ export HDDS_VERSION
26+
27+ python -m pytest -s blockade
28+ exit $?
Original file line number Diff line number Diff line change 1919import os
2020import re
2121import subprocess
22+ import sys
2223import yaml
24+ import time
2325
2426
2527from os import environ
@@ -146,11 +148,17 @@ def start(self):
146148 """
147149 Start Ozone Cluster in docker containers.
148150 """
149- # check if proper env $HDDS_VERSION and $HADOOP_RUNNER_VERSION
150- # are set.
151151
152152 # check if docker is up.
153153
154+ if "HADOOP_RUNNER_VERSION" not in os .environ :
155+ self .__logger__ .error ("HADOOP_RUNNER_VERSION is not set." )
156+ sys .exit (1 )
157+
158+ if "HDDS_VERSION" not in os .environ :
159+ self .__logger__ .error ("HDDS_VERSION is not set." )
160+ sys .exit (1 )
161+
154162 self .__logger__ .info ("Starting Ozone Cluster" )
155163 if Blockade .blockade_status () == 0 :
156164 Blockade .blockade_destroy ()
@@ -162,7 +170,7 @@ def start(self):
162170 "datanode=" + str (self .conf .datanode_count )])
163171 self .__logger__ .info ("Waiting 10s for cluster start up..." )
164172 # Remove the sleep and wait only till the cluster is out of safemode
165- # time.sleep(10)
173+ time .sleep (10 )
166174 output = subprocess .check_output ([Command .docker_compose , "-f" ,
167175 self .docker_compose_file , "ps" ])
168176 node_list = []
You can’t perform that action at this time.
0 commit comments