def test_empty(self): """Test calling createFlows without adequate data""" tm = TransferManager() try: rc = tm.createFlows() self.assertEqual(0, 1) except: self.assertEqual(1, 1)
def testTransferManagerSource(self): """ Test iface converter using a spec directly from the TransferManager """ tm = TransferManager() tm.addSource(None, "localhost", "localhost", 1) factory = EndpointFactory(0, False,False,False,False, '', [], False,False,False,False, '', []) ifs = factory.createIfaceList(tm.sources[0]) self.assertEqual(1, len(ifs)) self.assertEqual(('localhost', TEST_PORT, 1, ), ifs[0])
def test_remote_mem_to_remote_mem(self): """Test a remote mem to remote mem transfer""" # Get the hostname import platform host = platform.node() self.assertNotEqual(0, len(host)) # Test using hostname tm = TransferManager() tm.setXddPath('') tm.setRequestSize(1024*1024) tm.setTransferSize(1024*1024*1024*20) tm.setSourceTarget("/dev/zero") tm.setSinkTarget("/dev/null") tm.addSource(None, host, host, 4, [host]) tm.addSink(None, host, host, 4, [host]) rc = tm.createEndpoints() self.assertEqual(0, rc) rc = tm.startTransfer("/dev/zero", "/dev/null") self.assertEqual(0, rc) rc = tm.monitorTransfer(1) self.assertEqual(0, rc) rc = tm.cleanupEndpoints() self.assertEqual(0, rc)
def test_local_mem_to_mem(self): """Test a local mem to local mem transfer""" tm = TransferManager() tm.setXddPath('bin') tm.setRequestSize(1024*1024) tm.setTransferSize(1024*1024*1024*20) tm.setSourceTarget("/dev/zero") tm.setSinkTarget("/dev/null") tm.addSource(None, "localhost", "localhost", 1, ['localhost']) tm.addSink(None, "localhost", "localhost", 1) rc = tm.createEndpoints() self.assertEqual(0, rc) rc = tm.startTransfer("/dev/zero", "/dev/null") self.assertEqual(0, rc) rc = tm.monitorTransfer(1) self.assertEqual(0, rc) rc = tm.cleanupEndpoints() self.assertEqual(0, rc)
def test_single_file_with_restart(self): tm = TransferManager() tm.setXddPath('bin') tm.setRequestSize(1024*1024) tm.setTransferSize(1024*1024*1024*20) tm.setSourceTarget("/dev/zero") tm.setSinkTarget("/dev/null") tm.addSource(None, "localhost", "localhost", 6) tm.addSink(None, "localhost", "localhost", 6) rc = tm.createEndpoints() self.assertEqual(0, rc) rc = tm.startTransfer("/dev/zero", "/dev/null") self.assertEqual(0, rc) rc = tm.monitorTransfer(1) self.assertEqual(0, rc) rc = tm.cleanupEndpoints() self.assertEqual(0, rc) pass
def test_remote_mem_to_remote_mem(self): """Test a remote mem to remote mem transfer""" # Get the hostname import platform host = platform.node() self.assertNotEqual(0, len(host)) # Test using hostname tm = TransferManager() tm.setXddPath('') tm.setRequestSize(1024 * 1024) tm.setTransferSize(1024 * 1024 * 1024 * 20) tm.setSourceTarget("/dev/zero") tm.setSinkTarget("/dev/null") tm.addSource(None, host, host, 4, [host]) tm.addSink(None, host, host, 4, [host]) rc = tm.createEndpoints() self.assertEqual(0, rc) rc = tm.startTransfer("/dev/zero", "/dev/null") self.assertEqual(0, rc) rc = tm.monitorTransfer(1) self.assertEqual(0, rc) rc = tm.cleanupEndpoints() self.assertEqual(0, rc)
def test_local_mem_to_mem(self): """Test a local mem to local mem transfer""" tm = TransferManager() tm.setXddPath('bin') tm.setRequestSize(1024 * 1024) tm.setTransferSize(1024 * 1024 * 1024 * 20) tm.setSourceTarget("/dev/zero") tm.setSinkTarget("/dev/null") tm.addSource(None, "localhost", "localhost", 1, ['localhost']) tm.addSink(None, "localhost", "localhost", 1) rc = tm.createEndpoints() self.assertEqual(0, rc) rc = tm.startTransfer("/dev/zero", "/dev/null") self.assertEqual(0, rc) rc = tm.monitorTransfer(1) self.assertEqual(0, rc) rc = tm.cleanupEndpoints() self.assertEqual(0, rc)
def test_single_file_with_restart(self): tm = TransferManager() tm.setXddPath('bin') tm.setRequestSize(1024 * 1024) tm.setTransferSize(1024 * 1024 * 1024 * 20) tm.setSourceTarget("/dev/zero") tm.setSinkTarget("/dev/null") tm.addSource(None, "localhost", "localhost", 6) tm.addSink(None, "localhost", "localhost", 6) rc = tm.createEndpoints() self.assertEqual(0, rc) rc = tm.startTransfer("/dev/zero", "/dev/null") self.assertEqual(0, rc) rc = tm.monitorTransfer(1) self.assertEqual(0, rc) rc = tm.cleanupEndpoints() self.assertEqual(0, rc) pass