chiark / gitweb /
disorder-udplog exits more reliably when parent dies
[disorder] / tests / dbversion.py
index 945d7ad483057cb9a9a29d0a87d280c27bb6ac02..35f71adae04172bac8194b655c0b837efc07e0d5 100755 (executable)
@@ -28,33 +28,18 @@ def test():
     dtest.copyfile(config, configsave)
     open(config, "a").write("dbversion 1\n")
     dtest.start_daemon()
-    time.sleep(2)
     dtest.stop_daemon()
     # Revert to default configuration
     dtest.copyfile(configsave, config)
+    print " testing daemon manages to upgrade..."
     dtest.start_daemon()
-    time.sleep(2)
+    assert dtest.check_files() == 0, "dtest.check_files"
+    print " getting server version"
     c = disorder.client()
-    try:
-        v = c.version()
-        print "unexpected success"
-        ok = False
-    except disorder.communicationError, e:
-        if re.search("connection refused", str(e)):
-            print "unexpected error: %s" % e
-            ok = False
-        else:
-            ok = True
-    dtest.stop_daemon()
-    if not ok:
-        sys.exit(1)
-    # Try running the upgrade tool
-    print "Attempting an upgrade..."
-    rc = subprocess.call(["disorder-dbupgrade",
-                          "--config", "%s/config" % dtest.testroot])
-    if rc != 0:
-        print "disorder-dbupgrade: FAILED: exit code %s" % rc
-        sys.exit(1)
+    v = c.version()
+    print "Server version: %s" % v
+    print " getting server stats"
+    s = c.stats()
 
 if __name__ == '__main__':
     dtest.run()