tests: add a test for application renames

Also ensure the plugin:trigger calls are issued under the dokku user
This commit is contained in:
Jose Diaz-Gonzalez
2021-01-23 18:31:22 -05:00
parent f9693e78c8
commit c1ff3d4652
2 changed files with 31 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ cmd-plugin-trigger() {
declare cmd="plugin:trigger"
[[ "$1" == "$cmd" ]] && shift 1
plugn trigger "$@"
sudo -u dokku -E -H plugn trigger "$@"
}
cmd-plugin-trigger "$@"

View File

@@ -121,3 +121,33 @@ EOF
echo "status: $status"
assert_output "$test_restart_policy"
}
@test "(ps:rebuild) old app name" {
run /bin/bash -c "dokku --force apps:destroy $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
mkdir -p /home/dokku/test_app
sudo chown -R dokku:dokku /home/dokku/test_app
run /bin/bash -c "dokku plugin:trigger post-create test_app"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku git:sync --build test_app https://github.com/dokku/smoke-test-app.git"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku ps:rebuild test_app"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku apps:rename test_app $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
}