Skip to content

Commit afb197a

Browse files
committed
Ensure docker containers for C* and CDM are up and running
1 parent 9180dd0 commit afb197a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

SIT/environment.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ _testDockerNetwork() {
8181
}
8282

8383
_testDockerCassandra() {
84-
dockerPs=$(docker ps -a | awk '{if ($NF == "'${DOCKER_CASS}'") {print "yes"}}')
84+
dockerPs=$(docker ps --all --filter "name=${DOCKER_CASS}" --format "{{.Status}}" | awk '{if ($1 == "Up") {print "yes"}}')
8585
if [ "$dockerPs" != "yes" ]; then
8686
echo "no"
8787
return
@@ -154,7 +154,7 @@ _dropKeyspaces() {
154154
}
155155

156156
_testDockerCDM() {
157-
dockerPs=$(docker ps -a | awk '{if ($NF == "'${DOCKER_CDM}'") {print "yes"}}')
157+
dockerPs=$(docker ps --all --filter "name=${DOCKER_CDM}" --format "{{.Status}}" | awk '{if ($1 == "Up") {print "yes"}}')
158158
if [ "$dockerPs" != "yes" ]; then
159159
echo "no"
160160
else
@@ -278,7 +278,7 @@ _Validate() {
278278
fi
279279

280280
if [ "$(_testDockerCassandra)" == "yes" ]; then
281-
_info "Cassandra Docker is valid"
281+
_info "Cassandra Docker is valid and running"
282282
else
283283
_warn "Cassandra Docker is invalid"
284284
invalid=1
@@ -292,7 +292,7 @@ _Validate() {
292292
fi
293293

294294
if [ "$(_testDockerCDM)" == "yes" ]; then
295-
_info "CDM Docker is valid"
295+
_info "CDM Docker is valid and running"
296296
else
297297
_warn "CDM Docker is invalid"
298298
invalid=1

0 commit comments

Comments
 (0)