|
17 | 17 | # implied. See the License for the specific language governing |
18 | 18 | # permissions and limitations under the License. |
19 | 19 |
|
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 | +""" |
26 | 36 |
|
27 | 37 | import pexpect |
28 | 38 | from Exceptions import * |
29 | 39 | import OpTestSystem |
30 | 40 |
|
| 41 | + |
31 | 42 | class spawn(pexpect.spawn): |
32 | 43 | def __init__(self, command, args=[], timeout=30, maxread=2000, |
33 | 44 | searchwindowsize=None, logfile=None, cwd=None, env=None, |
|
0 commit comments