Motr  M0
error_injection Namespace Reference

Functions

def RecordOffset (record, i, size)
 
def ReadTypeSize (byte)
 
def EditMetadata (offset)
 
def ReadMetadata (offset)
 
def ReadCompleteRecord (offset)
 
def ReadBeBNode (offset)
 
def InduceCorruption (recordType, noOfErr)
 
def InduceRandomCorruption (noOfErr)
 
def InduceErrInAllRecord ()
 
def InduceErrInGMDRecords ()
 
def InduceErrInDMDRecords ()
 
def InduceHugeError ()
 
def Induce512kbError ()
 
def ConvertAdstob2Cob (stob_f_container, stob_f_key)
 
def ConvertCobAdstob (cob_f_container, cob_f_key)
 
def CorruptEmap (recordType, stob_f_container, stob_f_key)
 
def ListAllEmapPerDevice ()
 
def VerifyLengthOfRecord (recordDict)
 
def read_metadata_file ()
 

Variables

 timestr = time.strftime("%Y%m%d-%H%M%S")
 
string log_filename = "hole_creation_" + timestr + ".log"
 
 logger = logging.getLogger()
 
 fh = logging.FileHandler(log_filename)
 
 ch = logging.StreamHandler()
 
 fformatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
 
 cformatter = logging.Formatter('%(levelname)s : %(message)s')
 
 parser = argparse.ArgumentParser(description="Basic Arguments to run the script")
 
 action
 
 default
 
 False
 
 dest
 
 help
 
 type
 
 int
 
 float
 
 args = parser.parse_args()
 
 results = parser.parse_args()
 
 filename = args.mfile
 
 recordType = args.Record_Type
 
 noOfErr = args.noOfErr
 
 seed = args.seed
 
string header = b'33011ca5e511de77'
 
string footer = b'33f007e7f007e777'
 
dictionary typeDict
 
dictionary recordDict
 
dictionary sizeDict
 
list DMDList = ['BE_BNODE', 'BE_EMAP_KEY', 'BE_EMAP_REC', 'COB_NSREC', 'BALLOC_GROUP_DESC']
 
list GMDList
 
dictionary btreeType
 
dictionary BeBnodeTypeKeys = {}
 
int noOfErrs = 0
 
 cob_f_container = hex(int(_f_container, 16))
 
 cob_f_key = hex(int(_f_key, 16))
 
 stob_f_container
 
 stob_f_key
 

Function Documentation

◆ ConvertAdstob2Cob()

def error_injection.ConvertAdstob2Cob (   stob_f_container,
  stob_f_key 
)

Definition at line 384 of file error_injection.py.

Here is the caller graph for this function:

◆ ConvertCobAdstob()

def error_injection.ConvertCobAdstob (   cob_f_container,
  cob_f_key 
)

Definition at line 398 of file error_injection.py.

◆ CorruptEmap()

def error_injection.CorruptEmap (   recordType,
  stob_f_container,
  stob_f_key 
)

Definition at line 409 of file error_injection.py.

Here is the call graph for this function:

◆ EditMetadata()

def error_injection.EditMetadata (   offset)

Definition at line 169 of file error_injection.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Induce512kbError()

def error_injection.Induce512kbError ( )

Definition at line 360 of file error_injection.py.

Here is the call graph for this function:

◆ InduceCorruption()

def error_injection.InduceCorruption (   recordType,
  noOfErr 
)

Definition at line 216 of file error_injection.py.

Here is the call graph for this function:

◆ InduceErrInAllRecord()

def error_injection.InduceErrInAllRecord ( )

Definition at line 269 of file error_injection.py.

Here is the call graph for this function:

◆ InduceErrInDMDRecords()

def error_injection.InduceErrInDMDRecords ( )

Definition at line 315 of file error_injection.py.

Here is the call graph for this function:

◆ InduceErrInGMDRecords()

def error_injection.InduceErrInGMDRecords ( )

Definition at line 292 of file error_injection.py.

Here is the call graph for this function:

◆ InduceHugeError()

def error_injection.InduceHugeError ( )

Definition at line 339 of file error_injection.py.

Here is the call graph for this function:

◆ InduceRandomCorruption()

def error_injection.InduceRandomCorruption (   noOfErr)

