Esempio n. 1
0
 def __init__(self, path, disk_type: DiskType, serial_number, block_size):
     Device.__init__(self, path)
     self.serial_number = serial_number
     self.block_size = Unit(block_size)
     self.disk_type = disk_type
     self.partition_table = None
     self.partitions = []  # TODO: Create partitions discover method
Esempio n. 2
0
 def __init__(
     self,
     path,
     disk_type: DiskType,
     serial_number,
     block_size,
 ):
     Device.__init__(self, path)
     self.serial_number = serial_number
     self.block_size = Unit(block_size)
     self.disk_type = disk_type
     self.partitions = []
Esempio n. 3
0
 def __init__(
     self,
     path,
     disk_type: DiskType,
     serial_number,
     block_size,
 ):
     Device.__init__(self, path)
     path = fs_utils.readlink(path)
     self.device_name = path.split('/')[-1]
     self.serial_number = serial_number
     self.block_size = Unit(block_size)
     self.disk_type = disk_type
     self.partitions = []
Esempio n. 4
0
    def __init__(
        self,
        path,
        disk_type: DiskType,
        serial_number,
        block_size,
        part_table_type: PartitionTable = PartitionTable.gpt,
    ):
        Device.__init__(self, path)
        self.serial_number = serial_number
        self.block_size = Unit(block_size)
        self.disk_type = disk_type
        self.partitions = []
        self.umount_all_partitions()
        if not disk_utils.create_partition_table(self, part_table_type):
            raise Exception("Failed to create partition")

        self.partition_table = part_table_type
def get_first_partition_offset(device, aligned: bool):
    if aligned:
        return Size(1, Unit.MebiByte)
    # 33 sectors are reserved for the backup GPT
    return Size(34, Unit(device.blocksize)) \
        if device.partition_table == PartitionTable.gpt else Size(1, device.blocksize)
Esempio n. 6
0
from time import sleep
import pytest

from core.test_run import TestRun
from test_tools.fio.fio import Fio
from test_tools.fio.fio_param import IoEngine, ReadWrite
from test_utils.size import Size, Unit
from utils.iotrace import IotracePlugin

"""
If you're running this test on HDD, change size limits to few and few dozens MiB,
otherwise you'll be waiting for completion very long time. Also raise test timeout - for tracings 
based on trace file size limit.
"""
runtime_short = timedelta(seconds=20)
size_limit_low = Size(1, Unit(Unit.GibiByte))
runtime_long = timedelta(hours=2)
size_limit_high = Size(20, Unit(Unit.GibiByte))

test_timeout = int(timedelta(minutes=30).total_seconds())
fio_runtime = timedelta(hours=48)


def test_iotracer_limits():
    """
        title: Check if io-tracer respects its own tracing limits .
        description: |
          Check if io-tracer respects the time limit and the trace file size limit
          set with start command and finishes tracing when one of two limits is reached.
        pass_criteria:
          - No system crash.
Esempio n. 7
0
 def block_size(self):
     if not self.__block_size:
         self.__block_size = Unit(
             int(self.get_sysfs_property("logical_block_size")))
     return self.__block_size