mv dockerfile port logic to common function + tests. closes #1280
This commit is contained in:
@@ -5,6 +5,7 @@ load test_helper
|
||||
setup() {
|
||||
[[ -f "$DOKKU_ROOT/VHOST" ]] && cp -f "$DOKKU_ROOT/VHOST" "$DOKKU_ROOT/VHOST.bak"
|
||||
[[ -f "$DOKKU_ROOT/HOSTNAME" ]] && cp -f "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/HOSTNAME.bak"
|
||||
DOCKERFILE="$BATS_TMPDIR/Dockerfile"
|
||||
}
|
||||
|
||||
teardown() {
|
||||
@@ -131,3 +132,29 @@ teardown() {
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(core) port exposure (dockerfile raw port)" {
|
||||
source "$PLUGIN_PATH/common/functions"
|
||||
cat<<EOF > $DOCKERFILE
|
||||
EXPOSE 3001/udp
|
||||
EXPOSE 3003
|
||||
EXPOSE 3000/tcp
|
||||
EOF
|
||||
run get_dockerfile_exposed_port $DOCKERFILE
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_output 3003
|
||||
}
|
||||
|
||||
@test "(core) port exposure (dockerfile tcp port)" {
|
||||
source "$PLUGIN_PATH/common/functions"
|
||||
cat<<EOF > $DOCKERFILE
|
||||
EXPOSE 3001/udp
|
||||
EXPOSE 3000/tcp
|
||||
EXPOSE 3003
|
||||
EOF
|
||||
run get_dockerfile_exposed_port $DOCKERFILE
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_output 3000
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
# constants
|
||||
DOKKU_ROOT=${DOKKU_ROOT:=~dokku}
|
||||
PLUGIN_PATH=${PLUGIN_PATH:="/var/lib/dokku/plugins"}
|
||||
TEST_APP=my-cool-guy-test-app
|
||||
|
||||
# test functions
|
||||
|
||||
Reference in New Issue
Block a user