Skip to content

Commit

Permalink
HDDS-1978. Create helper script to run blockade tests. (#1310)
Browse files Browse the repository at this point in the history
  • Loading branch information
nandakumar131 authored Aug 23, 2019
1 parent c92de82 commit 20064b6
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
28 changes: 28 additions & 0 deletions hadoop-ozone/dev-support/checks/blockade.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$DIR/../../.." || exit 1

OZONE_VERSION=$(grep "<ozone.version>" "$DIR/../../pom.xml" | sed 's/<[^>]*>//g'| sed 's/^[ \t]*//')
cd "$DIR/../../dist/target/ozone-$OZONE_VERSION/tests" || exit 1

source ${DIR}/../../dist/target/ozone-${OZONE_VERSION}/compose/ozoneblockade/.env
export HADOOP_RUNNER_VERSION
export HDDS_VERSION

python -m pytest -s blockade
exit $?
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
import os
import re
import subprocess
import sys
import yaml
import time


from os import environ
Expand Down Expand Up @@ -146,11 +148,17 @@ def start(self):
"""
Start Ozone Cluster in docker containers.
"""
# check if proper env $HDDS_VERSION and $HADOOP_RUNNER_VERSION
# are set.

# check if docker is up.

if "HADOOP_RUNNER_VERSION" not in os.environ:
self.__logger__.error("HADOOP_RUNNER_VERSION is not set.")
sys.exit(1)

if "HDDS_VERSION" not in os.environ:
self.__logger__.error("HDDS_VERSION is not set.")
sys.exit(1)

self.__logger__.info("Starting Ozone Cluster")
if Blockade.blockade_status() == 0:
Blockade.blockade_destroy()
Expand All @@ -162,7 +170,7 @@ def start(self):
"datanode=" + str(self.conf.datanode_count)])
self.__logger__.info("Waiting 10s for cluster start up...")
# Remove the sleep and wait only till the cluster is out of safemode
# time.sleep(10)
time.sleep(10)
output = subprocess.check_output([Command.docker_compose, "-f",
self.docker_compose_file, "ps"])
node_list = []
Expand Down

0 comments on commit 20064b6

Please sign in to comment.