Fixing Mac vs Linux bash shell'ism.
Signed-off-by: Chad Metcalf <chad@docker.com>
This commit is contained in:
		
				
					committed by
					
						 Chad Metcalf
						Chad Metcalf
					
				
			
			
				
	
			
			
			
						parent
						
							702ec96821
						
					
				
				
					commit
					5185cedf4e
				
			| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										28
									
								
								gitea-postgres/test.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										28
									
								
								gitea-postgres/test.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,28 @@ | |||||||
|  | #!/bin/bash | ||||||
|  |  | ||||||
|  | for service in $(docker-compose ps -q); do | ||||||
|  |  | ||||||
|  |     # simple test to check that any exposed port has something actually listening | ||||||
|  |     # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|  |     ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|  |     OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|  |     for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|  |         protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|  |         # the || true here just makes sure bats doesn't fail the test because a | ||||||
|  |         # port wasn't matched. We will check for empty ports later | ||||||
|  |         port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|  |         if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|  |             run nc -z -v localhost "${port}" | ||||||
|  |             [ "${?}" -eq 0  ] | ||||||
|  |         elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|  |             run nc -z -v -u localhost "${port}" | ||||||
|  |             [ "${?}" -eq 0  ] | ||||||
|  |         fi | ||||||
|  |  | ||||||
|  |     done | ||||||
|  | done | ||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,21 +37,21 @@ function teardown_file() { | |||||||
|         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp |         # assumes format 22/tcp, 0.0.0.0:3000->3000/tcp | ||||||
|         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") |         ports_string=$(docker ps --filter="ID=${service}" --format "{{.Ports}}") | ||||||
|  |  | ||||||
|         OIFS=${IFS}; IFS=','; service_port=($ports_string); IFS=${OIFS}; unset OIFS; |         OIFS=${IFS}; IFS=','; service_port=("$ports_string"); IFS=${OIFS}; unset OIFS; | ||||||
|  |  | ||||||
|         for i in ${service_port[@]}; do |         for i in "${service_port[@]}"; do | ||||||
|  |  | ||||||
|             protocol=$(expr match ${i} '.*\(tcp\|udp\)') |             protocol=$(expr "${i}" : '.*\(...$\)') | ||||||
|  |  | ||||||
|             # the || true here just makes sure bats doesn't fail the test because a |             # the || true here just makes sure bats doesn't fail the test because a | ||||||
|             # port wasn't matched. We will check for empty ports later |             # port wasn't matched. We will check for empty ports later | ||||||
|             port=$(expr match ${i} '.*:\([0-9]*\)->' || true) |             port=$(expr "${i}" : '.*:\([0-9]*\)->' || true) | ||||||
|  |  | ||||||
|             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then |             if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v localhost ${port} |                 run nc -z -v localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then |             elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then | ||||||
|                 run nc -z -v -u localhost ${port} |                 run nc -z -v -u localhost "${port}" | ||||||
|                 [ "${status}" -eq 0  ] |                 [ "${status}" -eq 0  ] | ||||||
|             fi |             fi | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user