summaryrefslogtreecommitdiff
path: root/rdiff-backup/testing/server.py
diff options
context:
space:
mode:
authorben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-03-21 07:34:29 +0000
committerben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-03-21 07:34:29 +0000
commita2e3c38d72877dd9142d802e76047e10cf490e19 (patch)
treefd912dd37d0afe96adf760606d65f7b302c0678e /rdiff-backup/testing/server.py
parent8c37a5bdfdd46d5cfad6e9d67925ddef9ca382bf (diff)
downloadrdiff-backup-a2e3c38d72877dd9142d802e76047e10cf490e19.tar.gz
Added hardlink support, refactored some test cases
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@7 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/testing/server.py')
-rwxr-xr-xrdiff-backup/testing/server.py32
1 files changed, 25 insertions, 7 deletions
diff --git a/rdiff-backup/testing/server.py b/rdiff-backup/testing/server.py
index b30c745..17e11ca 100755
--- a/rdiff-backup/testing/server.py
+++ b/rdiff-backup/testing/server.py
@@ -1,12 +1,30 @@
#!/usr/bin/env python
-import sys
-execfile("commontest.py")
-rbexec("setconnections.py")
+import sys, os
-def Test_SetConnGlobals(conn, name, val):
- """Used in unittesting - set one of specified connection's Global vars"""
- conn.Globals.set(name, val)
+__doc__ = """
-Log.setverbosity(9)
+This starts an rdiff-backup server using the existing source files.
+If not run from the source directory, the only argument should be
+the directory the source files are in.
+"""
+
+def print_usage():
+ print "Usage: server.py [path to source files]", __doc__
+
+if len(sys.argv) > 2:
+ print_usage()
+ sys.exit(1)
+
+try:
+ if len(sys.argv) == 2:
+ olddir = os.getcwd()
+ os.chdir(sys.argv[1])
+ execfile("setconnections.py")
+ if len(sys.argv) == 2: os.chdir(olddir)
+except (OSError, IOError):
+ print_usage()
+ raise
+
+#Log.setverbosity(9)
PipeConnection(sys.stdin, sys.stdout).Server()