nfstest.utils - Man Page

Utilities module

Description

Definition for common classes and constants

Classes

class SparseFile(baseobj.BaseObj)

SparseFile object

SparseFile() -> New sparse file object

Usage:
    # Create definition for a sparse file of size 10000 having
    # two holes of size 1000 at offsets 3000 and 6000
    x = SparseFile("/mnt/t/file1", 10000, [3000, 6000], 1000)

    # Object attributes defined after creation using the above
    # sample data:

    # endhole: set to True if the file ends with a hole
    # Above example ends with data so,
    # x.endhole = False

    # data_offsets: list of data segment offsets
    # x.data_offsets = [0, 4000, 7000]

    # hole_offsets: list of hole segment offsets including the
    #   implicit hole at the end of the file
    # x.hole_offsets = [3000, 6000, 10000]

    # sparse_data: list of data/hole segments, each item in the list
    #   has the following format [offset, size, type]
    # x.sparse_data = [[0, 3000, 1], [3000, 1000, 0], [4000, 2000, 1],
    #                  [6000, 1000, 0], [7000, 3000, 1]]


Methods defined here:
---------------------

__init__(self, absfile, file_size, hole_list, hole_size)
Create sparse file object definition, the file is not created
just the object. Object attributes are defined which makes it
easy to create the actual file.

        absfile:
    Absolute path name of file
        file_size:
    Total size of sparse file
        hole_list:
    List of hole offsets
        hole_size:
    Size for each hole

Functions

split_path(path)
Return list of components in path

See Also

baseobj(3)

Bugs

No known bugs.

Author

Jorge Mora (mora@netapp.com)

Referenced By

nfstest_alloc(1), nfstest.nfs_util(3), nfstest_sparse(1), nfstest.test_util(3).

21 March 2023 NFStest 3.2 utils 1.0