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 InduceErrInRecords (recList)
 
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
 
 random_system = random.SystemRandom()
 
string header = b'33011ca5e511de77'
 
string footer = b'33f007e7f007e777'
 
dictionary typeDict
 
dictionary recordDict
 
list AllRecordList
 
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 
)
Method to extract cob related data.

Definition at line 354 of file error_injection.py.

Here is the caller graph for this function:

◆ ConvertCobAdstob()

def error_injection.ConvertCobAdstob (   cob_f_container,
  cob_f_key 
)
Method take cob_f_cotainer, cob_f_key and returns stob_f_container, stob_f_key.

Definition at line 369 of file error_injection.py.

◆ CorruptEmap()

def error_injection.CorruptEmap (   recordType,
  stob_f_container,
  stob_f_key 
)
Method corrupts EMAP record specified by Cob ID.

Definition at line 381 of file error_injection.py.

Here is the call graph for this function:

◆ EditMetadata()

def error_injection.EditMetadata (   offset)
Edit metadata with the fixed pattern of 0x1111222244443333.

Definition at line 173 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 ( )
Corrupt 512k Metadata in Metadata file from random location.

Definition at line 329 of file error_injection.py.

Here is the call graph for this function:

◆ InduceCorruption()

def error_injection.InduceCorruption (   recordType,
  noOfErr 
)
Induces Corruption in a record with number of error.

Definition at line 224 of file error_injection.py.

Here is the call graph for this function:

◆ InduceErrInRecords()

def error_injection.InduceErrInRecords (   recList)
Function which induces error in a particular type of record.

Definition at line 282 of file error_injection.py.

Here is the call graph for this function:

◆ InduceHugeError()

def error_injection.InduceHugeError ( )
Corrupt Metadata file from random location till end of metadata file.

Definition at line 308 of file error_injection.py.

Here is the call graph for this function:

◆ InduceRandomCorruption()

def error_injection.InduceRandomCorruption (   noOfErr)
Induces corruption in meta data at random offset.

Definition at line 254 of file error_injection.py.

Here is the call graph for this function:

◆ ListAllEmapPerDevice()

def error_injection.ListAllEmapPerDevice ( )

Definition at line 417 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 458 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)
Reads BeNode data.

Definition at line 209 of file error_injection.py.

Here is the caller graph for this function:

◆ ReadCompleteRecord()

def error_injection.ReadCompleteRecord (   offset)
Function read complete record starting after header and until footer for record.

Definition at line 194 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)
Verifies that meta-data contains the valid footer at the given offset.

Definition at line 184 of file error_injection.py.

Here is the caller graph for this function:

◆ ReadTypeSize()

def error_injection.ReadTypeSize (   byte)

Definition at line 165 of file error_injection.py.

Here is the caller graph for this function:

◆ RecordOffset()

def error_injection.RecordOffset (   record,
  i,
  size 
)

Definition at line 155 of file error_injection.py.

Here is the caller graph for this function:

◆ VerifyLengthOfRecord()

def error_injection.VerifyLengthOfRecord (   recordDict)

Definition at line 448 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.

◆ AllRecordList

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

Definition at line 138 of file error_injection.py.

◆ args

args = parser.parse_args()

Definition at line 81 of file error_injection.py.

◆ BeBnodeTypeKeys

dictionary BeBnodeTypeKeys = {}

Definition at line 153 of file error_injection.py.

◆ btreeType

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

Definition at line 146 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 520 of file error_injection.py.

◆ cob_f_key

cob_f_key = hex(int(_f_key, 16))

Definition at line 521 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 142 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 100 of file error_injection.py.

◆ float

float

Definition at line 69 of file error_injection.py.

◆ footer

string footer = b'33f007e7f007e777'

Definition at line 121 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',
2  'STOB_AD_DOMAIN', 'COB_DOMAIN', 'CAS_STATE', 'CAS_CTG']

Definition at line 143 of file error_injection.py.

◆ header

string header = b'33011ca5e511de77'

Definition at line 119 of file error_injection.py.

◆ help

help

Definition at line 50 of file error_injection.py.

◆ int

int

Definition at line 51 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 102 of file error_injection.py.

◆ noOfErrs

def noOfErrs = 0

Definition at line 492 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.

◆ random_system

random_system = random.SystemRandom()

Definition at line 112 of file error_injection.py.

◆ recordDict

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

Definition at line 132 of file error_injection.py.

◆ recordType

recordType = args.Record_Type

Definition at line 101 of file error_injection.py.

◆ results

results = parser.parse_args()

Definition at line 83 of file error_injection.py.

◆ seed

seed = args.seed

Definition at line 105 of file error_injection.py.

◆ stob_f_container

stob_f_container

Definition at line 522 of file error_injection.py.

◆ stob_f_key

stob_f_key

Definition at line 522 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 51 of file error_injection.py.

◆ typeDict

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

Definition at line 123 of file error_injection.py.