Use assert_success from the bats-assert library.

[ "$status" -eq 0 ] just bails out and its up to you to figure out why.
$output has the stdout/stderr so we could just print that. I think its
worth vendoring the libraries and just using those functions.

Signed-off-by: Chad Metcalf <chad@docker.com>
This commit is contained in:
Chad Metcalf 2020-08-08 14:16:20 -07:00 committed by Chad Metcalf
parent 6565a1f745
commit c600fc36ca
No known key found for this signature in database
GPG Key ID: BCA7CAE891B2C9B5
26 changed files with 182 additions and 156 deletions

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bats
load '../lib/test_helper.bash'
load '../lib/bats-support/load.bash'
load '../lib/bats-assert/load.bash'
cd ${BATS_TEST_DIRNAME}
@ -15,18 +17,17 @@ function teardown_file() {
@test "$(basename ${BATS_TEST_DIRNAME}): pull check" {
run docker-compose pull
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): build check" {
run docker-compose build
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): up check" {
run docker-compose up -d
[ "${status}" -eq 0 ]
assert_success
}
@test "$(basename ${BATS_TEST_DIRNAME}): ports check" {
@ -49,10 +50,10 @@ function teardown_file() {
if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then
run nc -z -v -u localhost "${port}"
[ "${status}" -eq 0 ]
assert_success
fi
done