Definition at line 244 of file error_injection.py.

Here is the call graph for this function:

◆ ListAllEmapPerDevice()

def error_injection.ListAllEmapPerDevice ( )

Definition at line 434 of file error_injection.py.

Here is the call graph for this function:

◆ read_metadata_file()

def error_injection.read_metadata_file ( )

Definition at line 467 of file error_injection.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadBeBNode()

def error_injection.ReadBeBNode (   offset)

Definition at line 203 of file error_injection.py.

Here is the caller graph for this function:

◆ ReadCompleteRecord()

def error_injection.ReadCompleteRecord (   offset)

Definition at line 190 of file error_injection.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadMetadata()

def error_injection.ReadMetadata (   offset)

Definition at line 179 of file error_injection.py.

Here is the caller graph for this function:

◆ ReadTypeSize()

def error_injection.ReadTypeSize (   byte)

Definition at line 161 of file error_injection.py.

Here is the caller graph for this function:

◆ RecordOffset()

def error_injection.RecordOffset (   record,
  i,
  size 
)

Definition at line 149 of file error_injection.py.

Here is the caller graph for this function:

◆ VerifyLengthOfRecord()

def error_injection.VerifyLengthOfRecord (   recordDict)

Definition at line 457 of file error_injection.py.

Here is the call graph for this function:

Variable Documentation

◆ action

Definition at line 49 of file error_injection.py.

◆ args

args = parser.parse_args()

Definition at line 77 of file error_injection.py.

◆ BeBnodeTypeKeys

dictionary BeBnodeTypeKeys = {}

Definition at line 147 of file error_injection.py.

◆ btreeType

dictionary btreeType
Initial value:
1 = {b'01': 'M0_BBT_INVALID', b'02': 'M0_BBT_BALLOC_GROUP_EXTENTS', b'03': 'M0_BBT_BALLOC_GROUP_DESC', b'04': 'M0_BBT_EMAP_EM_MAPPING',
2  b'05': 'M0_BBT_CAS_CTG', b'06': 'M0_BBT_COB_NAMESPACE', b'07': 'M0_BBT_COB_OBJECT_INDEX', b'08': 'M0_BBT_COB_FILEATTR_BASIC',
3  b'09': 'M0_BBT_COB_FILEATTR_EA', b'0a': 'M0_BBT_COB_FILEATTR_OMG', b'0b': 'M0_BBT_CONFDB', b'0c': 'M0_BBT_UT_KV_OPS', b'0d': 'M0_BBT_NR'}

Definition at line 143 of file error_injection.py.

◆ cformatter

cformatter = logging.Formatter('%(levelname)s : %(message)s')

Definition at line 40 of file error_injection.py.

◆ ch

ch = logging.StreamHandler()

Definition at line 37 of file error_injection.py.

◆ cob_f_container

cob_f_container = hex(int(_f_container, 16))

Definition at line 529 of file error_injection.py.

◆ cob_f_key

cob_f_key = hex(int(_f_key, 16))

Definition at line 530 of file error_injection.py.

◆ default

default

Definition at line 49 of file error_injection.py.

◆ dest

dest

Definition at line 49 of file error_injection.py.

◆ DMDList

list DMDList = ['BE_BNODE', 'BE_EMAP_KEY', 'BE_EMAP_REC', 'COB_NSREC', 'BALLOC_GROUP_DESC']

Definition at line 139 of file error_injection.py.

◆ False

False

Definition at line 49 of file error_injection.py.

◆ fformatter

fformatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')

Definition at line 39 of file error_injection.py.

◆ fh

fh = logging.FileHandler(log_filename)

Definition at line 34 of file error_injection.py.

◆ filename

filename = args.mfile

Definition at line 96 of file error_injection.py.

◆ float

float

Definition at line 67 of file error_injection.py.

◆ footer

string footer = b'33f007e7f007e777'

Definition at line 116 of file error_injection.py.

◆ GMDList

list GMDList
Initial value:
1 = ['BE_BTREE', 'BE_EMAP', 'BE_LIST', 'BE_SEG_HDR', 'BALLOC', 'STOB_AD_0TYPE_REC', 'STOB_AD_DOMAIN',
2  'COB_DOMAIN', 'CAS_STATE', 'CAS_CTG']

