예제 #1
0
파일: test.py 프로젝트: franciozzy/ffs
 def test_mirror(self):
     d = device.create("", image.Raw(raw_path))
     block = d.block_device()
     assert block is not None
     d.add_tapdisk("")
     a, b = socket.socketpair()
     d.tapdisk.start_mirror("", a)
     b.sendall("NBDMAGIC\x00\x00\x42\x02\x81\x86\x12\x53" + struct.pack(">Q", 1024 * 1024) + "\0" * 128)
     d.destroy("")
예제 #2
0
 def test_nbd(self):
     d = device.create("", image.Raw(raw_path))
     block = d.block_device()
     assert block is not None
     d.add_tapdisk("")
     a, b = socket.socketpair()
     d.tapdisk.receive_nbd("", a)
     results = b.recv(256)
     self.assertEqual("NBDMAGIC", results[0:8])
     d.destroy("")
예제 #3
0
 def test_nbd(self):
     d = device.create("", image.Raw(raw_path))
     block = d.block_device()
     assert block is not None
     d.add_tapdisk("")
     a, b = socket.socketpair()
     d.tapdisk.receive_nbd("", a)
     results = b.recv(256)
     self.assertEqual("NBDMAGIC", results[0:8])
     d.destroy("")
예제 #4
0
 def test_mirror(self):
     d = device.create("", image.Raw(raw_path))
     block = d.block_device()
     assert block is not None
     d.add_tapdisk("")
     a, b = socket.socketpair()
     d.tapdisk.start_mirror("", a)
     b.sendall('NBDMAGIC\x00\x00\x42\x02\x81\x86\x12\x53' +
               struct.pack('>Q', 1024 * 1024) + '\0' * 128)
     d.destroy("")
예제 #5
0
 def test_raw_block_tapdisk(self):
     d = device.create("", image.Raw(raw_path))
     block = d.block_device()
     assert block is not None
     d.add_tapdisk("")
     d.destroy("")
예제 #6
0
 def test_raw(self):
     d = device.create("", image.Raw(raw_path))
     d.destroy("")
예제 #7
0
 def test_raw_block_tapdisk(self):
     d = device.create("", image.Raw(raw_path))
     block = d.block_device()
     assert block is not None
     d.add_tapdisk("")
     d.destroy("")
예제 #8
0
 def test_raw(self):
     d = device.create("", image.Raw(raw_path))
     d.destroy("")