Add tests of cache bind directory

This commit is contained in:
Jody McIntyre
2018-04-16 18:52:51 -04:00
parent 10fed6ecf0
commit 1ad89bf53b

View File

@@ -70,3 +70,28 @@ teardown() {
echo "status: "$status
assert_output "herokuish"
}
@test "(build-env) DOKKU_ROOT cache bind is used by default" {
deploy_app
BUILD_CID=$(docker ps -a |grep $TEST_APP |grep /bin/bash | awk '{print $1}')
run /bin/bash -c "docker inspect --format '{{ .HostConfig.Binds }}' $BUILD_CID | tr -d '[]' | cut -f1 -d:"
echo "output: "$output
echo "status: "$status
assert_output "$DOKKU_ROOT/$TEST_APP/cache"
}
@test "(build-env) DOKKU_HOST_ROOT cache bind is used if set" {
TMP_ROOT=$(mktemp -d)
mkdir -p $DOKKU_ROOT/.dokkurc
echo export DOKKU_HOST_ROOT="$TMP_ROOT" > $DOKKU_ROOT/.dokkurc/HOST_ROOT
DOKKU_HOST_ROOT="$TMP_ROOT" deploy_app
BUILD_CID=$(docker ps -a |grep $TEST_APP |grep /bin/bash | awk '{print $1}')
run /bin/bash -c "docker inspect --format '{{ .HostConfig.Binds }}' $BUILD_CID | tr -d '[]' | cut -f1 -d:"
echo "output: "$output
echo "status: "$status
assert_output "$TMP_ROOT/$TEST_APP/cache"
rm -rf $TMP_ROOT $DOKKU_ROOT/.dokkurc/HOST_ROOT
}