Пример #1
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("")
Пример #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("")