예제 #1
0
 def test_disk_type_unset(self):
     with namedTemporaryDir() as tmpdir:
         path = os.path.join(tmpdir, "vol")
         open(path, "w").close()
         conf = drive_config(format="cow", path=path)
         drive = Drive(self.log, **conf)
         self.assertFalse(drive.needs_monitoring(events_enabled=True))
예제 #2
0
파일: vmstorage_test.py 프로젝트: nirs/vdsm
 def test_no_need_replica_not_chunked(self):
     conf = drive_config(diskType=DISK_TYPE.FILE, format="cow")
     drive = Drive(self.log, **conf)
     drive.diskReplicate = replica(DISK_TYPE.FILE, format="cow")
     self.assertFalse(drive.needs_monitoring(events_enabled=False))
예제 #3
0
파일: vmstorage_test.py 프로젝트: nirs/vdsm
 def test_no_need_monitoring_disabled(self):
     conf = drive_config(diskType=DISK_TYPE.BLOCK, format="cow")
     drive = Drive(self.log, **conf)
     drive.monitorable = False
     self.assertFalse(drive.needs_monitoring(events_enabled=False))
예제 #4
0
파일: vmstorage_test.py 프로젝트: nirs/vdsm
 def test_no_need_readonly(self):
     conf = drive_config(diskType=DISK_TYPE.BLOCK, format="cow",
                         readonly=True)
     drive = Drive(self.log, **conf)
     self.assertFalse(drive.needs_monitoring(events_enabled=False))
예제 #5
0
 def test_need_replica_chunked_threshold_exceeded(self):
     conf = drive_config(diskType=DISK_TYPE.FILE, format="cow")
     drive = Drive(self.log, **conf)
     drive.diskReplicate = replica(DISK_TYPE.BLOCK, format="cow")
     drive.threshold_state = BLOCK_THRESHOLD.EXCEEDED
     assert drive.needs_monitoring(events_enabled=True)
예제 #6
0
 def test_need_replica_chunked_threshold_unset(self):
     conf = drive_config(diskType=DISK_TYPE.FILE, format="cow")
     drive = Drive(self.log, **conf)
     drive.diskReplicate = replica(DISK_TYPE.BLOCK, format="cow")
     assert drive.needs_monitoring(events_enabled=True)
예제 #7
0
 def test_need_chunked_threshold_unset(self):
     conf = drive_config(diskType=DISK_TYPE.BLOCK, format="cow")
     drive = Drive(self.log, **conf)
     assert drive.needs_monitoring()
예제 #8
0
파일: vmstorage_test.py 프로젝트: nirs/vdsm
 def test_need_replica_chunked_threshold_unset(self):
     conf = drive_config(diskType=DISK_TYPE.FILE, format="cow")
     drive = Drive(self.log, **conf)
     drive.diskReplicate = replica(DISK_TYPE.BLOCK, format="cow")
     self.assertTrue(drive.needs_monitoring(events_enabled=True))
예제 #9
0
 def test_no_need_replica_not_chunked(self):
     conf = drive_config(diskType=DISK_TYPE.FILE, format="cow")
     drive = Drive(self.log, **conf)
     drive.diskReplicate = replica(DISK_TYPE.FILE, format="cow")
     assert not drive.needs_monitoring(events_enabled=False)
예제 #10
0
 def test_no_need_readonly(self):
     conf = drive_config(diskType=DISK_TYPE.BLOCK,
                         format="cow",
                         readonly=True)
     drive = Drive(self.log, **conf)
     assert not drive.needs_monitoring(events_enabled=False)
예제 #11
0
 def test_need_chunked_threshold_unset(self):
     conf = drive_config(diskType=DISK_TYPE.BLOCK, format="cow")
     drive = Drive(self.log, **conf)
     self.assertTrue(drive.needs_monitoring(events_enabled=True))
예제 #12
0
 def test_no_need_not_chunked(self):
     conf = drive_config(diskType=DISK_TYPE.FILE, format="cow")
     drive = Drive(self.log, **conf)
     self.assertFalse(drive.needs_monitoring(events_enabled=False))
예제 #13
0
 def test_no_need_monitoring_disabled(self):
     conf = drive_config(diskType=DISK_TYPE.BLOCK, format="cow")
     drive = Drive(self.log, **conf)
     drive.monitorable = False
     self.assertFalse(drive.needs_monitoring(events_enabled=False))
예제 #14
0
 def test_need_chunked_threshold_exceeded(self):
     conf = drive_config(diskType=DISK_TYPE.BLOCK, format="cow")
     drive = Drive(self.log, **conf)
     drive.threshold_state = BLOCK_THRESHOLD.EXCEEDED
     assert drive.needs_monitoring()
예제 #15
0
파일: vmstorage_test.py 프로젝트: nirs/vdsm
 def test_need_chunked(self):
     conf = drive_config(diskType=DISK_TYPE.BLOCK, format="cow")
     drive = Drive(self.log, **conf)
     self.assertTrue(drive.needs_monitoring(events_enabled=False))
예제 #16
0
 def test_need_chunked(self):
     conf = drive_config(diskType=DISK_TYPE.BLOCK, format="cow")
     drive = Drive(self.log, **conf)
     assert drive.needs_monitoring(events_enabled=False)
예제 #17
0
파일: vmstorage_test.py 프로젝트: nirs/vdsm
 def test_no_need_chunked_threshold_set(self):
     conf = drive_config(diskType=DISK_TYPE.BLOCK, format="cow")
     drive = Drive(self.log, **conf)
     drive.threshold_state = BLOCK_THRESHOLD.SET
     self.assertFalse(drive.needs_monitoring(events_enabled=True))
예제 #18
0
 def test_no_need_chunked_threshold_set(self):
     conf = drive_config(diskType=DISK_TYPE.BLOCK, format="cow")
     drive = Drive(self.log, **conf)
     drive.threshold_state = BLOCK_THRESHOLD.SET
     assert not drive.needs_monitoring(events_enabled=True)
예제 #19
0
파일: vmstorage_test.py 프로젝트: nirs/vdsm
 def test_need_replica_chunked_threshold_exceeded(self):
     conf = drive_config(diskType=DISK_TYPE.FILE, format="cow")
     drive = Drive(self.log, **conf)
     drive.diskReplicate = replica(DISK_TYPE.BLOCK, format="cow")
     drive.threshold_state = BLOCK_THRESHOLD.EXCEEDED
     self.assertTrue(drive.needs_monitoring(events_enabled=True))
예제 #20
0
 def test_no_need_replica_chunked_threshold_set(self):
     conf = drive_config(diskType=DISK_TYPE.FILE, format="cow")
     drive = Drive(self.log, **conf)
     drive.diskReplicate = replica(DISK_TYPE.BLOCK, format="cow")
     drive.threshold_state = BLOCK_THRESHOLD.SET
     assert not drive.needs_monitoring()