627
631
self.assertTrue(large_pack_name in pack_names)
634
class TestSmartServerAutopack(TestCaseWithTransport):
637
super(TestSmartServerAutopack, self).setUp()
638
# Create a smart server that publishes whatever the backing VFS server
640
self.smart_server = server.SmartTCPServer_for_testing()
641
self.smart_server.setUp(self.get_server())
642
self.addCleanup(self.smart_server.tearDown)
643
# Log all HPSS calls into self.hpss_calls.
644
client._SmartClient.hooks.install_named_hook(
645
'call', self.capture_hpss_call, None)
648
def capture_hpss_call(self, params):
649
self.hpss_calls.append(params.method)
651
def get_format(self):
652
return bzrdir.format_registry.make_bzrdir(self.format_name)
654
def test_autopack_rpc_is_used_when_using_hpss(self):
655
# Make local and remote repos
656
tree = self.make_branch_and_tree('local', format=self.get_format())
657
self.make_branch_and_tree('remote', format=self.get_format())
658
remote_branch_url = self.smart_server.get_url() + 'remote'
659
remote_branch = bzrdir.BzrDir.open(remote_branch_url).open_branch()
660
# Make 9 local revisions, and push them one at a time to the remote
661
# repo to produce 9 pack files.
663
tree.commit('commit %s' % x)
664
tree.branch.push(remote_branch)
665
# Make one more push to trigger an autopack
667
tree.commit('commit triggering pack')
668
tree.branch.push(remote_branch)
669
self.assertTrue('PackRepository.autopack' in self.hpss_calls)
630
672
def load_tests(basic_tests, module, test_loader):
631
673
# these give the bzrdir canned format name, and the repository on-disk