Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 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
Example #4
0
    def test_remote_mem_to_local_mem(self):
        """Test a local mem to remote mem transfer"""
        # Get the hostname
        import platform
        host = platform.node()
        self.assertNotEqual(0, len(host))

        tm = TransferManager()
        tm.setSinkXddPath('')
        tm.setRequestSize(1024 * 1024)
        tm.setTransferSize(1024 * 1024 * 1024 * 20)
        tm.setSourceTarget("/dev/zero")
        tm.setSinkTarget("/dev/null")
        tm.addSource(None, host, host, 3, [host])
        tm.addSink(None, "localhost", "localhost", 3, [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)