Skip to content

Commit

Permalink
FAB-898: Fix Missing IP address in behave
Browse files Browse the repository at this point in the history
The IP addresses were not always listed when starting
the peers in the docker compose files. The checks were
comparing ascii strings with unicode strings and the
peer were paused to allow the containers to get an
IP address when performing the docker inspect command.

Change-Id: I6a5045f9b6849fae8d2ca8eeeac3495a8e1889b3
Signed-off-by: Latitia M Haskins <latitia.haskins@gmail.com>
  • Loading branch information
lhaskins committed Nov 1, 2016
1 parent a293bc9 commit 58aca66
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bddtests/compose-defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ vp:
# $$GOPATH (double dollar) required to prevent docker-compose doing its own
# substitution before the value gets to the container
#command: sh -c "exec $$GOPATH/src/github.com/hyperledger/fabric/bddtests/scripts/start-peer.sh"
command: peer node start
command: sh -c "sleep 2; peer node start"

# Use these options if coverage desired for peers
#image: hyperledger/fabric-peer-coverage
Expand Down
2 changes: 1 addition & 1 deletion bddtests/steps/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def rebuildContainerData(self):
output, error, returncode = \
bdd_test_util.cli_call(["docker", "inspect", "--format", "{{ .Config.Labels }}", containerID], expect_success=True)
labels = output.splitlines()[0][4:-1].split()
dockerComposeService = [composeService[27:] for composeService in labels if composeService.startswith("com.docker.compose.service:")][0]
dockerComposeService = [unicode(composeService[27:]) for composeService in labels if composeService.startswith("com.docker.compose.service:")][0]
#print("dockerComposeService = {0}".format(dockerComposeService))
#print("container {0} has env = {1}".format(containerName, env))
self.containerDataList.append(peer_basic_impl.ContainerData(containerName, ipAddress, env, dockerComposeService))
Expand Down

0 comments on commit 58aca66

Please sign in to comment.