add random app generator in bash. support create and delete verbs. tested on bash 4.3.18 and 3.2.53

This commit is contained in:
Michael Hobbs
2015-01-16 17:59:51 -08:00
parent 161111aab5
commit 666f2d7434
3 changed files with 78 additions and 5 deletions

View File

@@ -164,3 +164,15 @@ teardown() {
echo "status: "$status
assert_success
}
@test "dokku client (create/delete)" {
setup_client_repo
run bash -c "${BATS_TEST_DIRNAME}/../../contrib/dokku_client.sh create"
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "${BATS_TEST_DIRNAME}/../../contrib/dokku_client.sh delete force"
echo "output: "$output
echo "status: "$status
assert_success
}

View File

@@ -107,6 +107,19 @@ deploy_app() {
git push target master || destroy_app
}
setup_client_repo() {
TMP=$(mktemp -d -t "$TARGET.XXXXX")
rmdir $TMP && cp -r ./tests/apps/nodejs-express $TMP
cd $TMP
git init
git config user.email "robot@example.com"
git config user.name "Test Robot"
[[ -f gitignore ]] && mv gitignore .gitignore
git add .
git commit -m 'initial commit'
}
setup_test_tls() {
TLS="/home/dokku/$TEST_APP/tls"
mkdir -p $TLS