Skip to content

Commit 23a6681

Browse files
committed
doc: Better document OPexpect
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
1 parent dda3b0b commit 23a6681

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

common/OPexpect.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,28 @@
1717
# implied. See the License for the specific language governing
1818
# permissions and limitations under the License.
1919

20-
#
21-
# OPexpect
22-
# A wrapper around pexpect, but expects a bunch of common failures
23-
# so that each expect call doesn't have to watch out for them.
24-
# Things like OPAL asserts, kernel crashes, RCU stalls etc.
25-
#
20+
"""
21+
The OPexpect module is a wrapper around the standard Python pexpect module
22+
that will *always* look for certain error conditions for OpenPOWER machines.
23+
24+
This is to enable op-test test cases to fail *quickly* in the event of errors
25+
such as kernel panics, RCU stalls, machine checks, firmware crashes etc.
26+
27+
In the event of error, the failure_callback function will be called, which
28+
typically will be set up to set the machine state to UNKNOWN, so that when
29+
the next test starts executing, we re-IPL the system to get back to a clean
30+
slate.
31+
32+
When developing test cases, use OPexpect over pexpect. If you *intend* for
33+
certain error conditions to occur, you can catch the exceptions that OPexpect
34+
throws.
35+
"""
2636

2737
import pexpect
2838
from Exceptions import *
2939
import OpTestSystem
3040

41+
3142
class spawn(pexpect.spawn):
3243
def __init__(self, command, args=[], timeout=30, maxread=2000,
3344
searchwindowsize=None, logfile=None, cwd=None, env=None,

0 commit comments

Comments
 (0)