Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ../compose/ozoneblockade/.env

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shellcheck:1: note: Not following: ../compose/ozoneblockade/.env: openBinaryFile: does not exist (No such file or directory) [SC1091]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shellcheck:1: note: Not following: ../compose/ozoneblockade/.env: openBinaryFile: does not exist (No such file or directory) [SC1091]

export HADOOP_RUNNER_VERSION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are these variables populated ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variables are set by source ../compose/ozoneblockade/.env
The .env file will contains proper values.

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