port-conflict.feature 774 B

12345678910111213141516171819202122232425262728
  1. Feature: Report port conflicts
  2. Background:
  3. Given a compose file
  4. """
  5. services:
  6. web:
  7. image: nginx
  8. ports:
  9. - 31415:80
  10. """
  11. And I run "docker rm -f nginx-pi-31415"
  12. Scenario: Reports a port allocation conflict with another container
  13. Given I run "docker run -d -p 31415:80 --name nginx-pi-31415 nginx"
  14. When I run "compose up -d"
  15. Then the output contains "port is already allocated"
  16. And the exit code is 1
  17. Scenario: Reports a port conflict with some other process
  18. Given a process listening on port 31415
  19. When I run "compose up -d"
  20. Then the output contains "address already in use"
  21. And the exit code is 1
  22. Scenario: Cleanup
  23. Given I run "docker rm -f nginx-pi-31415"