diff --git a/py/test/rsession/hostmanage.py b/py/test/rsession/hostmanage.py index 898e70d14..86c5bbcb0 100644 --- a/py/test/rsession/hostmanage.py +++ b/py/test/rsession/hostmanage.py @@ -139,7 +139,10 @@ class HostManager(object): for root in self.roots: rsync = HostRSync(root, ignores=ignores, verbose=self.config.option.verbose) - destrelpath = root.relto(self.config.topdir) + if root == self.config.topdir: + destrelpath ="" + else: + destrelpath = root.basename for host in self.hosts: rsync.add_target_host(host, destrelpath, reporter) rsync.send(raises=False) diff --git a/py/test/rsession/testing/test_hostmanage.py b/py/test/rsession/testing/test_hostmanage.py index 38fef7a33..e54e51d9c 100644 --- a/py/test/rsession/testing/test_hostmanage.py +++ b/py/test/rsession/testing/test_hostmanage.py @@ -170,6 +170,7 @@ class TestHostManager(DirSetup): dir2 = self.source.ensure("dir1", "dir2", dir=1) dir2.ensure("hello") config = py.test.config._reparse([self.source]) + assert config.topdir == self.source hm = HostManager(config, hosts=[HostInfo("localhost:" + str(self.dest))]) events = [] @@ -191,11 +192,9 @@ class TestHostManager(DirSetup): hosts=[HostInfo("localhost:" + str(self.dest))]) events = [] hm.init_rsync(reporter=events.append) - assert self.dest.join("dir1").check() - assert self.dest.join("dir1", "dir2").check() - assert self.dest.join("dir1", "dir2", 'hello').check() + assert self.dest.join("dir2").check() + assert not self.dest.join("dir1").check() assert not self.dest.join("bogus").check() - assert not self.dest.join("dir1", "somefile").check() def test_hostmanager_rsync_ignore(self): dir2 = self.source.ensure("dir1", "dir2", dir=1) @@ -209,6 +208,7 @@ class TestHostManager(DirSetup): hm = HostManager(config, hosts=[HostInfo("localhost:" + str(self.dest))]) events = [] + print events hm.init_rsync(reporter=events.append) assert self.dest.join("dir1").check() assert not self.dest.join("dir1", "dir2").check()