My scenario like this:
I use jenkins docker plugin (YAD) to start a jenkins slave container, and this slave container will create a network, start some container (as dependency services) and then test. After test done, it will call tear_down.sh to stop dependency containers, remove them and so on. Same script working fine when use post build steps plugin. But I like post build script plugin as no matter test success or failed, it should always execute it, and execution result shouldn't change test result.
Here is the output of post build script. You can see, after try to call "/tmp/jenkinsxxxx.sh" with parameter, but it not doing anything, and then go to next step (recording test results).
[PostBuildScript] - Executing post build scripts.
[YAD-PLUGIN] Injecting variable: DOCKER_CONTAINER_ID
[YAD-PLUGIN] Injecting variable: JENKINS_CLOUD_ID
[YAD-PLUGIN] Injecting variable: DOCKER_HOST
[PostBuildScript] - Executing the script /usr/bin/tear_down.sh with parameters [tcp://docker-swarm-manager:3376, /workspace/docker-compose.yml].
[sample_tests_DISABLED] $ /bin/sh -xe /tmp/jenkins2753822486687003701.sh tcp://docker-swarm-manager:3376 /workspace/docker-compose.yml
Recording test results
Let me know what else can I provide in order to reproduce it.