Package: troubleshooting-framework
Introduction:TroubleShooting Framework is a generic open source test-analysis-fix automation framework for troubleshooting.
TroubleShooting Framework is operating system and application independent. The core framework is implemented using Python, supports Python 2.6 and Python 2.7, and run also on Jython,IronPython and Pypy.
TroubleShooting Framework project is hosted on GitHub where you can find source code, an issue tracker, and some further documentation.InstallationIf you already havePythonwithPIPinstalled,you can simply run:pip install troubleshooting-frameworkAlternatively you can get TroubleShooting Framework source code by downloading the source
distribution from PyPI and extracting it, or by cloning the project repository
from GitHub. After that you can install the framework with:python setup.py installA benefit of using pip is that it automatically installs paramiko and PyCrypto modules that troubleshooting-framework requires on Python. Using pip on Windows with Python works too, but you need to first install PyCrypto module manually.Development:1. Create a projectyou can simply run:pytsmgr --operation=startProject --project=<MyProject> --directory=<ProjectDirectory>2. Add a keywordnew a <keywordName>.py file in <ProjectDirectory>/<MyProject>/keywords folder:from troubleshooting.framework.template._BaseKeyword import _BaseKeywordclass keywordName(_BaseKeyword):def __init__(self):super(,self).__init__()def getExample(self):return “example”3. Add a testpointnew a <testPointName>.py file in <ProjectDirectory>/<MyProject>/testpoint folder:from framework.variable.variable import STATUS,LEVELfrom troubleshooting.framework.template._BaseTestPoint import _BaseTestPointclass testPointName(_BaseTestPoint):def __init__(self):super(self.__class__,self).__init__()self.level = LEVLE.CRITICALdef _checkpoint(self):result = self.getExample()if result is “example”:self.status = STATUS.PASSelse:self.status = STATUS.FAIL
self.IMPACT.append(“system is not working”)
self.RCA.append(“Bad luck”)
self.FIXSTEP.append(“bathing”)
self.FIXSTEP.append(“say hello god!”)Note:self.statusis mandatory, it’s enum type , value isSTATUS.PASSorSTATUS.FAILNote:self.levelis option, it’s enum type , value isLEVLE.CRITICALorLEVLE.NOCRITICAL, default isLEVLE.NOCRITICALNote:self.IMPACT,self.RCAandself.FIXSTEPis option, it’s list type.4. Add a casenew a <caseName>.py file in <ProjectDirectory>/<MyProject>/case folder:from troubleshooting.framework.template._BaseCase import _BaseCaseclass caseName(_BaseCase):“””
To Check linux disk usage.
“””def __init__(self):super(caseName,self).__init__()self.passCondition = “{testPointName} is True”self.tags = “example goodcase”Note:self.passConditionis mandatory, it’s condition of case pass.Note:self.tagsis option, it’s a string and fragment by space.Usage:Switch folder to  <ProjectDirectory>/<MyProject>/ , you can simple run:pyts --host=192.168.10.10  --user=root --password=root  --include=exampleANDsmoke --exclude=NoRunORdisableSupport And Contact:zeus.gao@foxmail.comLicenseTroubleShooting Framework is open source software provided under the Apache License 2.0. TroubleShooting Framework documentation and other similar content use the Creative Commons Attribution 3.0 Unported license. Most libraries and tools in the ecosystem are also open source, but they may use different licenses.
^