Пример #1
0
def record():
    for number in range(6):
        path = r"\\.\PHYSICALDRIVE{}".format(number)
        print number, path
        dev = DeviceIoControl(path)
        string = dev._partial_ioctl_diks_get_drive_layout_ex()
        filepath = os.path.join('tests', "drive_layout_{}".format(number))
        with open(filepath, 'wb') as fd:
            fd.write(string.raw)
def record():
    for number in range(6):
        path = r"\\.\PHYSICALDRIVE{}".format(number)
        print number, path
        dev = DeviceIoControl(path)
        string = dev._partial_ioctl_diks_get_drive_layout_ex()
        filepath = os.path.join('tests', "drive_layout_{}".format(number))
        with open(filepath, 'wb') as fd:
            fd.write(string.raw)
class FirstDriveLayoutTestCase(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        super(FirstDriveLayoutTestCase, cls).setUpClass()
        if socket.gethostname() != 'host-ci38':
            raise unittest.SkipTest("This test case should run only on host-ci38")

    def setUp(self):
        unittest.TestCase.setUp(self)
        self._io = DeviceIoControl(r"\\.\PHYSICALDRIVE0")

    def test_get_layout(self):
        actual = self._io.ioctl_disk_get_drive_layout_ex()
Пример #4
0
class FirstDriveLayoutTestCase(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        super(FirstDriveLayoutTestCase, cls).setUpClass()
        if socket.gethostname() != 'host-ci38':
            raise unittest.SkipTest(
                "This test case should run only on host-ci38")

    def setUp(self):
        unittest.TestCase.setUp(self)
        self._io = DeviceIoControl(r"\\.\PHYSICALDRIVE0")

    def test_get_layout(self):
        actual = self._io.ioctl_disk_get_drive_layout_ex()
Пример #5
0
 def setUp(self):
     unittest.TestCase.setUp(self)
     self._io = DeviceIoControl(r"\\.\PHYSICALDRIVE0")
 def setUp(self):
     unittest.TestCase.setUp(self)
     self._io = DeviceIoControl(r"\\.\PHYSICALDRIVE0")