Definition at line 140 of file error_injection.py.

◆ header

string header = b'33011ca5e511de77'

Definition at line 114 of file error_injection.py.

◆ help

help

Definition at line 49 of file error_injection.py.

◆ int

int

Definition at line 50 of file error_injection.py.

◆ log_filename

string log_filename = "hole_creation_" + timestr + ".log"

Definition at line 29 of file error_injection.py.

◆ logger

logger = logging.getLogger()

Definition at line 31 of file error_injection.py.

◆ noOfErr

noOfErr = args.noOfErr

Definition at line 98 of file error_injection.py.

◆ noOfErrs

def noOfErrs = 0

Definition at line 501 of file error_injection.py.

◆ parser

parser = argparse.ArgumentParser(description="Basic Arguments to run the script")

Definition at line 48 of file error_injection.py.

◆ recordDict

dictionary recordDict
Initial value:
1 = {'BE_BTREE': [], 'BE_BNODE': [], 'BE_EMAP_KEY': [], 'BE_EMAP_REC': [], 'BE_EMAP': [], 'BE_LIST': [],
2  'BE_SEG_HDR': [], 'BALLOC': [],
3  'STOB_AD_0TYPE_REC': [], 'STOB_AD_DOMAIN': [], 'COB_DOMAIN': [], 'COB_NSREC': [], 'BALLOC_GROUP_DESC': [],
4  'EXT': [], 'POOLNODE': [],
5  'POOLDEV': [], 'POOL_SPARE_USAGE': [], 'CAS_STATE': [], 'CAS_CTG': [], 'EXTRA': []}

Definition at line 127 of file error_injection.py.

◆ recordType

recordType = args.Record_Type

Definition at line 97 of file error_injection.py.

◆ results

results = parser.parse_args()

Definition at line 79 of file error_injection.py.

◆ seed

seed = args.seed

Definition at line 101 of file error_injection.py.

◆ sizeDict

dictionary sizeDict
Initial value:
1 = {'BE_BTREE': [], 'BE_BNODE': [], 'BE_EMAP_KEY': [], 'BE_EMAP_REC': [], 'BE_EMAP': [], 'BE_LIST': [],
2  'BE_SEG_HDR': [], 'BALLOC': [],
3  'STOB_AD_0TYPE_REC': [], 'STOB_AD_DOMAIN': [], 'COB_DOMAIN': [], 'COB_NSREC': [], 'BALLOC_GROUP_DESC': [],
4  'EXT': [], 'POOLNODE': [],
5  'POOLDEV': [], 'POOL_SPARE_USAGE': [], 'CAS_STATE': [], 'CAS_CTG': [], 'EXTRA': []}

Definition at line 133 of file error_injection.py.

◆ stob_f_container

stob_f_container

Definition at line 531 of file error_injection.py.

◆ stob_f_key

stob_f_key

Definition at line 531 of file error_injection.py.

◆ timestr

timestr = time.strftime("%Y%m%d-%H%M%S")

Definition at line 28 of file error_injection.py.

◆ type

type

Definition at line 50 of file error_injection.py.

◆ typeDict

dictionary typeDict
Initial value:
1 = {b'01': 'RPC_PACKET', b'02': 'RPC_ITEM', b'03': 'BE_BTREE', b'04': 'BE_BNODE', b'05': 'BE_EMAP_KEY',
2  b'06': 'BE_EMAP_REC',
3  b'07': 'BE_EMAP', b'08': 'BE_LIST', b'09': 'BE_SEG_HDR', b'0a': 'BALLOC', b'0b': 'ADDB2_FRAME_HEADER',
4  b'0c': 'STOB_AD_0TYPE_REC',
5  b'0d': 'STOB_AD_DOMAIN', b'0e': 'COB_DOMAIN', b'0f': 'COB_NSREC', b'10': 'BALLOC_GROUP_DESC', b'11': 'EXT',
6  b'12': 'CAS_INDEX',
7  b'13': 'POOLNODE', b'14': 'POOLDEV', b'15': 'POOL_SPARE_USAGE', b'16': 'CAS_STATE', b'17': 'CAS_CTG',
8  b'22': 'WRONG_ENTRY', b'44': 'WRONG_ENTRY'}

Definition at line 118 of file error_injection.py.