Exemplo n.º 1
0
 def test_migrate_network_to_block(self):
     conf = drive_config(diskType=DISK_TYPE.NETWORK, path='pool/volume')
     drive = Drive(self.log, **conf)
     # Migrate drive to block domain...
     drive.path = '/blockdomain/volume'
     drive.diskType = DISK_TYPE.BLOCK
     self.assertEqual(DISK_TYPE.BLOCK, drive.diskType)
Exemplo n.º 2
0
 def test_migrate_from_block_to_file(self):
     conf = drive_config(path='/blockdomain/volume')
     drive = Drive(self.log, diskType=DISK_TYPE.BLOCK, **conf)
     # Migrate drive to file domain...
     drive.diskType = DISK_TYPE.FILE
     drive.path = "/filedomain/volume"
     self.assertEqual(DISK_TYPE.FILE, drive.diskType)
Exemplo n.º 3
0
 def test_migrate_from_block_to_network(self):
     conf = drive_config(path='/blockdomain/volume')
     drive = Drive(self.log, diskType=DISK_TYPE.BLOCK, **conf)
     # Migrate drive to network disk...
     drive.path = "pool/volume"
     drive.diskType = DISK_TYPE.NETWORK
     self.assertEqual(DISK_TYPE.NETWORK, drive.diskType)
Exemplo n.º 4
0
 def test_migrate_network_to_block(self):
     conf = drive_config(diskType=DISK_TYPE.NETWORK, path='pool/volume')
     drive = Drive(self.log, **conf)
     # Migrate drive to block domain...
     drive.path = '/blockdomain/volume'
     drive.diskType = DISK_TYPE.BLOCK
     assert DISK_TYPE.BLOCK == drive.diskType
Exemplo n.º 5
0
 def test_migrate_from_block_to_file(self):
     conf = drive_config(path='/blockdomain/volume')
     drive = Drive(self.log, diskType=DISK_TYPE.BLOCK, **conf)
     # Migrate drive to file domain...
     drive.diskType = DISK_TYPE.FILE
     drive.path = "/filedomain/volume"
     assert DISK_TYPE.FILE == drive.diskType
Exemplo n.º 6
0
 def test_migrate_from_block_to_network(self):
     conf = drive_config(path='/blockdomain/volume')
     drive = Drive(self.log, diskType=DISK_TYPE.BLOCK, **conf)
     # Migrate drive to network disk...
     drive.path = "pool/volume"
     drive.diskType = DISK_TYPE.NETWORK
     assert DISK_TYPE.NETWORK == drive.diskType
Exemplo n.º 7
0
 def test_migrate_from_file_to_block(self):
     conf = drive_config(path='/filedomain/volume')
     drive = Drive(self.log, diskType=DISK_TYPE.FILE, **conf)
     # Migrate drive to block domain...
     drive.diskType = DISK_TYPE.BLOCK
     drive.path = "/blockdomain/volume"
     self.assertEqual(DISK_TYPE.BLOCK, drive.diskType)
Exemplo n.º 8
0
    def test_path_change_reset_threshold_state(self):
        conf = drive_config(diskType=DISK_TYPE.BLOCK, path='/old/path')
        drive = Drive(self.log, **conf)
        # Simulating drive in SET state
        drive.threshold_state = BLOCK_THRESHOLD.SET

        drive.path = '/new/path'
        self.assertEqual(drive.threshold_state, BLOCK_THRESHOLD.UNSET)
Exemplo n.º 9
0
    def test_path_change_reset_threshold_state(self):
        conf = drive_config(diskType=DISK_TYPE.BLOCK, path='/old/path')
        drive = Drive(self.log, **conf)
        # Simulating drive in SET state
        drive.threshold_state = BLOCK_THRESHOLD.SET

        drive.path = '/new/path'
        assert drive.threshold_state == BLOCK_THRESHOLD.UNSET
Exemplo n.º 10
0
 def test_migrate_network_to_block(self):
     conf = drive_config(diskType=DISK_TYPE.NETWORK, path='pool/volume')
     drive = Drive(self.log, **conf)
     self.assertTrue(drive.networkDev)
     # Migrate drive to block domain...
     drive.path = '/blockdomain/volume'
     drive.diskType = None
     self.assertTrue(drive.blockDev)
Exemplo n.º 11
0
 def test_migrate_from_block_to_network(self):
     conf = drive_config(path='/blockdomain/volume')
     drive = Drive(self.log, **conf)
     self.assertTrue(drive.blockDev)
     # Migrate drive to network disk...
     drive.path = "pool/volume"
     drive.diskType = DISK_TYPE.NETWORK
     self.assertFalse(drive.blockDev)
Exemplo n.º 12
0
 def test_migrate_from_block_to_file(self):
     conf = drive_config(path='/blockdomain/volume')
     drive = Drive(self.log, **conf)
     self.assertTrue(drive.blockDev)
     # Migrate drive to file domain...
     utils.isBlockDevice = lambda path: False
     drive.path = "/filedomain/volume"
     self.assertFalse(drive.blockDev)
Exemplo n.º 13
0
 def test_migrate_network_to_block(self):
     conf = drive_config(diskType=DISK_TYPE.NETWORK, path='pool/volume')
     drive = Drive(self.log, **conf)
     self.assertTrue(drive.networkDev)
     # Migrate drive to block domain...
     drive.path = '/blockdomain/volume'
     drive.diskType = None
     self.assertTrue(drive.blockDev)
Exemplo n.º 14
0
 def test_migrate_from_block_to_network(self):
     conf = drive_config(path='/blockdomain/volume')
     drive = Drive(self.log, **conf)
     self.assertTrue(drive.blockDev)
     # Migrate drive to network disk...
     drive.path = "pool/volume"
     drive.diskType = DISK_TYPE.NETWORK
     self.assertFalse(drive.blockDev)
Exemplo n.º 15
0
 def test_migrate_from_block_to_file(self):
     conf = drive_config(path='/blockdomain/volume')
     drive = Drive(self.log, **conf)
     self.assertTrue(drive.blockDev)
     # Migrate drive to file domain...
     utils.isBlockDevice = lambda path: False
     drive.path = "/filedomain/volume"
     self.assertFalse(drive.blockDev)