verify that tag search works across dump
[disorder] / tests / dtest.py
index 7c0bae0..cd14cfb 100644 (file)
@@ -41,9 +41,10 @@ else:
 sys.path.insert(0, os.path.join(top_builddir, "python"))
 import disorder
 
-# Make sure the server build directory is on the executable search path
+# Make sure the build directories are on the executable search path
 ospath = os.environ["PATH"].split(os.pathsep)
 ospath.insert(0, os.path.join(top_builddir, "server"))
+ospath.insert(0, os.path.join(top_builddir, "clients"))
 os.environ["PATH"] = os.pathsep.join(ospath)
 
 # Parse the makefile in the current directory to identify the source directory
@@ -168,6 +169,7 @@ stopword the a an and to too in on of we i am as im for is
 username fred
 password fredpass
 allow fred fredpass
+trust fred
 plugins
 plugins %s/plugins
 plugins %s/plugins/.libs
@@ -231,7 +233,7 @@ Stop the daemon if it has not stopped already"""
     rc = daemon.poll()
     if rc == None:
         print " stopping daemon"
-        os.kill(daemon.pid, 15)
+        disorder.client().shutdown()
         print "  waiting for daemon"
         rc = daemon.wait()
         print "  daemon has stopped"
@@ -322,6 +324,14 @@ def check_files():
             failures += 1
     return failures
 
+def command(args):
+    """Execute a command given as a list and return its stdout"""
+    p = subprocess.Popen(args, stdout=subprocess.PIPE)
+    lines = p.stdout.readlines()
+    rc = p.wait()
+    assert rc == 0, ("%s returned status %s" % (args, rc))
+    return lines
+
 # -----------------------------------------------------------------------------
 # Common setup