http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/globe.vt ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/globe.vt b/tools/bin/pythonSrc/pexpect-4.2/tests/globe.vt new file mode 100644 index 0000000..85dc78d --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/globe.vt @@ -0,0 +1,690 @@ +[H[J _-o#&&*''''?d:>b\_ + _o/"`'' '',, dMF9MMMMMHo_ + .o&#' `"MbHMMMMMMMMMMMHo. + .o"" ' vodM*$&&HMMMMMMMMMM?. + ,' $M&ood,~'`(&##MMMMMMH\ + / ,MMMMMMM#b?#bobMMMMHMMML + & ?MMMMMMMMMMMMMMMMM7MMM$R*Hk + ?$. :MMMMMMMMMMMMMMMMMMM/HMMM|`*L +| |MMMMMMMMMMMMMMMMMMMMbMH' T, +$H#: `*MMMMMMMMMMMMMMMMMMMMb#}' `? +]MMH# ""*""""*#MMMMMMMMMMMMM' - +MMMMMb_ |MMMMMMMMMMMP' : +HMMMMMMMHo `MMMMMMMMMT . +?MMMMMMMMP 9MMMMMMMM} - +-?MMMMMMM |MMMMMMMMM?,d- ' + :|MMMMMM- `MMMMMMMT .M|. : + .9MMM[ &MMMMM*' `' . + :9MMk `MMM#" - + &M} ` .- + `&. . + `~, . ./ + . _ .- + '`--._,dd###pp=""' +[H _v->#H#P? "':o<>\_ + .,dP` `'' "'-o.+H6&MMMHo_ + oHMH9' `?&bHMHMMMMMMHo. + oMP"' ' ooMP*#&HMMMMMMM?. + ,M* - `*MSdob//`^&##MMMH\ + d*' .,MMMMMMH#o>#ooMMMMMb + HM- :HMMMMMMMMMMMMMMM&HM[R\ + d"Z\. 9MMMMMMMMMMMMMMMMM[HMM|: +-H - MMMMMMMMMMMMMMMMMMMbMP' : +:??Mb# `9MMMMMMMMMMMMMMMMMMH#! . +: MMMMH#, "*""""`#HMMMMMMMMMMH - +||MMMMMM6\. {MMMMMMMMMH' : +:|MMMMMMMMMMHo `9MMMMMMMM' . +. HMMMMMMMMMMP' !MMMMMMMM ` +- `#MMMMMMMMM HMMMMMMM*,/ : + : ?MMMMMMMF HMMMMMM',P' : + . HMMMMR' {MMMMP' ^' - + : `HMMMT iMMH' .' + -.`HMH . + -:*H . ' + -`\,, . .- + ' . _ .-` + '`~\.__,obb#q==~''' +[H .ovr:HMM#?:`' >b\_ + .,:&Hi' `' "' \\|&bSMHo_ + oHMMM#*} `?&dMMMMMMHo. + .dMMMH"'''' ,oHH*&&9MMMM?. + ,MMM*' `*M\bd<|"*&#MH\ + dHH?' :MMMMMM#bd#odMML + H' |\ `dMMMMMMMMMMMMMM9Mk + JL/"7+,. `MMMMMMMMMMMMMMMH9ML +-`Hp ' |MMMMMMMMMMMMMMMMHH|: +: \\#M#d? `HMMMMMMMMMMMMMMMMH. +. JMMMMM##, ``*""'"*#MMMMMMMMH +-. ,MMMMMMMM6o_ |MMMMMMMM': +: |MMMMMMMMMMMMMb\ TMMMMMMT : +. ?MMMMMMMMMMMMM' :MMMMMM|.` +- ?HMMMMMMMMMM: HMMMMMM\|: + : 9MMMMMMMMH' `MMMMMP.P. + . `MMMMMMT'' HMMM*''- + - TMMMMM' MM*' - + '. HMM# - + -. `9M: .' + -. `b,, . . ' + '-\ ., .-` + '-:b~\\_,oddq==--" +[H _oo##'9MMHb':'-,o_ + .oH":HH$' ""' "' -\7*R&o_ + .oHMMMHMH#9: "\bMMMMHo. + dMMMMMM*""'`' .oHM"H9MM?. + ,MMMMMM' "HLbd<|?&H\ + JMMH#H' |MMMMM#b>bHb + :MH ."\ `|MMMMMMMMMMMM& + .:M:d-"|:b.. 9MMMMMMMMMMMMM+ +: "*H| - &MMMMMMMMMMMMMH: +. `LvdHH#d? `?MMMMMMMMMMMMMb +: iMMMMMMH#b `"*"'"#HMMMMMM +. . ,MMMMMMMMMMb\. {MMMMMH +- |MMMMMMMMMMMMMMHb, `MMMMM| +: |MMMMMMMMMMMMMMH' &MMMM, +- `#MMMMMMMMMMMM |MMMM6- + : `MMMMMMMMMM+ ]MMMT/ + . `MMMMMMMP" HMM*` + - |MMMMMH' ,M#'- + '. :MMMH| .- + . |MM - + ` . `#?.. . ..' + -. _. .- + '-|.#qo__,,ob=~~-'' +[H _ooppH[`MMMD::--\_ + _oHMR":&M&. ""' "' /&\\_ + oHMMMMMHMMH#9, `"<MMHo. + oHMMMMMMMM*""'`` .dMP#M?. + .dMMMMMMMM* `H\do?&\ + -iMMMHH#H' &MMMHb#? + : ZMM' 7-. `{MMMMMMMMH + . .M6_d|"`$|v.. 9MMMMMMMMML +- `'*H# : |MMMMMMMMMM: +: *\\dHM#dd. ?MMMMMMMMMb +- |MMMMMMM##\ `"*""?HMMM +: . |MMMMMMMMMMMo\. {MMM +. {MMMMMMMMMMMMMMMHo. `MMM +- ?MMMMMMMMMMMMMMM*' -MMP +: `#MMMMMMMMMMMMT dMM' + - |MMMMMMMMMMH' -MMT + : `MMMMMMMM"' JMP + - MMMMMMH' ,H? + '. HMMM#' : + . ?MM- . ' + -. *M:.. .- + - . _. .- + '-.~-dHb__\ov+~~-` +[H .oo>#&H6?*MMH:-.._ + .oHMMMR:"&MZ\ `"' " |$-_ + ..dMMMMMMMMdMMM#9\ `'HHo. + . ,dMMMMMMMMMMM"`' ` ?MP?. + . |MMMMMMMMMMM' `"$b&\ + - |MMMMHH##M' HMMH? + - TTMM| >.. \MMMMMH + : |MM\,#-""$~b\. `MMMMMM+ +. ``"H&# - &MMMMMM| +: *\v,#MHddc. `9MMMMMb +. MMMMMMMM##\ `"":HM +- . .HMMMMMMMMMMRo_. |M +: |MMMMMMMMMMMMMMMM#\ :M +- `HMMMMMMMMMMMMMMM' |T +: `*HMMMMMMMMMMMM' H' + : MMMMMMMMMMM| |T + . MMMMMMMM?' ./ + `. MMMMMMH' ./ + -. |MMMH#' . + . `MM* . ' + -. #M: . . .- + ` . ., .- + '-.-~ooHH__,,v~--` +[H _ood>H&H&Z?#M#b-\. + .\HMMMMMR?`\M6b."`' ''``v. + .. .MMMMMMMMMMHMMM#&. ``~o. + . ,HMMMMMMMMMMMM*"'-` &b. + . .MMMMMMMMMMMMH' `"&\ + - RMMMMM#H##R' 4Mb + - |7MMM' ?:: `|MMb + / HMM__#|`"\>?v.. `MMML +. `"'#Hd| ` 9MMM: +- |\,\?HH#bbL `9MMb +: !MMMMMMMH#b, `""T +. . ,MMMMMMMMMMMbo. | +: 4MMMMMMMMMMMMMMMHo | +: ?MMMMMMMMMMMMMMM? : +-. `#MMMMMMMMMMMM: .- + : |MMMMMMMMMM? . + - JMMMMMMMT' : + `. MMMMMMH' - + -. |MMM#*` - + . HMH' . ' + -. #H:. .- + ` . .\ .- + '-..-+oodHL_,--/-` +[H _,\?dZkMHF&$*q#b.. + .//9MMMMMMM?:'HM\\"`-''`.. + ..` :MMMMMMMMMMHMMMMH?_ `-\ + . .dMMMMMMMMMMMMMM'"'" `\. + . |MMMMMMMMMMMMMR \\ + - T9MMMMMHH##M" `? + : (9MMM' !':. &k + .: HMM\_?p "":-b\. `ML +- "'"H&#, : |M| +: ?\,\dMH#b#. 9b +: |MMMMMMM##, `* +: . +MMMMMMMMMMMo_ - +: HMMMMMMMMMMMMMM#, : +: 9MMMMMMMMMMMMMH' . +: . *HMMMMMMMMMMP .' + : MMMMMMMMMH' . + - :MMMMMMM'` . + `. 9MMMMM*' - + -. {MMM#' : + - |MM" .' + `. &M'.. . ..' + ' . ._ .- + '-. -voboo#&:,-.-` +[H _oo:\bk99M[<$$+b\. + .$*"MMMMMMMM[:"\Mb\?^" . + . '` HMMMMMMMMMMHMMMM+?. `. + . .HMMMMMMMMMMMMMMP"'' . + . `MMMMMMMMMMMMMM| -`. + - `&MMMMMMHH##H: : + : `(*MMM} `|\ | + : `- ?MMb__#|""`|+v.. \ +. `''*H#b - :| +: `*\v,#M#b#, \ +. 9MMMMMMHb. : +: . #MMMMMMMMMb\ - +- .HMMMMMMMMMMMMb : +: `MMMMMMMMMMMMH . +-: . `#MMMMMMMMMP ' + : ]MMMMMMMH' : + - ,MMMMMM?' . + `: HMMMMH" - + -. .HMM#* .- + `. .HH*' . + `-. &R". .- + -. ._ .- + '-. .voodoodc?..-` +[H _\oo\?ddk9MRbS>v\_ + ..:>*""MMMMMMMMM:?|H?$?-. + ..- - "HMMMMMMMMMMHMMMH\_-. + . dMMMMMMMMMMMMMMT" . + . TMMMMMMMMMMMMMM `. + - `&HMMMMMM#H#H: . + - `\7HMMH |\. . + : ` HMM\_?c`""+?\.. : +- "``#&#| . - +: `?,\#MHdb. . +: |MMMMMH#. : +: . ,HMMMMMMMb, - +: ' 4MMMMMMMMMMH` +: . 9MMMMMMMMMT- +:.` `#MMMMMMMH ' + : ' HMMMMMH': + - |MMMMH" - + `: |MMMH*' .' + '? dMM#' . + \. .dH" .' + -. ,M'- ..' + ` . .. ..-` + '-. .\ooooboo<^.-` +[H _o,:o?\?dM&MHcc~,. + ..^':&#""HMMMMMMMM$:?&&?. + .` -` 'HMMMMMMMMMHMMMp\. + . ' |MMMMMMMMMMMMMM"' . + . `9MMMMMMMMMMMMM -. + - `*9MMMMMHH##[ . + - `\Z9MMM `~\ . + : '| ?MMb_?p""-?v.. : +- `"'*&#, - . +: `?,oHH#? . +-- |MMMMH,: +: . |MMMMMM6, +: - |MMMMMMMM +? HMMMMMMP +-- . ' |HMMMMM' + :.` . ' JMMMM+ + \ ,MMMP: + : |MMH?: + -:\. dM#" . + \ ,H*' .' + -. d':..' + ` . .,.- + '-.. .\oooodov~^-` +[H _o\:,??\??MR9#cb\_ + .v/''':&#""#HMMMMMMM$?*d\. + ..~' - -` `"#MMMMMMMMMMMHv. + .-' HMMMMMMMMMMMR!. + : `9MMMMMMMMMMM| -. + . `*9MMMMMH##| . + - `(#MMH `:, . + : '| `HMb_>/"|\,.: +.' `"'#&b - . +: ?\oHH?. +: !MMM& +: . . HMMMM +/. - -MMMMM +\`. 9MMMP +:. . . - |MMM' + \... ' .MMT + &. .dMP + \, .HM* + \. `\. ,H&' + `- `| - ,&': + `. ,/\ ' + '-.. _.- + "---.._\o,oov+--'" +[H _,d?,:?o?:?HM>#b\_ + ..H*"''`'H#*"**MMMMMM6$$v_ + v//" - `` `'#MMMMMMMMHo. + /"` |MMMMMMMMMM:. + ,> `HMMMMMMMMH:. + : `#HMMMMHH\ - + ' `Z#MM, `,: + : '\ ?HH_>:`\, +: "'*&| `: +. <\Hb +: MM +: . iMM +Mb\. {MM +::.`- - !MP +`&. . . - :M' + 9H, \ ' |T + HM? ,P + *ML ?? + :&. `o .d' + ': |T /" + -. .<'' + `... ..- + "`-=.,_,,,oov-~.-` +[H _,oc>?_:b?o?HH#b\_ + .v/99*""" '*H#""*HMMMMMZ,_ + oH* /" - ' "`#MMMMM#o. + ./*>- `MMMMMMMb + ,b/' `#MMMMMMM\ + :' ``HMMMMb: + /- `|&MH `\ + / `-. |Hb??\ +,- ' "`&,. +1 \} +!. T +$,. . 1 +?`M??. M +?.::| '\ - ? + M?&. . . - ,' + 9MMH\ .. ' ` . + HMMM#. :' + 9#MMb .. + -:"# `b. .- + . ` {! / + - ,-' + ' . .- + ```^==\_.,,,ov--\-` +[H _\o##??,:io??$#b\_ + .oH#"H9*""" "`#H*"*#MMMHo_ + oHMM- -' - '' ``*HMMHo. + dM#S>-` ?MMMM?. + ,&&,/' "#MMMH\ + d?-" `*HMMb + H? "ZHb: + /: \ H?L +|:| . `*: +:?: \ +>" : +M|\,_ | +!|":HH?-'. : +:^'_:?"\ `-- - . +- |ML?b . .. - - + :HMMMMH\ \ ` : + >MMMMMM#. . + ^M*HMMM| - + `. `"#+ `?v .` + . `- +?' - + ` . ..' + - . .- + "`\b=p?.._\\vv---` +[H _,o#bH\??::?o?cbo_ + .o#MH#**SH""' "`*H#"*#MHo_ + oHMMMH^ ^" - ` '*HHo. + .dMMM#">>- `HM?. + ,MH:R_o/ `*MH\ + dMM' ' "ML + HMR! ' `#k + d&'. -. `L +:M :: ` `- +/| !| - +k.$-" : +}9R:!,,_. . +\::\':`*M#\-'. - +: "''..:"!`\ '- - ` +- ,HMb.H| . _ - .' + : ,MMMMMMMb. .. . + .`HMMMMMMMM? . + `.`9M#*HMMMM : + -.' "##* `b, . + . ` ,/' .' + ` . ..' + - . ..- + "`*#d##c.._\v----` +[H _,o#&oHb?\o::d?>\_ + .oHHMMM#**$M""` "`*HH"#&o_ + oHMMMMMMD' .'' - ' ``bo. + .dMMMMMH*'/|- `\b. + ,MMMM?T|_o/ `\\ + dMMMMP '' `| + HMMMH& - `\ + /MH7' : -- : +-:MM {. . . +:i?' .!& . +:{, o| ' : +-T?9M\:-'o,_ . +: \?::``"`?9MHo./.. - +. '"`'^ _.`"!"^. `- - ` +- ,bMM?.M\ . . - . .' + : .oMMMMMMMMb. .. ` . + . `HMMMMMMMMMMb - + - 9MH*#HMMMMH .' + '. ' `"*##' `b. : + . ` .d'' .' + -. . ' + -. .-` + "`*##H###:._\--.-` +[H _oo#H&d#b?\b:_>>\_ + .oHMMMMMMH*"*9R"'-``*#P\-_ + oHMMMMMMMMM$ ." ' `^- + .dMMMMMMMMH*",?- '\. + ,MMMMMMM:?}.,d' `. + dMMMMMMMH /'' : + HMMMMMMM&' - - + dPTMMP>' : -. : +|? -MM} .\ . +J' ::*' -$L . +: ?b .,H- ' : +- |6.&MP:: !.,_. - +: `\:: "' "`:"MM#,-^, - : +- ````:' _.:"?``\ `- . +: .?bMML.]# - _ ` . .' + - .o#MMMMMMMMH\ \. . . + - `HMMMMMMMMMMMH : + `. `HMM#*#MMMMMH' - + -. ' ``##*' i+ : + - `' v/' .' + `- ..' + ' . .- + "`*##HMH##:__,-.-` +[H _oo##Mbb&bo??o_>\_ + .oHMMMMMMMMM**#?M*' "?*&.. + oHMMMMMMMMMMMM4 `" - `. + .dMMMMMMMMMMMM#"\?.- . + ,MMMMMMMMMM}"9:_,d' -. + dMMMMMMMMMMM| ^'' . + &MMMMMMMMMMH\ - . + :{M*"MMMPT"' : `-. : +.'M' 'MMM. -T, . . +- k i:?'' -|& . +: ` -o& .,H- " : +- `M:`HMP|:'!.o._. . +: "<:::'<^ '"``9MH#,-^ . - +- '''``''._.`"?`^| ^ - : +: ?#dMM_.M? . . - ..' + : ,ddMMMMMMMMMb. .. ' . + . TMMMMMMMMMMMMM, : + - ?MMH**#MMMMMH' : + '. ' "`##*' &. : + -. `' ,~" .' + -. ..' + ` . .- + ```*##HMMMH#<:,..-` +[H _,dd#HMb&dHo?\?:\_ + .oHMMMMMMMMMMMH***9P'`"\v. + oHMMMMMMMMMMMMMMM> `' -. + .dMMMMMMMMMMMMMMMH*'|~-' . + ,MMMMMMMMMMMMM6>`H._,& -. + dMMMMMMMMMMMMMMM| `" . + H*MMMMMMMMMMMMMH&. - . + d' HMM""&MMMPT'' :. `.- +,' MP `TMMM, |: . - +| #: ? *" : &L : +! `' /?H ,#r `' : +. ?M: HMM^<~->,o._ : +: `9:::'`*-``':`9MHb,|-, ' : +. `"''':' :_ ""!"^. `| : +`. _dbHM6_|H. . . ' .' + \ _odHMMMMMMMMH, .. ` : + `- |MMMMMMMMMMMMM| : + `. 9MMH**#MMMMMH' : + -. ' "?##" d : + . ' ,/" .' + `.. ..' + ` . .- + '`"#HHMMMMM#<>..-` +[H _oo##bHMb&d#bd,>\_ + .oHMMMMMMMMMMMMMM***9R"-.. + oHMMMMMMMMMMMMMMMMMH\ ? `-. + .dMMMMMMMMMMMMMMMMMMM#".}-' . + ,MMMMMMMMMMMMMMMMM6/`H _o} -. + dMMMMMMMMMMMMMMMMMMML `'' . + HbP*HMMMMMMMMMMMMMMM*: - , + dMH' `MMMP'"HMMMR'T" : : +|H' -MR' `?MMMb P, . . +1& *| |.`*" .-`&| . +M' " |\&| .,#~ "' : +T :HL.|HMH\c~`|v,\_ : +| `"|:::':`-`` '"MM#\-'. -: +% ``'``'`' :_ '?'`| ``. : +||, ,#dMM?.M? . .` - + ?\ .,odMMMMMMMMM? \ ` : + / |MMMMMMMMMMMMM: .' + `. TMMH#*9MMMMM* : + -. ` "*#*' ,: . + . ` .v'' .' + `. ..' + '- . .- + "`\+HHMMMMMMHr~.-` +[H _,,>#b&HMHd&&bb>\_ + _oHMMMMMMMMMMMMMMMMH**H:. + oHMMMMMMMMMMMMMMMMMMMM#v`? `. + .dMMMMMMMMMMMMMMMMMMMMMMH*`+| . + ,MMMMMMMMMMMMMMMMMMMMMb|?+.,H -. + ddHMMMMMMMMMMMMMMMMMMMMMb `' . + HMMkZ**HMMMMMMMMMMMMMMMMH\ - . : + dTMMM* `9MMMP'"*MMMMPT"` .. : +|M6H'' 4MP' `"HMMM| !|. . . +1MHp' #L $ *"' .-:&. . +MMM' " q:H. .o#-``' : +MM' ?H?.|MMH::::-o,_. - +M[ `*?:::'|` `"`:9MH\~-. ` +&M. ""'`'^'.:.`?'`. '| -: +`M|d, .dbHM[.1? .. : + 9||| . _obMMMMMMMMH, . : + H.^ MMMMMMMMMMMM} - + \ |MMH#*HMMMMH' .' + . ` `#*' ,:- + ` '' .-'. + `. .- + '- . .-` + '`\bqHMMMMMMHHb--` +[H .,:,#&6dHHHb&##o\_ + .oHHMMMMMMMMMMMMMMMMMH*\,. + oHMMMMMMMMMMMMMMMMMMMMMMHb:'-. + .dMMMMMMMMMMMMMMMMMMMMMMMMMH|\/' . + ,&HMMMMMMMMMMMMMMMMMMMMMMM/"&.,d. -. + dboMMHMMMMMMMMMMMMMMMMMMMMMML `' . + HMHMMM$Z***MMMMMMMMMMMMMMMMMM|.- . + dMM}MMMM#' `9MMMH?"`MMMMR'T' _ : +|MMMbM#'' |MM" ``MMMH. <_ . +dMMMM#& *&. .?`*" .'&: . +MMMMMH- `' -v/H .dD "' ' : +MMMM* `*M: 4MM*::-!v,_ : +MMMM `*?::" "'``"?9Mb::. : +&MMM, `"'"'|"._ "?`| - : +`MMM}.H ,#dM[_H ..: + 9MMi`M: . .ooHMMMMMMM, .. + 9Mb `- 1MMMMMMMMMM| : + ?M |MM#*#MMMM* . + -. ` |#"' ,' + . -" v` + -. .- + - . . ` + '-*#d#HHMMMMHH#"-' +[H _,<_:&S6dHHHb&bb\_ + .odHMMMMMMMMMMMMMMMMMMM}-_ + .oHMMMMMMMMMMMMMMMMMMMMMMMM#d:. + ?9MMMMMMMMMMMMMMMMMMMMMMMMMMMH-$ . + ,::dHMMMMMMMMMMMMMMMMMMMMMMMMH:\.?? -. + dMdboHMMHMMMMMMMMMMMMMMMMMMMMMMH, ' . + HMMMM7MMMb$R***MMMMMMMMMMMMMMMMMH\ - . + dMMMMM/MMMMM* `$MMMM*'"*MMMM?&' . : +|MMMMMMb1H*' HMP' '9MMM| &. . . +dMMMMMMM##~` `#\ |.`*" .-9. : +9MMMMMMMM* ` |v7? .,H `' ` : +SMMMMMMH' '9M_-MMH::-\v_ : +:HMMMMM `\_:"'|'`':9Mv\. +-|MMMMM, ""`'`':.`?\ \ +`:MMMMM}.d} .?bM6,| | + :?MMM6 M| . .,oHMMMMM| / + .?MMM- `' &MMMMMMMM|. + -`HM- HMH#*MMM?: + '. ' `#*:` + - -'/ + ` . . ' + ` . . ` + '--##HH#HMMMHH#""` +[H _o,d_?dZdoHHHb#b\_ + .vdMMMMMMMMMMMMMMMMMMMMH\. + .,HHMMMMMMMMMMMMMMMMMMMMMMMMH&,. + /?RMMMMMMMMMMMMMMMMMMMMMMMMMMMMH|.. + ,\?>`T#RMMMMMMMMMMMMMMMMMMMMMMMM6`\|/ + dMMbd#ooHMMMHMMMMMMMMMMMMMMMMMMMMMH,`' ' + HMMMMMMMTMMMMb$ZP**HMMMMMMMMMMMMMMMM|. : + dMMMMMMMM}$MMMMMH' `HMMMH?"`MMMM?T' . : +|MMMMMMMMMMoMH*'' `MM? ``MMM| +\ . +1MMMMMMMMMMMb#/ ?#? |`#" -T: : +*'HMMMMMMMMMM*' " ~?& .?} ' ' . +- 4MMMMMMMMP" `M? HMTc:\\.: +: `MMMMMMM[ "#:::`>`"?M{ +. |MMMMMMH. ``'``'_`:- +- |MMMMMMM|.dD ,#Mb\' + : *MMMMM: iM| . _oHMMMM: + . ?MMMM' "' ,MMMMMMP + : `HMH JM#*MMT + -. ' ` #' + . / + -. - .' + -. . ` + '--=&&MH##HMHH#""" +[H .-:?,Z?:&$dHH##b\_ + ,:bqRMMMMMMMMMMMMMMMMMHo. + .?HHHMMMMMMMMMMMMMMMMMMMMMMMHo. + -o/*M9MMMMMMMMMMMMMMMMMMMMMMMMMMMv + .:H\b\'|?#HHMMMMMMMMMMMMMMMMMMMMMM6?Z\ + .?MMMHbdbbodMMMMHMMMMMMMMMMMMMMMMMMMM\': + :MMMMMMMMMMM7MMMMb?6P**#MMMMMMMMMMMMMMM_ : + \MMMMMMMMMMMMb^MMMMMM? `*MMMM*"`MMMR<' . - +.1MMMMMMMMMMMMMb]M#"" 9MR' `?MMb \. : +-MMMMMMMMMMMMMMMH##|` *&. |`*' .\ . +-?""*MMMMMMMMMMMMM' ' |?b ,}" : +: MMMMMMMMMMH' `M_|M}r\? +. `MMMMMMMMM' `$_:`'"H +- TMMMMMMMM, '"``:: +: {MMMMMMMM| oH| .#M- + : `9MMMMMM' .MP . ,oMMT + . HMMMMP' `' ,MMMP + - `MMH' HH9* + '. ` ` .' + - . ' + ` . - .- + ` . .- + ' -==pHMMH##HH#""" +[H _..-:b&::&?&&##bo_ + ...?-#&9MMMMMMMMMMMMMMMHo_ + .. .1&#MMHMMMMMMMMMMMMMMMMMMMHo. + . .o/##R9MMMMMMMMMMMMMMMMMMMMMMMM?. + .- |MSd?|'`$?#HMMMMMMMMMMMMMMMMMMMMMH\ + - dMMMMHbd##oodMMMM#MMMMMMMMMMMMMMMMMH: + - JMMMMMMMMMMMMM7HMMMH$SR***MMMMMMMMMMMMb> + : {MMMMMMMMMMMMMMM`9MMMMMH' ``HMMM?"*MM[| : +- |MMMMMMMMMMMMMMMMM<MH*'' `MM' 'HM? |. +: `MMMMMMMMMMMMMMMMMM##H-' `#, ` |`? /| +. ?"""?HMMMMMMMMMMMMMH' " v& .}? +- |MMMMMMMMMMMP' `H:&H& +i `9MMMMMMMMMT `|?"? +: MMMMMMMMMH "`\ +: MMMMMMMMMH-.dH ,| + : ?MMMMMMM? {M' . .dT + . ?MMMMMR' `' ,MP + - `HMM#' .&* + '. ' `. + - . ' + `.. .- + -. .- + '-.==p##HMMHp&#""" +[H _v---:?&?:?&?&#b\_ + ..' i: #M$MMMMMMMMMMMMMHo_ + .. -]M#HMHMMMMMMMMMMMMMMMMMHo. + . ooP*&6&MMMMMMMMMMMMMMMMMMMMM?. + . - &Rbbd-/`?:##HMMMMMMMMMMMMMMMMMH? + - ,HMMMMM#od#boodMMMMHMMMMMMMMMMMMMMb + - iMMMMMMMMMMMMMMM[*MMMH&$R***MMMMMMMMMb + : |MMMMMMMMMMMMMMMMML"MMMMMM' ``MMMP"HMM: +. HMMMMMMMMMMMMMMMMMMb/MH"" `MR *M,| +: TMMMMMMMMMMMMMMMMMMMMd#&` `D. ?|\ +. `*"'"*HMMMMMMMMMMMMMMP' ' -d,J +: |MMMMMMMMMMMMP' ||M +M, ?MMMMMMMMMM| `\? +&| HMMMMMMMMM} `` +`L .MMMMMMMMMMP ,d| : + *. ?MMMMMMMF' .MP / + | TMMMMMM' `"' / + `. `MMMP' ./ + -. ` . + . . ' + - . .- + -\ ..- + '-..=p####HMH&=""" +[H _vo~^'':&b::d,#b\_ + ..`" `:v +9P]MMMMMMMMMMHo_ + ,- ?Mb#MMMMMMMMMMMMMMMMMHo. + . " ,ooM*&&&HMMMMMMMMMMMMMMMMHb. + . - 99Soo?|'`*?##HMMMMMMMMMMMMMH\ + - .HMMMMMM#od#boodMMMMHMMMMMMMMMMb + - :MMMMMMMMMMMMMMMM67HMMH&$R**HMMMMMb + : .MMMMMMMMMMMMMMMMMMM/HMMMMM| `9MM'HL +: {MMMMMMMMMMMMMMMMMMMM\MM*'' `H[ `9| +| `HMMMMMMMMMMMMMMMMMMMMb##| `F. :? +H `"*"'"`#MMMMMMMMMMMMMMM? ' k +M. MMMMMMMMMMMMM"' H +MMH. `HMMMMMMMMMM: | +&MM| `MMMMMMMMMM, - +`MM| dMMMMMMMMMM|.oH : + 9ML `HMMMMMMM? dH' - + Hi |MMMMMMP "' .' + T. `MMM#' - + `. ` .` + ` - + `.. . ..' + ... .- + '-. //######M#b~"" +[H _ooq=""''$b$_&?b\_ + .-`^" "'o |&M:MMMMMMMMHo_ + o/' -$Mb#MMMMMMMMMMMMMMHo. + /' .ooHP*&R&MMMMMMMMMMMMMM?. + .' `MRbod?|'`+?##9MMMMMMMMMH\ + .` .,MMMMMMH#od##obdMMMMHMMMMMMb + - ?MMMMMMMMMMMMMMMMM$HMMH$ZP*HMMb + ? |MMMMMMMMMMMMMMMMMMM|9MMMMP "M6\ +.- dMMMMMMMMMMMMMMMMMMMMb]M*' |R | +1| `HMMMMMMMMMMMMMMMMMMMMMd#| ?,: +MH, ``*""'"*#MMMMMMMMMMMMMM* '` +MM6_ |MMMMMMMMMMMMH" : +MMMMMb. "MMMMMMMMMMT - +&MMMMM' |MMMMMMMMMH ` +!MMMMb .HMMMMMMMMM+.?& : + TMMMM *MMMMMMMP dH' . : + 9MM' `MMMMMMP' "' . + 9ML `MMM#' - + `H ` : + `\. .' + `-\ . .- + ' ._ .-` + '-\. ,b#####p&**^`
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/interact.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/interact.py b/tools/bin/pythonSrc/pexpect-4.2/tests/interact.py new file mode 100755 index 0000000..a839e95 --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/interact.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +''' +PEXPECT LICENSE + + This license is approved by the OSI and FSF as GPL-compatible. + http://opensource.org/licenses/isc-license.txt + + Copyright (c) 2012, Noah Spurrier <[email protected]> + PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY + PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE + COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +''' +try: + # This allows coverage to measure code run in this process + import coverage + coverage.process_startup() +except ImportError: + pass + +from utils import no_coverage_env +import pexpect +import sys + + +def main(): + p = pexpect.spawn('{sys.executable} getch.py'.format(sys=sys), + env=no_coverage_env()) + + # defaults matches api + escape_character = chr(29) + encoding = None + + if len(sys.argv) > 1 and '--no-escape' in sys.argv: + escape_character = None + + if len(sys.argv) > 1 and '--utf8' in sys.argv: + encoding = 'utf8' + + p.interact(escape_character=escape_character) + + print("Escaped interact") + +if __name__ == '__main__': + main() http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/list100.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/list100.py b/tools/bin/pythonSrc/pexpect-4.2/tests/list100.py new file mode 100644 index 0000000..3b2b6ec --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/list100.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +print(list(range(100))) http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/needs_kill.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/needs_kill.py b/tools/bin/pythonSrc/pexpect-4.2/tests/needs_kill.py new file mode 100755 index 0000000..810236b --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/needs_kill.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python +"""This script can only be killed by SIGKILL.""" +import signal, time + +# Ignore interrupt, hangup and continue signals - only SIGKILL will work +signal.signal(signal.SIGINT, signal.SIG_IGN) +signal.signal(signal.SIGHUP, signal.SIG_IGN) +signal.signal(signal.SIGCONT, signal.SIG_IGN) + +print('READY') +while True: + time.sleep(10) + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/pexpectTest.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/pexpectTest.py b/tools/bin/pythonSrc/pexpect-4.2/tests/pexpectTest.py new file mode 100755 index 0000000..6839a2f --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/pexpectTest.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python +''' +PEXPECT LICENSE + + This license is approved by the OSI and FSF as GPL-compatible. + http://opensource.org/licenses/isc-license.txt + + Copyright (c) 2012, Noah Spurrier <[email protected]> + PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY + PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE + COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +''' + +import time +import pexpect +import sys + +def getProcessResults(cmd, timeLimit=20): + ''' + executes 'cmd' as a child process and returns the child's output, + the duration of execution, and the process exit status. Aborts if + child process does not generate output for 'timeLimit' seconds. + ''' + output = "" + startTime = time.time() + child = pexpect.spawn(cmd, timeout=10) + child.logfile = sys.stdout + + while 1: + try: + # read_nonblocking will add to 'outout' one byte at a time + # newlines can show up as '\r\n' so we kill any '\r's which + # will mess up the formatting for the viewer + output += child.read_nonblocking(timeout=timeLimit).replace("\r","") + except pexpect.EOF as e: + print(str(e)) + # process terminated normally + break + except pexpect.TIMEOUT as e: + print(str(e)) + output += "\nProcess aborted by FlashTest after %s seconds.\n" % timeLimit + print(child.isalive()) + child.kill(9) + break + + endTime = time.time() + child.close(force=True) + + duration = endTime - startTime + exitStatus = child.exitstatus + + return (output, duration, exitStatus) + +cmd = "./ticker.py" + +result, duration, exitStatus = getProcessResults(cmd) + +print("result: %s" % result) +print("duration: %s" % duration) +print("exit-status: %s" % exitStatus) + http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/CSIGNALTEST/test.c ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/CSIGNALTEST/test.c b/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/CSIGNALTEST/test.c new file mode 100644 index 0000000..86bcc17 --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/CSIGNALTEST/test.c @@ -0,0 +1,90 @@ +/* I built this with "gcc -lutil test.c -otest" */ +#include <sys/types.h> /* include this before any other sys headers */ +#include <sys/wait.h> /* header for waitpid() and various macros */ +#include <signal.h> /* header for signal functions */ +#include <stdio.h> /* header for fprintf() */ +#include <unistd.h> /* header for fork() */ +#ifdef LINUX +#include <pty.h> +#else +#include <util.h> /* header for forkpty, compile with -lutil */ +#endif + +void sig_chld(int); /* prototype for our SIGCHLD handler */ + +int main() +{ + struct sigaction act; + int pid; + int fdm; + char slave_name [20]; + + + /* Assign sig_chld as our SIGCHLD handler. + We don't want to block any other signals in this example + We're only interested in children that have terminated, not ones + which have been stopped (eg user pressing control-Z at terminal). + Finally, make these values effective. If we were writing a real + application, we would save the old value instead of passing NULL. + */ + act.sa_handler = sig_chld; + sigemptyset(&act.sa_mask); + act.sa_flags = SA_NOCLDSTOP; + if (sigaction(SIGCHLD, &act, NULL) < 0) + { + fprintf(stderr, "sigaction failed\n"); + return 1; + } + + /* Do the Fork thing. + */ + pid = forkpty (&fdm, slave_name, NULL, NULL); + /* pid = fork(); */ + + switch (pid) + { + case -1: + fprintf(stderr, "fork failed\n"); + return 1; + break; + + case 0: /* Child process. */ + printf ("This child output will cause trouble.\n"); + _exit(7); + break; + + default: /* Parent process. */ + sleep(1); + printf ("Child pid: %d\n", pid); + sleep(10); /* let child finish -- crappy way to avoid race. */ + break; + } + + return 0; +} + +void sig_chld(int signo) +{ + int status, wpid, child_val; + + printf ("In sig_chld signal handler.\n"); + + /* Wait for any child without blocking */ + wpid = waitpid (-1, & status, WNOHANG); + printf ("\tWaitpid found status for pid: %d\n", wpid); + if (wpid < 0) + { + fprintf(stderr, "\twaitpid failed\n"); + return; + } + printf("\tWaitpid status: %d\n", status); + + if (WIFEXITED(status)) /* did child exit normally? */ + { + child_val = WEXITSTATUS(status); + printf("\tchild exited normally with status %d\n", child_val); + } + printf ("End of sig_chld.\n"); +} + + http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/README ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/README b/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/README new file mode 100644 index 0000000..d50f94c --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/README @@ -0,0 +1,2 @@ +These scripts are for checking how the underlying system behaves, not for +testing Pexpect itself. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check.py b/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check.py new file mode 100755 index 0000000..b41755a --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python +import signal +import os +import time +import pty + +def signal_handler (signum, frame): + print 'Signal handler called with signal:', signum + print 'signal.SIGCHLD=', signal.SIGKILL + +# First thing we do is set up a handler for SIGCHLD. +signal.signal (signal.SIGCHLD, signal.SIG_IGN) + +print 'PART 1 -- Test signal handling with empty pipe.' +# Create a child process for us to kill. +try: + pid, fd = pty.fork() +except Exception as e: + print str(e) + +if pid == 0: +# os.write (sys.stdout.fileno(), 'This is a test.\n This is a test.') + time.sleep(10000) + +print 'Sending SIGKILL to child pid:', pid +os.kill (pid, signal.SIGKILL) + +# SIGCHLD should interrupt sleep. +# Note that this is a race. +# It is possible that the signal handler will get called +# before we try to sleep, but this has not happened yet. +# But in that case we can only tell by order of printed output. +print 'Entering sleep...' +try: + time.sleep(10) +except: + print 'sleep was interrupted by signal.' + +# Just for fun let's see if the process is alive. +try: + os.kill(pid, 0) + print 'Child is alive. This is ambiguous because it may be a Zombie.' +except OSError as e: + print 'Child appears to be dead.' + +print 'PART 2 -- Test signal handling with full pipe.' +# Create a child process for us to kill. +try: + pid, fd = pty.fork() +except Exception as e: + print str(e) + +if pid == 0: + os.write (sys.stdout.fileno(), 'This is a test.\n This is a test.') + time.sleep(10000) + +print 'Sending SIGKILL to child pid:', pid +os.kill (pid, signal.SIGKILL) + +# SIGCHLD should interrupt sleep. +# Note that this is a race. +# It is possible that the signal handler will get called +# before we try to sleep, but this has not happened yet. +# But in that case we can only tell by order of printed output. +print 'Entering sleep...' +try: + time.sleep(10) +except: + print 'sleep was interrupted by signal.' + +# Just for fun let's see if the process is alive. +try: + os.kill(pid, 0) + print 'Child is alive. This is ambiguous because it may be a Zombie.' +except OSError as e: + print 'Child appears to be dead.' + http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check2.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check2.py b/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check2.py new file mode 100755 index 0000000..0a7d5f8 --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check2.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python +import signal +import os +import time + +def signal_handler (signum, frame): + print 'Signal handler called with signal:', signum + print 'signal.SIGCHLD=', signal.SIGKILL + +# Create a child process for us to kill. +pid = os.fork() +if pid == 0: + time.sleep(10000) + +#signal.signal (signal.SIGCHLD, signal.SIG_IGN) +signal.signal (signal.SIGCHLD, signal_handler) + +print 'Sending SIGKILL to child pid:', pid +os.kill (pid, signal.SIGKILL) + +# SIGCHLD should interrupt sleep. +# Note that this is a race. +# It is possible that the signal handler will get called +# before we try to sleep, but this has not happened yet. +# But in that case we can only tell by order of printed output. +interrupted = 0 +try: + time.sleep(10) +except: + print 'sleep was interrupted by signal.' + interrupted = 1 + +if not interrupted: + print 'ERROR. Signal did not interrupt sleep.' +else: + print 'Signal interrupted sleep. This is good.' + +# Let's see if the process is alive. +try: + os.kill(pid, 0) + print 'Child is alive. This is ambiguous because it may be a Zombie.' +except OSError as e: + print 'Child appears to be dead.' + http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check_control_terminal.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check_control_terminal.py b/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check_control_terminal.py new file mode 100755 index 0000000..9598fd7 --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check_control_terminal.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +import termios, fcntl, struct, os, sys + +def getwinsize(): + s = struct.pack("HHHH", 0, 0, 0, 0) + x = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ, s) + rows, cols = struct.unpack("HHHH", x)[:2] + return rows, cols + +def setwinsize(r,c): + # Assume ws_xpixel and ws_ypixel are zero. + s = struct.pack("HHHH", r,c,0,0) + x = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCSWINSZ, s) +print 'stdin tty:', os.ttyname(0) +print 'stdout tty:', os.ttyname(1) +print 'controlling terminal:', os.ctermid() +print 'winsize %d,%d' % getwinsize() +print 'ENDTEST' http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check_handler.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check_handler.py b/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check_handler.py new file mode 100755 index 0000000..c0633eb --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check_handler.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python +import signal +import os +import time +import pty +import sys +import fcntl +import tty +GLOBAL_SIGCHLD_RECEIVED = 0 + +def nonblock (fd): + # if O_NDELAY is set read() returns 0 (ambiguous with EOF). + # if O_NONBLOCK is set read() returns -1 and sets errno to EAGAIN + original_flags = fcntl.fcntl (fd, fcntl.F_GETFL, 0) + flags = original_flags | os.O_NONBLOCK + fcntl.fcntl(fd, fcntl.F_SETFL, flags) + return original_flags + +def signal_handler (signum, frame): + print '<HANDLER>' + global GLOBAL_SIGCHLD_RECEIVED + status = os.waitpid (-1, os.WNOHANG) + if status[0] == 0: + print 'No process for waitpid:', status + else: + print 'Status:', status + print 'WIFEXITED(status):', os.WIFEXITED(status[1]) + print 'WEXITSTATUS(status):', os.WEXITSTATUS(status[1]) + GLOBAL_SIGCHLD_RECEIVED = 1 + +def main (): + signal.signal (signal.SIGCHLD, signal_handler) + pid, fd = pty.fork() + if pid == 0: + os.write (sys.stdout.fileno(), 'This is a test.\nThis is a test.') + time.sleep(10000) + nonblock (fd) + tty.setraw(fd) #STDIN_FILENO) + print 'Sending SIGKILL to child pid:', pid + time.sleep(2) + os.kill (pid, signal.SIGKILL) + + print 'Entering to sleep...' + try: + time.sleep(2) + except: + print 'Sleep interrupted' + try: + os.kill(pid, 0) + print '\tChild is alive. This is ambiguous because it may be a Zombie.' + except OSError as e: + print '\tChild appears to be dead.' +# print str(e) + print + print 'Reading from master fd:', os.read (fd, 1000) + + + +if __name__ == '__main__': + main () http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check_read.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check_read.py b/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check_read.py new file mode 100755 index 0000000..9598aa7 --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check_read.py @@ -0,0 +1,35 @@ +import os + +filename = os.tmpnam() +print 'filename:', filename + +fd_out = os.open(filename, os.O_CREAT | os.O_WRONLY) +print 'fd_out:', fd_out +os.write (fd_out, 'This is a test.\n') +os.close(fd_out) +print +print 'testing read on good fd...' +fd_in = os.open (filename, os.O_RDONLY) +print 'fd_in:', fd_in +while 1: + data_in = os.read(fd_in, 1) + print 'data_in:', data_in + if data_in == '': + print 'data_in was empty' + break #sys.exit(1) +os.close(fd_in) +print +print +print 'testing read on closed fd...' +fd_in = os.open ('test_read.py', os.O_RDONLY) +print 'fd_in:', fd_in +while 1: + data_in = os.read(fd_in, 1) + print 'data_in:', data_in + if data_in == '': + print 'data_in was empty' + break +os.close(fd_in) +d = os.read(fd_in, 1) # fd_in should be closed now... +if s == '': + print 'd is empty. good.' http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check_signals.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check_signals.py b/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check_signals.py new file mode 100755 index 0000000..d45bc8a --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/platform_checks/check_signals.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +import signal +import os +import time +import pty +import sys +GLOBAL_SIGCHLD_RECEIVED = 0 + +def signal_handler (signum, frame): + print '<HANDLER>' + global GLOBAL_SIGCHLD_RECEIVED + status = os.waitpid (-1, os.WNOHANG) + print 'WIFEXITED(status):', os.WIFEXITED(status) + print 'WEXITSTATUS(status):', os.WEXITSTATUS(status) + GLOBAL_SIGCHLD_RECEIVED = 1 + +def main (): +# sig_test ('SIG_IGN', 'ptyfork', 'yes') + sig_test ('handler', 'ptyfork', 'yes') +# sig_test ('SIG_IGN', 'ptyfork', 'no') +# sig_test ('handler', 'ptyfork', 'no') +# sig_test ('SIG_IGN', 'osfork', 'yes') +# sig_test ('handler', 'osfork', 'yes') +# sig_test ('SIG_IGN', 'osfork', 'no') +# sig_test ('handler', 'osfork', 'no') + +def sig_test (sig_handler_type, fork_type, child_output): + print 'Testing with:' + print '\tsig_handler_type:', sig_handler_type + print '\tfork_type:', fork_type + print '\tchild_output:', child_output + + if sig_handler_type == 'SIG_IGN': + signal.signal (signal.SIGCHLD, signal.SIG_IGN) + else: + signal.signal (signal.SIGCHLD, signal_handler) + pid = -1 + fd = -1 + if fork_type == 'ptyfork': + pid, fd = pty.fork() + else: + pid = os.fork() + + if pid == 0: + if child_output == 'yes': + os.write (sys.stdout.fileno(), 'This is a test.\nThis is a test.') + time.sleep(10000) + + #print 'Sending SIGKILL to child pid:', pid + time.sleep(2) + os.kill (pid, signal.SIGKILL) + + #print 'Entering to sleep...' + try: + time.sleep(2) + except: + pass + try: + os.kill(pid, 0) + print '\tChild is alive. This is ambiguous because it may be a Zombie.' + except OSError as e: + print '\tChild appears to be dead.' +# print str(e) + print + +if __name__ == '__main__': + main () http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/qa.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/qa.py b/tools/bin/pythonSrc/pexpect-4.2/tests/qa.py new file mode 100755 index 0000000..f50e3ed --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/qa.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +''' +PEXPECT LICENSE + + This license is approved by the OSI and FSF as GPL-compatible. + http://opensource.org/licenses/isc-license.txt + + Copyright (c) 2012, Noah Spurrier <[email protected]> + PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY + PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE + COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +''' +import commands +import signal + +signal.signal(signal.SIGCHLD, signal.SIG_IGN) +print(commands.getoutput('/bin/ls -l')) + http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/sigwinch_report.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/sigwinch_report.py b/tools/bin/pythonSrc/pexpect-4.2/tests/sigwinch_report.py new file mode 100755 index 0000000..f10956a --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/sigwinch_report.py @@ -0,0 +1,50 @@ +''' +PEXPECT LICENSE + + This license is approved by the OSI and FSF as GPL-compatible. + http://opensource.org/licenses/isc-license.txt + + Copyright (c) 2012, Noah Spurrier <[email protected]> + PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY + PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE + COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +''' +from __future__ import print_function + +import signal, time, struct, fcntl, termios, sys + +def getwinsize(): + '''This returns the window size of the child tty. + The return value is a tuple of (rows, cols). + ''' + if 'TIOCGWINSZ' in dir(termios): + TIOCGWINSZ = termios.TIOCGWINSZ + else: + TIOCGWINSZ = 1074295912 # Assume + s = struct.pack('HHHH', 0, 0, 0, 0) + x = fcntl.ioctl(sys.stdout.fileno(), TIOCGWINSZ, s) + return struct.unpack('HHHH', x)[0:2] + +def handler(signum, frame): + print('signal') + sys.stdout.flush() + print('SIGWINCH:', getwinsize ()) + sys.stdout.flush() + +print("Initial Size:", getwinsize()) +print("setting handler for SIGWINCH") +signal.signal(signal.SIGWINCH, handler) +print("READY") + +while 1: + sys.stdout.flush() + time.sleep(1) + http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/sleep_for.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/sleep_for.py b/tools/bin/pythonSrc/pexpect-4.2/tests/sleep_for.py new file mode 100755 index 0000000..9027105 --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/sleep_for.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python +''' +PEXPECT LICENSE + + This license is approved by the OSI and FSF as GPL-compatible. + http://opensource.org/licenses/isc-license.txt + + Copyright (c) 2012, Noah Spurrier <[email protected]> + PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY + PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE + COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +''' + +from __future__ import print_function + +import time +import sys + +def main(): + """ + This script sleeps for the number of seconds (float) specified by the + command line argument. + """ + if len(sys.argv) < 2: + print("Usage: %s seconds_to_sleep" % (sys.argv[0],)) + sys.exit(1) + timeout = float(sys.argv[1]) + print("READY") + time.sleep(timeout) + print("END") + +if __name__ == '__main__': + main() http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/swapcase_echo.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/swapcase_echo.py b/tools/bin/pythonSrc/pexpect-4.2/tests/swapcase_echo.py new file mode 100755 index 0000000..aaac442 --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/swapcase_echo.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +''' +PEXPECT LICENSE + + This license is approved by the OSI and FSF as GPL-compatible. + http://opensource.org/licenses/isc-license.txt + + Copyright (c) 2012, Noah Spurrier <[email protected]> + PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY + PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE + COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +''' +import sys, time +while True: + x = raw_input () + time.sleep(1) # without this delay the test would fail about 75% of the time. Why? + print(x.swapcase()) + sys.stdout.flush() http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/test_FSM.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/test_FSM.py b/tools/bin/pythonSrc/pexpect-4.2/tests/test_FSM.py new file mode 100644 index 0000000..3425fd2 --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/test_FSM.py @@ -0,0 +1,34 @@ +import io +import sys +import unittest +try: + import builtins +except ImportError: + import __builtin__ as builtins + +PY3 = (sys.version_info[0] >= 3) +input_name = 'input' if PY3 else 'raw_input' + +from pexpect import FSM + +class FSMTestCase(unittest.TestCase): + def test_run_fsm(self): + def _input(prompt): + return "167 3 2 2 * * * 1 - =" + orig_input = getattr(builtins, input_name) + orig_stdout = sys.stdout + setattr(builtins, input_name, _input) + sys.stdout = sio = (io.StringIO if PY3 else io.BytesIO)() + + try: + FSM.main() + finally: + setattr(builtins, input_name, orig_input) + sys.stdout = orig_stdout + + printed = sio.getvalue() + assert '2003' in printed, printed + + +if __name__ == '__main__': + unittest.main() \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/test_ansi.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/test_ansi.py b/tools/bin/pythonSrc/pexpect-4.2/tests/test_ansi.py new file mode 100755 index 0000000..a9d445e --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/test_ansi.py @@ -0,0 +1,228 @@ +#!/usr/bin/env python +''' +PEXPECT LICENSE + + This license is approved by the OSI and FSF as GPL-compatible. + http://opensource.org/licenses/isc-license.txt + + Copyright (c) 2012, Noah Spurrier <[email protected]> + PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY + PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE + COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +''' +from pexpect import ANSI +import unittest +from . import PexpectTestCase +import sys + +PY3 = (sys.version_info[0] >= 3) + +write_target = 'I\'ve got a ferret sticking up my nose. \n' +\ +'(He\'s got a ferret sticking up his nose.) \n' +\ +'How it got there I can\'t tell \n' +\ +'But now it\'s there it hurts like hell \n' +\ +'And what is more it radically affects my sense of smell. \n' +\ +'(His sense of smell.) ' + +write_text = 'I\'ve got a ferret sticking up my nose.\n' + \ +'(He\'s got a ferret sticking up his nose.)\n' + \ +'How it got there I can\'t tell\n' + \ +'But now it\'s there it hurts like hell\n' + \ +'And what is more it radically affects my sense of smell.\n' + \ +'(His sense of smell.)\n' + \ +'I can see a bare-bottomed mandril.\n' + \ +'(Slyly eyeing his other nostril.)\n' + \ +'If it jumps inside there too I really don\'t know what to do\n' + \ +'I\'ll be the proud posessor of a kind of nasal zoo.\n' + \ +'(A nasal zoo.)\n' + \ +'I\'ve got a ferret sticking up my nose.\n' + \ +'(And what is worst of all it constantly explodes.)\n' + \ +'"Ferrets don\'t explode," you say\n' + \ +'But it happened nine times yesterday\n' + \ +'And I should know for each time I was standing in the way.\n' + \ +'I\'ve got a ferret sticking up my nose.\n' + \ +'(He\'s got a ferret sticking up his nose.)\n' + \ +'How it got there I can\'t tell\n' + \ +'But now it\'s there it hurts like hell\n' + \ +'And what is more it radically affects my sense of smell.\n' + \ +'(His sense of smell.)' + +tetris_target=' XX XXXX XX \n' +\ +' XXXXXX XXXXXXXX XX \n' +\ +' XXXXXX XXXXXXXX XX \n' +\ +' XX XX XX XXXX XX \n' +\ +' XXXXXX XXXX XXXX XX \n' +\ +' XXXXXXXXXX XXXX XX \n' +\ +' XX XXXXXX XX XX \n' +\ +' XXXXXX XX XX \n' +\ +' XXXX XXXXXX XX XX \n' +\ +' XXXXXX XXXX XX XX \n' +\ +' XX XX XXXX XX XX \n' +\ +' XX XX XX XX XX \n' +\ +' XX XX XXXX XXXX XX \n' +\ +' XXXXXXXX XXXX XXXX XX \n' +\ +' XXXXXXXXXXXXXX XXXXXXXX \n' +\ +' XX XXXXXXXX XX XX \n' +\ +' XXXXXXXXXXXXXX XX XX \n' +\ +' XX XXXX XXXXXX XX \n' +\ +' XXXXXX XXXXXXXX \n' +\ +' XXXXXXXXXX XX XX \n' +\ +' XXXXXXXXXXXXXXXXXXXXXXXX \n' +\ +' \n' +\ +' J->LEFT K->ROTATE L->RIGHT SPACE->DROP P->PAUSE Q->QUIT \n' +\ +' ' + +torture_target='+--------------------------------------------------------------------------------+\n' +\ +'|a`opqrs` This is the `srqpo`a |\n' +\ +'|VT100 series Torture Test Demonstration. |\n' +\ +'|VT100 series Torture Test Demonstration. |\n' +\ +'|This is a normal line __________________________________________________y_ |\n' +\ +'|This is a bold line (normal unless the Advanced Video Option is installed) |\n' +\ +'|This line is underlined _ " " " " " " _y_ |\n' +\ +'|This is a blinking line _ " " " " " " _y_ |\n' +\ +'|This is inverse video _ (underlined if no AVO and cursor is underline) _y_ |\n' +\ +'|Normal gjpqy Underline Blink Underline+Blink gjpqy |\n' +\ +'|Bold gjpqy Underline Blink Underline+Blink gjpqy |\n' +\ +'|Inverse Underline Blink Underline+Blink |\n' +\ +'|Bold+Inverse Underline Blink Underline+Blink |\n' +\ +'|This is double width |\n' +\ +'|This is double height |\n' +\ +'|This is double height |\n' +\ +'|_ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ioy |\n' +\ +'|_ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ioy |\n' +\ +'|_ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ioy |\n' +\ +'|`abcdefghijklmnopqrstuvwxyz{|}~ lqwqk |\n' +\ +'|`abcdefghijklmnopqrstuvwxyz{|}~ tqnqu |\n' +\ +'|`abcdefghijklmnopqrstuvwxyz{|}~ tqnqu |\n' +\ +'|`abcdefghijklmnopqrstuvwxyz{|}~ mqvqj |\n' +\ +'| This test created by Joe Smith, 8-May-85 |\n' +\ +'| |\n' +\ +'+--------------------------------------------------------------------------------+\n' + +class ansiTestCase (PexpectTestCase.PexpectTestCase): + def test_write (self): + s = ANSI.ANSI (6,65) + s.fill('.') + s.cursor_home() + for c in write_text: + s.write (c) + assert str(s) == write_target + + def test_torturet (self): + s = ANSI.ANSI (24,80) + with open('torturet.vt') as f: + sample_text = f.read() + for c in sample_text: + s.process (c) + assert s.pretty() == torture_target, 'processed: \n' + s.pretty() + '\nexpected:\n' + torture_target + + def test_tetris (self): + s = ANSI.ANSI (24,80) + with open('tetris.data') as f: + tetris_text = f.read() + for c in tetris_text: + s.process (c) + assert str(s) == tetris_target + + def test_lines(self): + s = ANSI.ANSI(5, 5) + s.write('a'*6 + '\n') + s.write('ab\bcd\n') + s.write('ab\rcd\n') + assert str(s) == ('aaaaa\n' + 'a \n' + 'acd \n' + 'cd \n' + ' ') + + def test_number_x(self): + """Test the FSM state used to handle more than 2 numeric parameters.""" + class TestANSI(ANSI.ANSI): + captured_memory = None + def do_sgr(self, fsm): + assert self.captured_memory is None + self.captured_memory = fsm.memory + + s = TestANSI(1, 20) + s.write('\x1b[0;1;32;45mtest') + assert str(s) == ('test ') + assert s.captured_memory is not None + assert s.captured_memory == [s, '0', '1', '32', '45'] + + def test_fsm_memory(self): + """Test the FSM stack/memory does not have numbers left on it + after some sequences with numbers are passed in.""" + s = ANSI.ANSI(1, 20) + s.write('\x1b[0;1;2;3m\x1b[4;5;6;7q\x1b[?8h\x1b[?9ltest') + assert str(s) == ('test ') + assert s.state.memory == [s] + + def test_utf8_bytes(self): + """Test that when bytes are passed in containing UTF-8 encoded + characters, where the encoding of each character consists of + multiple bytes, the characters are correctly decoded. + Incremental decoding is also tested.""" + s = ANSI.ANSI(2, 10, encoding='utf-8') + # This is the UTF-8 encoding of the UCS character "HOURGLASS" + # followed by the UTF-8 encoding of the UCS character + # "KEYBOARD". These characters can't be encoded in cp437 or + # latin-1. The "KEYBOARD" character is split into two + # separate writes. + s.write(b'\xe2\x8c\x9b') + s.write(b'\xe2\x8c') + s.write(b'\xa8') + if PY3: + assert str(s) == u'\u231b\u2328 \n ' + else: + assert unicode(s) == u'\u231b\u2328 \n ' + assert str(s) == b'\xe2\x8c\x9b\xe2\x8c\xa8 \n ' + assert s.dump() == u'\u231b\u2328 ' + assert s.pretty() == u'+----------+\n|\u231b\u2328 |\n| |\n+----------+\n' + assert s.get_abs(1, 1) == u'\u231b' + assert s.get_region(1, 1, 1, 5) == [u'\u231b\u2328 '] + + def test_unicode(self): + """Test passing in of a unicode string.""" + s = ANSI.ANSI(2, 10, encoding="utf-8") + s.write(u'\u231b\u2328') + if PY3: + assert str(s) == u'\u231b\u2328 \n ' + else: + assert unicode(s) == u'\u231b\u2328 \n ' + assert str(s) == b'\xe2\x8c\x9b\xe2\x8c\xa8 \n ' + assert s.dump() == u'\u231b\u2328 ' + assert s.pretty() == u'+----------+\n|\u231b\u2328 |\n| |\n+----------+\n' + assert s.get_abs(1, 1) == u'\u231b' + assert s.get_region(1, 1, 1, 5) == [u'\u231b\u2328 '] + + def test_decode_error(self): + """Test that default handling of decode errors replaces the + invalid characters.""" + s = ANSI.ANSI(2, 10, encoding="ascii") + s.write(b'\xff') # a non-ASCII character + # In unicode, the non-ASCII character is replaced with + # REPLACEMENT CHARACTER. + if PY3: + assert str(s) == u'\ufffd \n ' + else: + assert unicode(s) == u'\ufffd \n ' + assert str(s) == b'? \n ' + assert s.dump() == u'\ufffd ' + assert s.pretty() == u'+----------+\n|\ufffd |\n| |\n+----------+\n' + assert s.get_abs(1, 1) == u'\ufffd' + assert s.get_region(1, 1, 1, 5) == [u'\ufffd '] + + +if __name__ == '__main__': + unittest.main() + +suite = unittest.makeSuite(ansiTestCase,'test') + http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/test_async.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/test_async.py b/tools/bin/pythonSrc/pexpect-4.2/tests/test_async.py new file mode 100644 index 0000000..b918da6 --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/test_async.py @@ -0,0 +1,57 @@ +try: + import asyncio +except ImportError: + asyncio = None + +import sys +import unittest + +import pexpect +from .PexpectTestCase import PexpectTestCase + +def run(coro): + return asyncio.get_event_loop().run_until_complete(coro) + [email protected](asyncio is None, "Requires asyncio") +class AsyncTests(PexpectTestCase): + def test_simple_expect(self): + p = pexpect.spawn('cat') + p.sendline('Hello asyncio') + coro = p.expect(['Hello', pexpect.EOF] , async=True) + assert run(coro) == 0 + print('Done') + + def test_timeout(self): + p = pexpect.spawn('cat') + coro = p.expect('foo', timeout=1, async=True) + with self.assertRaises(pexpect.TIMEOUT): + run(coro) + + p = pexpect.spawn('cat') + coro = p.expect(['foo', pexpect.TIMEOUT], timeout=1, async=True) + assert run(coro) == 1 + + def test_eof(self): + p = pexpect.spawn('cat') + p.sendline('Hi') + coro = p.expect(pexpect.EOF, async=True) + p.sendeof() + assert run(coro) == 0 + + p = pexpect.spawn('cat') + p.sendeof() + coro = p.expect('Blah', async=True) + with self.assertRaises(pexpect.EOF): + run(coro) + + def test_expect_exact(self): + p = pexpect.spawn('%s list100.py' % sys.executable) + assert run(p.expect_exact(b'5', async=True)) == 0 + assert run(p.expect_exact(['wpeok', b'11'], async=True)) == 1 + assert run(p.expect_exact([b'foo', pexpect.EOF], async=True)) == 1 + + def test_async_utf8(self): + p = pexpect.spawn('%s list100.py' % sys.executable, encoding='utf8') + assert run(p.expect_exact(u'5', async=True)) == 0 + assert run(p.expect_exact([u'wpeok', u'11'], async=True)) == 1 + assert run(p.expect_exact([u'foo', pexpect.EOF], async=True)) == 1 http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/test_command_list_split.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/test_command_list_split.py b/tools/bin/pythonSrc/pexpect-4.2/tests/test_command_list_split.py new file mode 100755 index 0000000..370f46e --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/test_command_list_split.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python +''' +PEXPECT LICENSE + + This license is approved by the OSI and FSF as GPL-compatible. + http://opensource.org/licenses/isc-license.txt + + Copyright (c) 2012, Noah Spurrier <[email protected]> + PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY + PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE + COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +''' +import pexpect +import unittest +from . import PexpectTestCase + +class SplitCommandLineTestCase(PexpectTestCase.PexpectTestCase): + def testSplitSizes(self): + assert len(pexpect.split_command_line(r'')) == 0 + assert len(pexpect.split_command_line(r'one')) == 1 + assert len(pexpect.split_command_line(r'one two')) == 2 + assert len(pexpect.split_command_line(r'one two')) == 2 + assert len(pexpect.split_command_line(r'one two')) == 2 + assert len(pexpect.split_command_line(r'one\ one')) == 1 + assert len(pexpect.split_command_line('\'one one\'')) == 1 + assert len(pexpect.split_command_line(r'one\"one')) == 1 + assert len(pexpect.split_command_line(r'This\' is a\'\ test')) == 3 + +if __name__ == '__main__': + unittest.main() + +suite = unittest.makeSuite(SplitCommandLineTestCase,'test') http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/test_constructor.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/test_constructor.py b/tools/bin/pythonSrc/pexpect-4.2/tests/test_constructor.py new file mode 100755 index 0000000..98c473a --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/test_constructor.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +''' +PEXPECT LICENSE + + This license is approved by the OSI and FSF as GPL-compatible. + http://opensource.org/licenses/isc-license.txt + + Copyright (c) 2012, Noah Spurrier <[email protected]> + PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY + PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE + COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +''' +import pexpect +import unittest +from . import PexpectTestCase + +class TestCaseConstructor(PexpectTestCase.PexpectTestCase): + def test_constructor (self): + '''This tests that the constructor will work and give + the same results for different styles of invoking __init__(). + This assumes that the root directory / is static during the test. + ''' + p1 = pexpect.spawn('uname -m -n -p -r -s -v') + p2 = pexpect.spawn('uname', ['-m', '-n', '-p', '-r', '-s', '-v']) + p1.expect(pexpect.EOF) + p2.expect(pexpect.EOF) + assert p1.before == p2.before + + def test_named_parameters (self): + '''This tests that named parameters work. + ''' + p = pexpect.spawn ('/bin/ls',timeout=10) + p = pexpect.spawn (timeout=10, command='/bin/ls') + p = pexpect.spawn (args=[], command='/bin/ls') + +if __name__ == '__main__': + unittest.main() + +suite = unittest.makeSuite(TestCaseConstructor,'test') + http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/test_ctrl_chars.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/test_ctrl_chars.py b/tools/bin/pythonSrc/pexpect-4.2/tests/test_ctrl_chars.py new file mode 100755 index 0000000..10d03db --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/test_ctrl_chars.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python +''' +PEXPECT LICENSE + + This license is approved by the OSI and FSF as GPL-compatible. + http://opensource.org/licenses/isc-license.txt + + Copyright (c) 2012, Noah Spurrier <[email protected]> + PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY + PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE + COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +''' +from __future__ import print_function + +import pexpect +import unittest +from . import PexpectTestCase +import time +import sys + +from ptyprocess import ptyprocess +ptyprocess._make_eof_intr() + +if sys.version_info[0] >= 3: + def byte(i): + return bytes([i]) +else: + byte = chr + +class TestCtrlChars(PexpectTestCase.PexpectTestCase): + + def test_control_chars(self): + '''This tests that we can send all 256 8-bit characters to a child + process.''' + child = pexpect.spawn('python getch.py', echo=False, timeout=5) + child.expect('READY') + for i in range(1, 256): + child.send(byte(i)) + child.expect ('%d<STOP>' % (i,)) + + # This needs to be last, as getch.py exits on \x00 + child.send(byte(0)) + child.expect('0<STOP>') + child.expect(pexpect.EOF) + assert not child.isalive() + assert child.exitstatus == 0 + + def test_sendintr (self): + child = pexpect.spawn('python getch.py', echo=False, timeout=5) + child.expect('READY') + child.sendintr() + child.expect(str(ord(ptyprocess._INTR)) + '<STOP>') + + child.send(byte(0)) + child.expect('0<STOP>') + child.expect(pexpect.EOF) + assert not child.isalive() + assert child.exitstatus == 0 + + def test_sendeof(self): + child = pexpect.spawn('python getch.py', echo=False, timeout=5) + child.expect('READY') + child.sendeof() + child.expect(str(ord(ptyprocess._EOF)) + '<STOP>') + + child.send(byte(0)) + child.expect('0<STOP>') + child.expect(pexpect.EOF) + assert not child.isalive() + assert child.exitstatus == 0 + + def test_bad_sendcontrol_chars (self): + '''This tests that sendcontrol will return 0 for an unknown char. ''' + + child = pexpect.spawn('python getch.py', echo=False, timeout=5) + child.expect('READY') + assert 0 == child.sendcontrol('1') + + def test_sendcontrol(self): + '''This tests that we can send all special control codes by name. + ''' + child = pexpect.spawn('python getch.py', echo=False, timeout=5) + child.expect('READY') + for ctrl in 'abcdefghijklmnopqrstuvwxyz': + assert child.sendcontrol(ctrl) == 1 + val = ord(ctrl) - ord('a') + 1 + child.expect_exact(str(val)+'<STOP>') + + # escape character + assert child.sendcontrol('[') == 1 + child.expect('27<STOP>') + assert child.sendcontrol('\\') == 1 + child.expect('28<STOP>') + # telnet escape character + assert child.sendcontrol(']') == 1 + child.expect('29<STOP>') + assert child.sendcontrol('^') == 1 + child.expect('30<STOP>') + # irc protocol uses this to underline ... + assert child.sendcontrol('_') == 1 + child.expect('31<STOP>') + # the real "backspace is delete" + assert child.sendcontrol('?') == 1 + child.expect('127<STOP>') + + # NUL, same as ctrl + ' ' + assert child.sendcontrol('@') == 1 + child.expect('0<STOP>') + child.expect(pexpect.EOF) + assert not child.isalive() + assert child.exitstatus == 0 + +if __name__ == '__main__': + unittest.main() + +suite = unittest.makeSuite(TestCtrlChars,'test') + http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a1a2f2c5/tools/bin/pythonSrc/pexpect-4.2/tests/test_delay.py ---------------------------------------------------------------------- diff --git a/tools/bin/pythonSrc/pexpect-4.2/tests/test_delay.py b/tools/bin/pythonSrc/pexpect-4.2/tests/test_delay.py new file mode 100644 index 0000000..1e4dba6 --- /dev/null +++ b/tools/bin/pythonSrc/pexpect-4.2/tests/test_delay.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- + +from . import PexpectTestCase +import pexpect + + +class TestCaseDelay(PexpectTestCase.PexpectTestCase): + """ + Tests for various delay attributes. + """ + def test_delaybeforesend(self): + """ + Test various values for delaybeforesend. + """ + p = pexpect.spawn("cat") + + p.delaybeforesend = 1 + p.sendline("line 1") + p.expect("line 1") + + p.delaybeforesend = 0.0 + p.sendline("line 2") + p.expect("line 2") + + p.delaybeforesend = None + p.sendline("line 3") + p.expect("line 3") + + def test_delayafterread(self): + """ + Test various values for delayafterread. + """ + p = pexpect.spawn("cat") + + p.delayafterread = 1 + p.sendline("line 1") + p.expect("line 1") + + p.delayafterread = 0.0 + p.sendline("line 2") + p.expect("line 2") + + p.delayafterread = None + p.sendline("line 3") + p.expect("line 3")
