summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2014-07-30 09:52:06 +0000
committerKeith Wall <kwall@apache.org>2014-07-30 09:52:06 +0000
commit8e6af1872fb84309ea30f71745100894e956324a (patch)
treefd234e7b371b104753d98170741a5111dcfd7820 /python
parent5e24c46f36c3ab5aa18c00cd7ba74c042eb5c18f (diff)
downloadqpid-python-8e6af1872fb84309ea30f71745100894e956324a.tar.gz
NO-JIRA: Strengthen ant python test wrapper to ensure that ant will fail if it fails to identify the pid of the broker\'s process
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1614598 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
-rw-r--r--python/qpid-python-test-ant.xml18
1 files changed, 13 insertions, 5 deletions
diff --git a/python/qpid-python-test-ant.xml b/python/qpid-python-test-ant.xml
index 15271a477b..a6f6ab5b32 100644
--- a/python/qpid-python-test-ant.xml
+++ b/python/qpid-python-test-ant.xml
@@ -82,16 +82,16 @@
</target>
<target name="stop-broker" depends="init">
- <get-pid port="${qpid.port}" targetProperty="pid"/>
- <echo>Stopping Qpid ${pid}</echo>
+ <get-pid port="${qpid.port}" targetProperty="pid" resultproperty="stopresultproperty"/>
+ <echo>Stopping Qpid with pid '${pid}'</echo>
<kill-pid pid="${pid}" signo="-15"/>
<await-port-free port="${qpid.port}" maxwait="${stop.maxwait}" checkevery="${socket.checkevery}" timeoutproperty="stop.timeout"/>
</target>
<target name="kill-broker" depends="init" if="stop.timeout">
- <get-pid port="${qpid.port}" targetProperty="pid"/>
- <echo>Killing Qpid ${pid}</echo>
+ <get-pid port="${qpid.port}" targetProperty="pid" resultproperty="killresultproperty"/>
+ <echo>Killing Qpid with pid '${pid}'</echo>
<kill-pid pid="${pid}" signo="-9"/>
</target>
@@ -117,11 +117,19 @@
<macrodef name="get-pid">
<attribute name="targetProperty"/>
<attribute name="port"/>
+ <attribute name="resultproperty"/>
<sequential>
- <exec executable="lsof" outputproperty="@{targetProperty}">
+ <exec executable="lsof" outputproperty="@{targetProperty}" resultproperty="@{resultproperty}">
<arg value="-t"/> <!-- Terse output -->
<arg value="-i"/> <arg value=":@{port}"/>
</exec>
+ <fail message="lsof failed to determine the pid using port @{port}, exit status ${@{resultproperty}}">
+ <condition>
+ <not>
+ <equals arg1="${@{resultproperty}}" arg2="0"/>
+ </not>
+ </condition>
+ </fail>
</sequential>
</macrodef>