Merge branch 'master' into 1091_mh-switch-to-herokuish
This commit is contained in:
@@ -3,13 +3,55 @@
|
||||
load test_helper
|
||||
|
||||
setup() {
|
||||
[[ -f $DOKKU_ROOT/ENV ]] && mv -f $DOKKU_ROOT/ENV $DOKKU_ROOT/ENV.bak
|
||||
sudo -H -u dokku /bin/bash -c "echo 'export global_test=true' > $DOKKU_ROOT/ENV"
|
||||
create_app
|
||||
}
|
||||
|
||||
teardown() {
|
||||
destroy_app
|
||||
rm -f "$DOKKU_ROOT/ENV"
|
||||
[[ -f $DOKKU_ROOT/ENV.bak ]] && mv -f $DOKKU_ROOT/ENV.bak $DOKKU_ROOT/ENV
|
||||
}
|
||||
|
||||
@test "(config) config:set --global" {
|
||||
run ssh dokku@dokku.me config:set --global test_var=true test_var2=\"hello world\"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(config) config:get --global" {
|
||||
run ssh dokku@dokku.me config:set --global test_var=true test_var2=\"hello world\" test_var3=\"with\\nnewline\"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
run dokku config:get --global test_var2
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_output 'hello world'
|
||||
run dokku config:get --global test_var3
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_output 'with\nnewline'
|
||||
}
|
||||
|
||||
@test "(config) config:unset --global" {
|
||||
run ssh dokku@dokku.me config:set --global test_var=true test_var2=\"hello world\"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
run dokku config:get --global test_var
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
run dokku config:unset --global test_var
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
run dokku config:get --global test_var
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_output ""
|
||||
}
|
||||
|
||||
@test "(config) config:set" {
|
||||
|
||||
@@ -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() {
|
||||
@@ -162,3 +163,29 @@ check_urls() {
|
||||
|
||||
check_urls http://my-cool-guy-test-app.127.0.0.1.xip.io
|
||||
}
|
||||
|
||||
@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