From 456e1da8452b042a924ad9f2df82feff710a4f7a Mon Sep 17 00:00:00 2001
From: ugaston <ugaston@localhost>
Date: Fri, 26 Oct 2007 16:22:43 +0000
Subject: [PATCH] Couple of replication failover testcases killing DS

---
 opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml b/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml
index abca95a..e778fe8 100755
--- a/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml
+++ b/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml
@@ -1487,4 +1487,56 @@
       </return>
     </sequence>
   </function>
+
+
+
+  <function name="killDs">
+    <function-prolog>
+      Kill the ldap server
+    </function-prolog>
+    <function-map-args>
+      <function-arg-def name="location" type="optional" default="STAF_REMOTE_HOSTNAME">
+        <function-arg-description>
+          Location of target host
+      </function-arg-description>
+      <function-arg-property name="type" value="hostname"/>
+      </function-arg-def>
+      <function-arg-def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
+        <function-arg-description>
+          Pathname to installation root
+        </function-arg-description>
+        <function-arg-property name="type" value="pathname"/>
+      </function-arg-def>
+    </function-map-args>
+      
+    <sequence>
+      <message>
+        'Kill server running on  %s  at  %s' % (location, dsPath)
+      </message>
+
+      <script>
+        pidPath = '%s/logs/server.pid' % dsPath
+        pidFile = open(pidPath, 'r')
+        pid = pidFile.readline()[:-1]
+        pidFile.close()
+
+        if isWindows:
+          _cmd = 'tskill'
+          _args = pid
+        else:
+          _cmd = 'kill'
+          _args = '-9 %s' % pid
+      </script>
+      <call function="'runCommand'">
+        { 'name'      : 'Kill DS server',
+          'location'  : location,
+          'command'   : _cmd,
+          'arguments' : _args
+        }
+      </call>
+      <return>STAXResult</return>        
+    </sequence>
+  </function>
+
+                        
 </stax>

--
Gitblit v1.10.0