def test_create_symlink_for_seg(self): """ [feature]: Creates a symlink to the data directory for a given segment """ newfault = Fault() seginfo = newfault.get_seginfo(preferred_role='m', content=1) newfault.create_remote_symlink(seginfo.getSegmentHostName(), seginfo.getSegmentDataDirectory()) tinctest.logger.info('Creating symlink for seg %s on host %s' % (seginfo.getSegmentDataDirectory(), seginfo.getSegmentHostName()))
def test_corrupt_persistent_tables(self): """ [feature]: corrupts PT tables for segment that has been marked down """ newfault = Fault() seginfo = newfault.get_seginfo(preferred_role='p', content=1) pt = PTTestCase('corrupt_persistent_table') pt.corrupt_persistent_table(seginfo.getSegmentHostName(), seginfo.getSegmentPort()) tinctest.logger.info('Finished corruption of PT tables')
def test_remove_symlink_for_seg(self): """ [feature]: Remove symlink for datadirectory and restore the orignal directory for a given segment. """ newfault = Fault() seginfo = newfault.get_seginfo(preferred_role='m', content=1) newfault.remove_remote_symlink(seginfo.getSegmentHostName(), seginfo.getSegmentDataDirectory()) tinctest.logger.info('Removed symlinks for seg %s on host %s' % (seginfo.getSegmentDataDirectory(), seginfo.getSegmentHostName()))
def test_shared_mem_is_cleaned(self): """ [feature]: Check if the shared memory is cleaned """ newfault = Fault() seginfo = newfault.get_seginfo(preferred_role='p',content=0) cmd = Command('check for shared memory', cmdStr="ipcs -a", ctxt=REMOTE, remoteHost=seginfo.getSegmentHostName()) cmd.run(validateAfter=True) result = cmd.get_results().stdout.split('\n') for r in result: if r and r.split()[-1] == '0': raise Exception('Shared memory not cleaned up for %s' % r)
def test_use_gpfaultinjector_to_mark_segment_down(self): """ [feature]: Use gpfaultinjector to mark a segment down in the configuration, but the process is still running on the segment. """ newfault = Fault() seginfo = newfault.get_seginfo(preferred_role='m', content=1) newfault.inject_using_gpfaultinjector(fault_name='filerep_consumer', fault_mode='async', fault_type='fault', segdbid=seginfo.getSegmentDbId()) rtrycnt = 0 while (not newfault.is_changetracking()): tinctest.logger.info("Waiting [%s] for DB to go into CT mode" % rtrycnt) rtrycnt += 1