-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: wrap args with quotes #212
fix: wrap args with quotes #212
Conversation
Would you be willing to add a non regression test for the problem which
this fixes to the ./test.sh?
|
I added a test to check if all involved scripts/entrypoints correctly handle special command-line arguments
the test will fail until fabric8io-images/run-java-sh#76 has been fixed and released as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some comments from when I looked over this more. I'll merge it anyway and up to you if you want to follow-up.
echo "APP TEST FAILED (with entrypoint ${entrypoint})" | ||
docker logs ${container_id} | ||
docker rm -f ${container_id} | ||
return -123 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit pick: wrong indent
-e LANG=en_US.UTF-8 -e PARAMETER_THAT_MAY_NEED_ESCAPING="&'\"|< é\\(" ${name} \ | ||
${entrypoint} --commandLineArgValueThatMayNeedEscaping="&'\"|< é\\(" --killDelay=1 --exitCode=0) | ||
|
||
# sleep is required because after docker run returns, the container is up but our server may not quite be yet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this left over comment (as it does not sleep
here, contrary to orig test)
local entrypoint=$2 | ||
|
||
local container_id=$(docker run --name ${name}-test -d \ | ||
-e LANG=en_US.UTF-8 -e PARAMETER_THAT_MAY_NEED_ESCAPING="&'\"|< é\\(" ${name} \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about the use of -e LANG=en_US.UTF-8
here.. is it required just for this particular test, or should be added in general??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UTF-8 is requieredto pass in arguments with special characters. if you renove it then the test will fail. I'm not sure but I guess its because the test JAR (as 99% of all Jars) was build with UTF-8 encoding)
|
||
local container_id=$(docker run --name ${name}-test -d \ | ||
-e LANG=en_US.UTF-8 -e PARAMETER_THAT_MAY_NEED_ESCAPING="&'\"|< é\\(" ${name} \ | ||
${entrypoint} --commandLineArgValueThatMayNeedEscaping="&'\"|< é\\(" --killDelay=1 --exitCode=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what --killDelay=1 --exitCode=0
does / is needed for... docker run
or spring-cloud-deployer-spi-test-app-1.3.4.RELEASE-exec.jar
arguments? Perhaps worth an inline comment to clarify to future readers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--killDelay=1 --exitCode=0 are arguments for the test application to define if the the app should be killed after running its test and what exitcode should be returned. i'll add some comments
Inspired by fabric8io-images#212 and found this very useful for fabric8io-images#213
closes #211