[0;32m
expect-lite directive: *LOG [0m
spawn ssh -o StrictHostKeyChecking=no localhost



Linux halaconia 2.6.32-5-powerpc #1 Mon Oct 3 04:26:33 UTC 2011 ppc

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
You have mail.
Last login: Tue Jan 15 13:58:48 2013 from ulu.hoomaha.net




cvmiller@halaconia:~$ 
cvmiller@halaconia:~$ 
cvmiller@halaconia:~$ 
cvmiller@halaconia:~$ export PS1='$ '
$ cd /home/cvmiller/Expect-lite
$ 
$ 

Setting Expect Timeout to: 5 



$ 
$ 
If: expr { "localhost" == "none" } |then|else +$test_host=\n([a-zA-Z0-9/_-]+)|result=FALSE

hostname
halaconia
$ 
Assigned Var:test_host=halaconia

echo $PWD
/home/cvmiller/Expect-lite
$ pwd
/home/cvmiller/Expect-lite
$ 
Assigned Var:pwd=/home/cvmiller/Expect-lite


While: expr { "self_test_conditional.txt" != "" } |result=TRUE


 ******************** start self test: self_test_conditional.txt ********************


Including: self_test_conditional.txt 


 ==== Set Timeout ====



Setting Expect Timeout to: 4 



 ==== Static Varible Tests ====


 === Conditional Equals ? craig == craig ?>echo "hello123"


If: expr { "craig" == "craig" } |then  >echo "hello123"|result=TRUE


$ echo "hello123"
hello123
$ 
$ echo craig 723-9161
craig 723-9161
$ 
 === Conditional Not-Equals ? craig!=723-9161?; === NE; Print var name:craig


If: expr { "craig" != "723-9161" } |then  ; === NE; Print var name:$name|result=TRUE


 === NE; Print var name:craig


 === Conditional new var assignment ? craig != 723-9161 ?  $a=723-9161


If: expr { "craig" != "723-9161" } |then    $a=$telephone|result=TRUE


$ echo "Print var a:723-9161 "
Print var a:723-9161 
$ 
$ 
$ 
 === Conditional var re-assignment ?craig!=723-9161?var1=craig


If: expr { "craig" != "723-9161" } |then  $var1=$name|result=TRUE


$ 
$ echo "Print var var1:craig "
Print var var1:craig 
$ 
 === Compare numbers larger or equal ?25 <= 25 ? >echo "new age"


If: expr { "25" <= "25" } |then   >echo "new age"|result=TRUE


$ echo "new age"
new age
$ 
 === Compare numbers ?25 < 30 ? >echo "old age"


If: expr { "25" < "30" } |then   >echo "old age"|result=TRUE

echo "old age"
old age
$ 
 === Bad operator numbers ?25 % 30 ? >echo "Warning"


Warning: Expect-lite: invalid character "@"
in expression " "" @ "25 % 30" ": Unable to detect conditional operator

	Evaluating line: expr { "" @ "25 % 30" } |   >echo "bad stuff"|

$ 
 === Compare numbers with else (and spaces) ?25 > 30 ? >echo "old age" :: > echo "new age"


If: expr { "25" > "30" } |then   >echo "old age"|else > echo "new age"|result=FALSE


$  echo "new age"
new age
$ 
 === Compare numbers with else ?30>25? >echo "old age" :: > echo "new age"


If: expr { "30" > "25" } |then  >echo "old age"|else> echo "new age"|result=TRUE

echo "old age"
old age
$ 
 === Compare numbers with ipv6 address	?1<2?>echo "fd80::dead:1"


If: expr { "1" < "2" } |then>echo "fd80::dead:1"|else>echo "fd80::dead:1"|result=TRUE


$ echo "fd80::dead:1"
fd80::dead:1
$ 
 === Compare numbers with ipv6 address	?1>2?>echo "fd80::dead:1"::>echo "ff01::02"


If: expr { "1" > "2" } |then>echo "fd80::dead:1"|else>echo "ff01::02"|result=FALSE

echo "ff01::02"
ff01::02
$ 
$ 
 === Capture with expect ? true == true ?+$module=^([a-z]+).+ext3


$ 
If: expr { "true" == "true" } |then  +$module=^([a-z]+).+ext3|result=TRUE

lsmod
Module                  Size  Used by
pl2303                 18102  0 
usbserial              32399  1 pl2303
cpufreq_userspace       5156  0 
cpufreq_powersave       4138  0 
cpufreq_ondemand       10789  0 
cpufreq_stats           5832  0 
cpufreq_conservative     8952  0 
parport_pc             28780  0 
lp                     10975  0 
parport                32295  2 parport_pc,lp
sco                    11568  2 
bridge                 48923  0 
stp                     4885  1 bridge
bnep                   13758  2 
rfcomm                 37814  8 
l2cap                  32892  16 bnep,rfcomm
crc16                   4475  1 l2cap
radeon                693831  0 
ttm                    46868  1 radeon
drm_kms_helper         24585  1 radeon
drm                   142415  3 radeon,ttm,drm_kms_helper
binfmt_misc            10371  1 
fuse                   58275  1 
nfsd                  243724  13 
exportfs                6642  1 nfsd
nfs                   269860  0 
lockd                  65451  2 nfsd,nfs
fscache                35963  1 nfs
nfs_acl                 5635  2 nfsd,nfs
auth_rpcgss            36712  2 nfsd,nfs
sunrpc                173823  15 nfsd,nfs,lockd,nfs_acl,auth_rpcgss
snd_powermac           57815  0 
loop                   15953  0 
firewire_sbp2          16011  0 
scsi_mod              132122  1 firewire_sbp2
btusb                  14104  2 
bluetooth              52362  9 sco,bnep,rfcomm,l2cap,btusb
arc4                    4442  2 
ecb                     5353  2 
b43                   168245  0 
snd_aoa_codec_toonie     4855  2 
snd_aoa_fabric_layout    12091  1 
snd_aoa                15580  2 snd_aoa_codec_toonie,snd_aoa_fabric_layout
snd_aoa_i2sbus         20629  1 
snd_pcm                65033  2 snd_powermac,snd_aoa_i2sbus
rng_core                6446  1 b43
mac80211              156304  1 b43
i2c_powermac            6651  0 
evdev                  11760  9 
snd_page_alloc          9045  1 snd_pcm
snd_seq                51409  0 
cfg80211              117481  2 b43,mac80211
snd_timer              20972  2 snd_pcm,snd_seq
snd_seq_device          8405  1 snd_seq
rfkill                 17994  4 bluetooth,cfg80211
snd                    52691  11 snd_powermac,snd_aoa_codec_toonie,snd_aoa_fabric_layout,snd_aoa,snd_aoa_i2sbus,snd_pcm,snd_seq,snd_timer,snd_seq_device
soundcore               8003  1 snd
snd_aoa_soundbus        6669  2 snd_aoa_fabric_layout,snd_aoa_i2sbus
ext3                  124888  3 
jbd                    40991  1 ext3
mbcache                 8286  1 ext3
usbhid                 39936  0 
hid                    68441  1 usbhid
ssb                    49059  1 b43
ohci_hcd               35399  0 
ehci_hcd               44284  0 
mmc_core               54708  2 b43,ssb
firewire_ohci          26160  0 
ide_cd_mod             28561  0 
sungem                 30865  0 
pcmcia                 25655  2 b43,ssb
firewire_core          44226  2 firewire_sbp2,firewire_ohci
crc_itu_t               4495  1 firewire_core
cdrom                  36699  1 ide_cd_mod
sungem_phy             12982  1 sungem
usbcore               132587  7 pl2303,usbserial,btusb,usbhid,ohci_hcd,ehci_hcd
nls_base                8693  1 usbcore
pcmcia_core            30647  3 b43,ssb,pcmcia
$ 
Assigned Var:module=jbd


$ 
 === show capture jbd


$ 
 === Capture with expect and colons


If: expr { "true" == "true" } |then  +$module1=:[0-9]+:[0-9]+:([A-Za-z]+):|else ; ==== or not|result=TRUE

cat /etc/passwd | grep nobody
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
$ 
Assigned Var:module1=nobody

echo nobody
nobody
$ 
 === Reassign vars


 === new age is 35


$ echo "55"
55
$ 
Assigned Var:age=55


If: expr { "55" >= "55" } |then  >echo "Freedom at $age"|else>echo "Keep on working"|result=TRUE

echo "Freedom at 55"
Freedom at 55
$ 
 === Test conditional jump


If: expr { "55" == "55" } |then  %SKIP2_AGE55|result=TRUE

:%SKIP2_AGE55


 === Test conditional jump with label with spaces, and space at end of label


If: expr { "55" == "55" } |then  %move along, nothing to see|result=TRUE

:%move along, nothing to see


 === Test conditional jump with indentation


If: expr { "55" != "55" } |then  %move along, nothing to see|result=FALSE


$ echo " Skipper"
 Skipper
$ echo "2"
2
$ echo "3"
3
$ 
 === Test conditional include


If: expr { "55" == "55" } |then  ~test_include.txt|result=TRUE


Including: test_include.txt


$ 
$ 
$ 
 === Script: 


$ echo Hi There
Hi There
$ 
$ echo "Pau"
Pau
$ 
If: expr { "0" == "0" } |then  ; Empty is |$empty ||result=TRUE


 Empty is |0 |


If: expr { "a" != "a" } |then  >echo "$a $b"|result=FALSE


If: expr { "Joe Blow" == "Joe Blow" } |then  >echo "Found $name"|result=TRUE


$ echo "Found Joe Blow"
Found Joe Blow
$ 
 === Testing that var1 is equal to var2


If: expr { "craig" == "craig" } |then   %CONT|else! _el_fail_test|result=TRUE

:%CONT


 === Test using a flag in cond action statement


If: expr { "no" == "craig" } |then   >kill -s INT $PID|result=FALSE


 === Test making assignments in action and else_action


If: expr { "no" == "craig" } |then   $var1=$name|else $var2=$age|result=FALSE


$  echo craig 55
craig 55
$ 
If: expr { "Joe Blow" != "no" } |then  $var1=TRUE|else$var2=FALSE|result=TRUE

echo TRUE Zero
TRUE Zero
$ 
 === Test making assignments in only else_action


If: expr { "no" == "craig" } |then   >echo "not here"|else $var2=$telephone|result=FALSE

 echo TRUE 723-9161
TRUE 723-9161
$ 
 === Test nesting of ifs


If: expr { "Joe Blow" == "craig" } |then    > echo "not here"|else ? $var1 == TRUE  ? >echo "nested ifs"|result=FALSE


If: expr { "TRUE" == "TRUE" } |then   >echo "nested ifs"|result=TRUE

echo "nested ifs"
nested ifs
$ 
$ 
 === issue ^C from if statement


If: expr { "1" != "0" } |then   >^C|result=TRUE

time sleep 3
^C

real	0m0.004s
user	0m0.000s
sys	0m0.004s
$ 
 === issue simple commmand as action


If: expr { "1" != "0" } |then  >pwd|result=TRUE


$ pwd
/home/cvmiller/Expect-lite
$ 
 === Compare numbers with else ?30>55? >echo "old age" :: > echo "new age"


If: expr { "30" > "55" } |then  >echo "old age"|else>echo "new age"|result=FALSE


$ echo "new age"
new age
$ 
 === Test skip to non-existant label


If: expr { "Joe Blow" == "Joe Blow" } |then   %SKIP_TO_NOWHERE|result=TRUE

:%SKIP_TO_NOWHERE


$ echo "skip this line"
skip this line
$ 
 ======== Decrementing ZZ Loop with embedded expect ============


$ 
 == age=4

 echo ZZ4
ZZ4
$ 
If: expr { "4" > "0" } |then  %REPEAT_LOOP|result=TRUE

:%REPEAT_LOOP


$ 
 == age=3

 echo ZZ3
ZZ3
$ 
If: expr { "3" > "0" } |then  %REPEAT_LOOP|result=TRUE

:%REPEAT_LOOP


$ 
 == age=2

 echo ZZ2
ZZ2
$ 
If: expr { "2" > "0" } |then  %REPEAT_LOOP|result=TRUE

:%REPEAT_LOOP


$ 
 == age=1

 echo ZZ1
ZZ1
$ 
If: expr { "1" > "0" } |then  %REPEAT_LOOP|result=TRUE

:%REPEAT_LOOP


$ 
 == age=0

 echo ZZ0
ZZ0
$ 
If: expr { "0" > "0" } |then  %REPEAT_LOOP|result=FALSE


If: expr { "0" > "0" } |then   *FAIL|result=FALSE


$ echo "Pau"
Pau
$ 
 ======== Decrementing YY Loop =============


$ 
$ 
 == loop2=9

 echo 9
9
$ 
If: expr { "9" > "0" } |then  %REPEAT_LOOP1|result=TRUE

:%REPEAT_LOOP1


$ 
 == loop2=8

 echo 8
8
$ 
If: expr { "8" > "0" } |then  %REPEAT_LOOP1|result=TRUE

:%REPEAT_LOOP1


$ 
 == loop2=7

 echo 7
7
$ 
If: expr { "7" > "0" } |then  %REPEAT_LOOP1|result=TRUE

:%REPEAT_LOOP1


$ 
 == loop2=6

 echo 6
6
$ 
If: expr { "6" > "0" } |then  %REPEAT_LOOP1|result=TRUE

:%REPEAT_LOOP1


$ 
 == loop2=5

 echo 5
5
$ 
If: expr { "5" > "0" } |then  %REPEAT_LOOP1|result=TRUE

:%REPEAT_LOOP1


$ 
 == loop2=4

 echo 4
4
$ 
If: expr { "4" > "0" } |then  %REPEAT_LOOP1|result=TRUE

:%REPEAT_LOOP1


$ 
 == loop2=3

 echo 3
3
$ 
If: expr { "3" > "0" } |then  %REPEAT_LOOP1|result=TRUE

:%REPEAT_LOOP1


$ 
 == loop2=2

 echo 2
2
$ 
If: expr { "2" > "0" } |then  %REPEAT_LOOP1|result=TRUE

:%REPEAT_LOOP1


$ 
 == loop2=1

 echo 1
1
$ 
If: expr { "1" > "0" } |then  %REPEAT_LOOP1|result=TRUE

:%REPEAT_LOOP1


$ 
 == loop2=0

 echo 0
0
$ 
If: expr { "0" > "0" } |then  %REPEAT_LOOP1|result=FALSE


 ======== Incrementing Loop ========

echo 4
4
$ 
If: expr { "4" <= "10" } |then  %REPEAT_LOOP2|result=TRUE

:%REPEAT_LOOP2

echo 5
5
$ 
If: expr { "5" <= "10" } |then  %REPEAT_LOOP2|result=TRUE

:%REPEAT_LOOP2

echo 6
6
$ 
If: expr { "6" <= "10" } |then  %REPEAT_LOOP2|result=TRUE

:%REPEAT_LOOP2

echo 7
7
$ 
If: expr { "7" <= "10" } |then  %REPEAT_LOOP2|result=TRUE

:%REPEAT_LOOP2

echo 8
8
$ 
If: expr { "8" <= "10" } |then  %REPEAT_LOOP2|result=TRUE

:%REPEAT_LOOP2

echo 9
9
$ 
If: expr { "9" <= "10" } |then  %REPEAT_LOOP2|result=TRUE

:%REPEAT_LOOP2

echo 10
10
$ 
If: expr { "10" <= "10" } |then  %REPEAT_LOOP2|result=TRUE

:%REPEAT_LOOP2

echo 11
11
$ 
If: expr { "11" <= "10" } |then  %REPEAT_LOOP2|result=FALSE


 ======= Test incrementing string ======


 === junk is test


If: expr { "test" != "test" } |then   >echo FAIL|else >echo Good|result=FALSE


$ echo Good
Good
$ 
 === Test conditional undefined


If: expr { "" == "" } |then  >echo Good|else >echo FAIL|result=TRUE


$ echo Good
Good
$ 
If: expr { "" != "" } |then  >echo FAIL|else >echo Good|result=FALSE


$ echo Good
Good
$ 
If: expr { "" == "" } |then  >echo Good|else >echo FAIL|result=TRUE


$ echo Good
Good
$ 
$ 
 ==== All Pau!


$ 
If: expr { "0" == "1" } |then   [|else ; ******************** $self_test$reg_count  PASSED ********************|result=FALSE


 ******************** self_test_conditional.txt  PASSED ********************


While: expr { "self_test_code_block.txt" != "" } |result=TRUE


 ******************** start self test: self_test_code_block.txt ********************


Including: self_test_code_block.txt 


 ==== Set Timeout ====



Setting Expect Timeout to: 4 



expect-lite directive: *EXP_INFO 

 === basic if code block


If: expr { "1" == "1" } |then[|result=TRUE


$ echo "if1 good"
if1 good
$ <
if1 good

 === if else code block


If: expr { "1" != "1" } |then>echo "BAD"|else [|result=FALSE


$ echo "if2 good"
if2 good
$ <
if2 good

 === third if too many code blocks - should have warning


If: expr { "1" != "1" } |then [|else [|result=FALSE


Warning: Expect-lite: Code Blocks not supported in both then & else actions


$ 
 === nested ifs


If: expr { "1" == "1" } |then ?if 2==2? [ |result=TRUE


If: expr { "2" == "2" } |then [|result=TRUE


$ echo "good"
good
$ <good

 === nested ifs using code blocks


If: expr { "1" < "3" } |then   [|else >echo "else 1"|result=TRUE


If: expr { "2" < "3" } |then   [|else >echo "else 2"|result=TRUE


$ echo "good"
good
$ <good

 === while loops with code blocks


 === simple while loop


While: expr { "0" < "5" } |result=TRUE


$ echo "hello ken2"
hello ken2
$ <ken

While: expr { "1" < "5" } |result=TRUE

echo "hello ken2"
hello ken2
$ <ken

While: expr { "2" < "5" } |result=TRUE

echo "hello ken2"
hello ken2
$ <ken

While: expr { "3" < "5" } |result=TRUE

echo "hello ken2"
hello ken2
$ <ken

While: expr { "4" < "5" } |result=TRUE

echo "hello ken2"
hello ken2
$ <ken

While: expr { "5" < "5" } |result=FALSE


If: expr { "5" == "5" } |then   >echo "good"|result=TRUE

echo "good"
good
$ <good

 === while loop with break


While: expr { "0" < "5" } |result=TRUE


$ echo "hello ken2"
hello ken2
$ <ken

If: expr { "0" == "3" } |then   $i=5|result=FALSE


While: expr { "1" < "5" } |result=TRUE

echo "hello ken2"
hello ken2
$ <ken

If: expr { "1" == "3" } |then   $i=5|result=FALSE


While: expr { "2" < "5" } |result=TRUE

echo "hello ken2"
hello ken2
$ <ken

If: expr { "2" == "3" } |then   $i=5|result=FALSE


While: expr { "3" < "5" } |result=TRUE

echo "hello ken2"
hello ken2
$ <ken

If: expr { "3" == "3" } |then   $i=5|result=TRUE


While: expr { "6" < "5" } |result=FALSE


If: expr { "6" == "6" } |then   >echo "good"|result=TRUE

echo "good"
good
$ <good

 === Nested While loops


$ 
 == should repeat "hello ken" 3 times, with 2 "bye now"s inside each outer loop


While: expr { "0" < "3" } |result=TRUE


$ echo "hello ken"
hello ken
$ <ken

While: expr { "0" < "2" } |result=TRUE

echo "bye now"
bye now
$ 
While: expr { "1" < "2" } |result=TRUE


$ echo "bye now"
bye now
$ 
While: expr { "2" < "2" } |result=FALSE


While: expr { "1" < "3" } |result=TRUE


$ echo "hello ken"
hello ken
$ <ken

While: expr { "0" < "2" } |result=TRUE

echo "bye now"
bye now
$ 
While: expr { "1" < "2" } |result=TRUE


$ echo "bye now"
bye now
$ 
While: expr { "2" < "2" } |result=FALSE


While: expr { "2" < "3" } |result=TRUE


$ echo "hello ken"
hello ken
$ <ken

While: expr { "0" < "2" } |result=TRUE

echo "bye now"
bye now
$ 
While: expr { "1" < "2" } |result=TRUE


$ echo "bye now"
bye now
$ 
While: expr { "2" < "2" } |result=FALSE


While: expr { "3" < "3" } |result=FALSE


If: expr { "3" == "3" } |then   >echo "good"|result=TRUE


$ echo "good"
good
$ <good

If: expr { "2" == "2" } |then   >echo "good"|result=TRUE


$ echo "good"
good
$ <good

 === Negative testing of code blocks


expect-lite directive: *INFINITE_LOOP 15 

$ 
 == test blank arg2


While: expr { "3" == "" } |result=FALSE


$ 
$ 
 === test just number 


Warning: Expect-lite: invalid character "@"
in expression "  @ 3 ": Unable to detect conditional operator

	Evaluating line: expr {  @ 3 } 

$ 
 === extra right bracket


$ 
 === test with no closure


While: expr { "1" < "2" } |result=TRUE


$ 
Warning: Expect-lite: invalid character "@"
in expression "  @  ": Unable to detect conditional operator

	Evaluating line: expr {  @  } 
echo "good"
good
$ <good

$ 
 === just [ ]


Warning: Expect-lite: invalid character "@"
in expression "  @  ": Unable to detect conditional operator

	Evaluating line: expr {  @  } 

$ 
If: expr { "0" == "1" } |then   [|else ; ******************** $self_test$reg_count  PASSED ********************|result=FALSE


 ******************** self_test_code_block.txt  PASSED ********************


While: expr { "self_test_math.txt" != "" } |result=TRUE


 ******************** start self test: self_test_math.txt  ********************


Including: self_test_math.txt  



Setting Expect Timeout to: 3 



$ 
 == test of Math Functions


$ 
 === num is 25

echo 25
25
$ <25

$ 
 === num is 250

echo 250
250
$ <250

 === num is 10

echo 10
10
$ <10

 === answer is 2.5

echo 2.5
2.5
$ <2.5

 === answer is 1

echo 1
1
$ <1

 === answer is 3

echo 3
3
$ <3

 == Negative test answer1 not defined then division


Warning: Expect-lite: Unable to interpret =$answer1   / 2 * (10 + 1) 
	missing operand at _@_
in expression "  _@_/ 2 * (10 + 1)"

If: expr { "" != "" } |then   >echo FAIL|else >echo Good|result=FALSE

echo Good
Good
$ <
Good

 === answer is 


 == Negative test answer1 not defined, but should work becuase of '+'


 === answer is 22


If: expr { "22" != "22" } |then   >echo FAIL|else >echo Good|result=FALSE

echo Good
Good
$ <
Good

 === Negative test: Arrays not supported


Warning: Expect-lite: Unable to interpret =$answer  3 + 5 
	missing operator at _@_
in expression "5 _@_3 + 5"

 === answer is 5


If: expr { "5" != "5" } |then   >echo FAIL|else >echo Good|result=FALSE

echo Good
Good
$ <
Good


Setting Expect Timeout to: 120 



If: expr { "120" != "120" } |then   >echo FAIL|else >echo Good|result=FALSE


$ echo Good
Good
$ <
Good

$ 
$ 
 == answer is: 8.0


$ 
If: expr { "0" == "1" } |then   [|else ; ******************** $self_test$reg_count  PASSED ********************|result=FALSE


 ******************** self_test_math.txt   PASSED ********************


While: expr { "self_test_var_deref.txt" != "" } |result=TRUE


 ******************** start self test: self_test_var_deref.txt ********************


Including: self_test_var_deref.txt 


expect-lite directive: *WARN 
 === string is: this is a regression test line
 === string is: this is the first
 === string is: this is the second
 === string is: this is the third


Setting Expect Timeout to: 6 



If: expr { "this is the second" == "this is the second" } |then   >echo Good|else >echo FAIL|result=TRUE


$ echo Good
Good
$ <
Good

 === Test new Var Functionality ===


 === Test assignment var into array var


If: expr { "TEST" != "TEST" } |then   >echo FAIL|else >echo Good|result=FALSE

echo Good
Good
$ <
Good

 === Test increment var 

 === count 1

If: expr { "1" != "1" } |then   >echo FAIL|else >echo Good|result=FALSE

echo Good
Good
$ <
Good

 === Test capture var into array var (fails in version pre-3.1.4)

echo this is a test
this is a test
$ 
Assigned Var:item1=this is a test


If: expr { "this is a test" != "this is a test" } |then   >echo FAIL|else >echo Good|result=FALSE


$ echo Good
Good
$ <
Good

 === Test new Var Functionality in Loop with Randomness ===


Including: tcl_functions.inc


$ 
$ 
$ 
 === initialize the rng

 === loop 8

$ 
 ======== Small Loop ========


If: expr { "test8" == "test8" } |then   >echo Good|else >echo FAIL|result=TRUE


$ echo Good
Good
$ <
Good
echo 3
3
$ <3

If: expr { "9" < "14" } |then  %REPEAT_SMALL_LOOP|result=TRUE

:%REPEAT_SMALL_LOOP

 === loop 9

$ 
If: expr { "test9" == "test9" } |then   >echo Good|else >echo FAIL|result=TRUE


$ echo Good
Good
$ <
Good
echo 3
3
$ <3

If: expr { "10" < "14" } |then  %REPEAT_SMALL_LOOP|result=TRUE

:%REPEAT_SMALL_LOOP

 === loop 10

$ 
If: expr { "test10" == "test10" } |then   >echo Good|else >echo FAIL|result=TRUE


$ echo Good
Good
$ <
Good
echo 1
1
$ <1

If: expr { "11" < "14" } |then  %REPEAT_SMALL_LOOP|result=TRUE

:%REPEAT_SMALL_LOOP

 === loop 11

$ 
If: expr { "test11" == "test11" } |then   >echo Good|else >echo FAIL|result=TRUE


$ echo Good
Good
$ <
Good
echo 4
4
$ <4

If: expr { "12" < "14" } |then  %REPEAT_SMALL_LOOP|result=TRUE

:%REPEAT_SMALL_LOOP

 === loop 12

$ 
If: expr { "test12" == "test12" } |then   >echo Good|else >echo FAIL|result=TRUE


$ echo Good
Good
$ <
Good
echo 1
1
$ <1

If: expr { "13" < "14" } |then  %REPEAT_SMALL_LOOP|result=TRUE

:%REPEAT_SMALL_LOOP

 === loop 13

$ 
If: expr { "test13" == "test13" } |then   >echo Good|else >echo FAIL|result=TRUE


$ echo Good
Good
$ <
Good
echo 4
4
$ <4

If: expr { "14" < "14" } |then  %REPEAT_SMALL_LOOP|result=FALSE


$ 
 == show #3 items of parray: 1 50:36:8F:35:F1:6D


 === Multiple var dereference


 this is the first two3four


If: expr { "this is the first two3four" == "this is the first two3four" } |then   >echo Good|else >echo FAIL|result=TRUE


$ echo Good
Good
$ <
Good

 === Dynamic Variable with custom prompt


 === Requires version 3.2.0 or later

INFO: User Defined Prompt: myprompt $
bash
cvmiller@halaconia:~/Expect-lite$ export PS1="myprompt "
myprompt 
myprompt echo here
here
myprompt echo there
there
myprompt echo "hear"
hear
myprompt 
Assigned Var:catch=hear

<hear

If: expr { "hear" == "hear" } |then   >echo Good|else >echo FAIL|result=TRUE


myprompt INFO: User Defined Prompt is now default: .*$ $
echo Good
Good
myprompt export PS1="\$ "
$ sleep 1
$ 
If: expr { "0" == "1" } |then   [|else ; ******************** $self_test$reg_count  PASSED ********************|result=FALSE


 ******************** self_test_var_deref.txt  PASSED ********************


While: expr { "self_test_basics.txt" != "" } |result=TRUE


 ******************** start self test: self_test_basics.txt ********************


Including: self_test_basics.txt 


expect-lite directive: *WARN 

expect-lite directive: *DEBUG 

$ 

Setting Expect Timeout to: 3 


NUM=5
$ TAG="<HTML>"
$ TESTSTR="This is an equation:(5+3)/2*2"
$ 
 === detect single value with no regex

echo $NUM
5
$ 
find<<5>>
  in<<echo $NUM
5>>



$ 
 === detect HTML Tag (no regex using '<<')

echo $TAG
<HTML>
$ 
find<<<HTML>>>
  in<<echo $TAG
<HTML>>>



$ 
 === detect HTML Tag (with regex using '<')

echo $TAG
<HTML>
$ 
find<<[<]H..L>>>
  in<<echo $TAG
<HTML>>>



$ 
 === look for no regex with parenthisis, plus, star

echo $TESTSTR
This is an equation:(5+3)/2*2
$ 
find<<This is an equation:(5+3)/2*2>>
  in<<echo $TESTSTR
This is an equation:(5+3)/2*2>>



 === look for wild carding 'This*equation'

echo $TESTSTR
This is an equation:(5+3)/2*2
$ 
find<<This.+equation>>
  in<<echo $TESTSTR
This is an equation>>



 === use Regex and escape special chars ()+*

echo $TESTSTR
This is an equation:(5+3)/2*2
$ 
find<<This is an equation:\(5\+3\)/2\*2>>
  in<<echo $TESTSTR
This is an equation:(5+3)/2*2>>



$ 
 === collect equation

echo $TESTSTR
This is an equation:(5+3)/2*2
$ 
var_found<<(5+3)/2*2>>

var_in<<echo $TESTSTR
This is an equation:(5+3)/2*2
$ >>

Assigned Var:equation=(5+3)/2*2


 === Start BC (which has no prompt)

bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 

find<<warranty>>
  in<<bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty>>


(5+3)/2*2
8

find<<8>>
  in<<(5+3)/2*2
8>>



$ 
expect-lite directive: *NODEBUG 

$ 
If: expr { "0" == "1" } |then   [|else ; ******************** $self_test$reg_count  PASSED ********************|result=FALSE


 ******************** self_test_basics.txt  PASSED ********************


While: expr { "self_self_ide_test.txt" != "" } |result=TRUE


 ******************** start self test: self_self_ide_test.txt ********************


Including: self_self_ide_test.txt 


$ 

Setting Expect Timeout to: 10 


expect-lite r=localhost c=self_test_ide.txt el=expect-lite 
Const: el = expect-lite

spawn ssh -o StrictHostKeyChecking=no localhost








Linux halaconia 2.6.32-5-powerpc #1 Mon Oct 3 04:26:33 UTC 2011 ppc



The programs included with the Debian GNU/Linux system are free software;

the exact distribution terms for each program are described in the

individual files in /usr/share/doc/*/copyright.



Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent

permitted by applicable law.

You have mail.

Last login: Tue Jan 15 13:59:41 2013 from localhost








cvmiller@halaconia:~$ 

cvmiller@halaconia:~$ 

cvmiller@halaconia:~$ 

cvmiller@halaconia:~$ export PS1='$ '

$ 

$ 

 ==== Testing the IDE =====



echo line "1"

line 1

$ echo line "2"

line 2

$ echo line "3"

line 3

$ 

expect-lite directive: *INTERACT 

<<expect-lite directive: *INTERACT




 Press '+++' to end interact session & return to script 





echo line "4"
line 4
$ 
$ <line 4

 === show help


IDE: Help
  Key          Action
  ----        ------
  <esc>s      Step
  <esc>k      sKip next step
  <esc>c      Continue
  <esc>v      show Vars
  <esc>0to9   Show N next lines of script
  <esc>-1to-9 Show N previous lines of script
  ctrl+D      Quit & Exit expect-lite
  <esc>h      this Help
<IDE: Help
<<esc>h      this Help

$ 
$ 
 === check last 5 lines

Printing last 5 line(s) of script:
; ==== Testing the IDE =====
>echo line "1"
>echo line "2"
>echo line "3"
>echo line "4"
<<Printing last 5 line(s) of script:
<<; ==== Testing the IDE =====
<<>echo line "1"
<<>echo line "2"
<<>echo line "3"
<<>echo line "4"

$ 
$ 
 === check next 5 lines

Printing next 5 line(s) of script:
>echo "do not run this line"
>echo line "6"
>echo line "7"
>echo line "8"
>echo line "9"
<<Printing next 5 line(s) of script:
<<>echo "do not run this line"
<<>echo line "6"
<<>echo line "7"
<<>echo line "8"
<<>echo line "9"

$ 
$ 
 === Skip next line

Skipping:>echo "do not run this line"
<Skipping:>echo "do not run this line"

$ 
$ 
 === Show current line

Printing current line of script:
>echo "do not run this line"

$ 
$ echo "do not run this line"
do not run this line
$ 
 === show vars

DEBUG Info: Printing all expect-lite variables
Var:arg0                  Value:self_test_ide.txt
<DEBUG Info: Printing all expect-lite variables
<Var:arg0

$ 
$ 
 === Continue





INFO: FORK session is: default,	Active sessions are: default





$ 

$ echo line "6"

line 6

$ echo line "7"

line 7

$ echo line "8"

line 8

$ echo line "9"

line 9

$ <line 9


$ 



##Overall Result: PASS 





<##Overall Result: PASS
$ echo $?
0
$ <
0

 *********** Expect-lite IDE Test Pass! ************


$ 
If: expr { "0" == "1" } |then   [|else ; ******************** $self_test$reg_count  PASSED ********************|result=FALSE


 ******************** self_self_ide_test.txt  PASSED ********************


While: expr { "self_test_fork.txt" != "" } |result=TRUE


 ******************** start self test: self_test_fork.txt ********************


Including: self_test_fork.txt 


$ 
 ======== "SESSION 0a" the default session

pwd
/home/cvmiller/Expect-lite
$ pwd
/home/cvmiller/Expect-lite
$ 
Assigned Var:PWD=/home/cvmiller/Expect-lite



Setting Expect Timeout to: 10 




Linux halaconia 2.6.32-5-powerpc #1 Mon Oct 3 04:26:33 UTC 2011 ppc

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
You have mail.
Last login: Tue Jan 15 13:59:51 2013 from localhost




cvmiller@halaconia:~$ 
cvmiller@halaconia:~$ 
cvmiller@halaconia:~$ 
cvmiller@halaconia:~$ export PS1='$ '
$ cd /home/cvmiller/Expect-lite
$ 

INFO: FORK session is: MY_HOST,	Active sessions are: default MY_HOST

Warning:Prompt Timed Out!

 ======== "SESSION 1a"


 === Test file inclusion inside a session


Including: tcl_functions.inc


$ 
$ 
$ 
$ 
$ 
 === initialize the rng



INFO: FORK session is: MY_HOST,	Active sessions are: default MY_HOST


$ cd /tmp
$ mkdir MY_HOST
$ cd MY_HOST
$ 
$ 
 == negative test



Warning: FORK: Too Many Names: *FORK this and that

sleep 1; pwd
/tmp/MY_HOST
$ 
 == fork status test



INFO: FORK session is: MY_HOST,	Active sessions are: default MY_HOST


$ 

Linux halaconia 2.6.32-5-powerpc #1 Mon Oct 3 04:26:33 UTC 2011 ppc

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
You have mail.
Last login: Tue Jan 15 13:59:54 2013 from localhost




cvmiller@halaconia:~$ 
cvmiller@halaconia:~$ 
cvmiller@halaconia:~$ 
cvmiller@halaconia:~$ export PS1='$ '
$ cd /home/cvmiller/Expect-lite
$ 

INFO: FORK session is: MY_2nd_HOST,	Active sessions are: default MY_2nd_HOST MY_HOST

Warning:Prompt Timed Out!

========== "SESSION 2a"

mkdir -p /tmp/session2
$ cd /tmp/session2
$ pwd
/tmp/session2
$ </tmp/session2

expect-lite directive: *EOLS CRLF 

 === Look for 6 prompts


$ 
$ 
$ 
$ 
$ 
$ hostname
halaconia
$ 
$ sleep 2
$ 
$ 

INFO: FORK session is: MY_HOST,	Active sessions are: default MY_2nd_HOST MY_HOST


$ 
========== "SESSION 1b"


$ pwd
/tmp/MY_HOST
$ </tmp/MY_HOST


INFO: FORK session is: MY_2nd_HOST,	Active sessions are: default MY_2nd_HOST MY_HOST


 ======== "SESSION 2b"


$ 
$ pwd
/tmp/session2
$ 
$ </tmp/session2

 === Look for 4 prompts


$ 
$ 
$ 
$ cd /tmp
$ 
$ rmdir session2
$ 
$ 

INFO: FORK session is: MY_HOST,	Active sessions are: default MY_2nd_HOST MY_HOST


========== "SESSION 1c"

pwd
/tmp/MY_HOST
$ </tmp/MY_HOST
cd /tmp/
$ rmdir /tmp/MY_HOST
$ 
 === switch back to original session (aka default)



INFO: FORK session is: default,	Active sessions are: default MY_2nd_HOST MY_HOST


 ======== "SESSION 0b"

pwd
/home/cvmiller/Expect-lite
$ </home/cvmiller/Expect-lite

 === check current session



INFO: FORK session is: default,	Active sessions are: default MY_2nd_HOST MY_HOST


$ 
$ 
If: expr { "0" == "1" } |then   [|else ; ******************** $self_test$reg_count  PASSED ********************|result=FALSE


 ******************** self_test_fork.txt  PASSED ********************


While: expr { "self_self_directive_test.txt" != "" } |result=TRUE


 ******************** start self test: self_self_directive_test.txt ********************


Including: self_self_directive_test.txt 


$ 

Setting Expect Timeout to: 10 


expect-lite r=localhost c=self_test_directives.txt el=expect-lite 
Const: el = expect-lite

spawn ssh -o StrictHostKeyChecking=no localhost




expect-lite directive: Shell is: tcsh

<expect-lite directive: Shell is: tcsh
tcsh



tcsh

Linux halaconia 2.6.32-5-powerpc #1 Mon Oct 3 04:26:33 UTC 2011 ppc



The programs included with the Debian GNU/Linux system are free software;

the exact distribution terms for each program are described in the

individual files in /usr/share/doc/*/copyright.



Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent

permitted by applicable law.

You have mail.

Last login: Tue Jan 15 14:00:07 2013 from localhost


cvmiller@halaconia:~$ 

cvmiller@halaconia:~$ tcsh

-bash: tcsh: command not found

cvmiller@halaconia:~$ 

cvmiller@halaconia:~$ set prompt = "%c02 %# %L"

cvmiller@halaconia:~$ 

expect-lite directive: *NODEBUG 

<expect-lite directive: *NODEBUG


expect-lite directive: *WARN 





Setting Expect Timeout to: 3 





<expect-lite directive: *WARN


cvmiller@halaconia:~$ 

 === Check hello at beginning of test



echo hello

hello

cvmiller@halaconia:~$ 

Assigned Var:answer=hello





If: expr { "hello" != "hello" } |then   >echo FAIL|else >echo Good|result=FALSE



<If: expr { "hello" != "hello" } 
echo Good

Good

cvmiller@halaconia:~$ 

expect-lite directive: *EOLS CRLF 

<expect-lite directive: *EOLS CRLF 


expect-lite directive: *EOLS LF 



expect-lite directive: *NOFAIL 

<expect-lite directive: *EOLS LF
<expect-lite directive: *NOFAIL


cvmiller@halaconia:~$ 

cvmiller@halaconia:~$ 

Fail Include Script: self_test_fail_script.txt



<Fail Include Script: self_test_fail_script.txt


cvmiller@halaconia:~$ echo "hello"

hello

cvmiller@halaconia:~$ 



 FAILED COMMAND:echo "hello" 



    Expect Failed:fail this





Including Fail Script: self_test_fail_script.txt



<FAILED COMMAND:echo "hello"
<Expect Failed:fail this
<Including Fail Script: self_test_fail_script.txt


 === In Fail Script





 === FAIL=1





expect-lite directive: *NOINFO 

<expect-lite directive: *NOINFO


cvmiller@halaconia:~$ 

cvmiller@halaconia:~$ echo Good

Good

cvmiller@halaconia:~$ 

cvmiller@halaconia:~$ 

expect-lite directive: *NOWARN 



 === See no warning





cvmiller@halaconia:~$ 



Setting Expect Timeout to: 1 





 sleep 2

<expect-lite directive: *NOWARN
<sleep 2


cvmiller@halaconia:~$ 

cvmiller@halaconia:~$ 

expect-lite directive: *WARN 

<expect-lite directive: *WARN


cvmiller@halaconia:~$ 

 === See prompt timeout warning





cvmiller@halaconia:~$ 



Setting Expect Timeout to: 1 





 sleep 2

Warning:Prompt Timed Out!

<Warning:Prompt Timed Out!


cvmiller@halaconia:~$ 

cvmiller@halaconia:~$ 

cvmiller@halaconia:~$ 

cvmiller@halaconia:~$ 

 === Check timeout error



WARN: Bad Timeout Value: two 

<Check timeout error
<WARN: Bad Timeout Value: two


cvmiller@halaconia:~$ 

expect-lite directive: *INFO 

INFO: CONST FOUND: arg0 = self_test_directives.txt



 === check logging





expect-lite directive: *LOG /tmp/self_test_directives.txt.log 

<expect-lite directive: *LOG


cvmiller@halaconia:~$ echo hello

hello

cvmiller@halaconia:~$ 

expect-lite directive: *NOLOG 

INFO: CONST FOUND: arg0 = self_test_directives.txt

<expect-lite directive: *NOLOG


cvmiller@halaconia:~$ 

 === check log



grep hello /tmp/self_test_directives.txt.log

cvmiller@halaconia:~$ echo hello


hello


cvmiller@halaconia:~$ INFO: CONST FOUND: arg0 = self_test_directives.txt

expect-lite: Warning: Overwriting /tmp/self_test_directives.txt.log 



expect-lite directive: *LOG /tmp/self_test_directives.txt.log 



cvmiller@halaconia:~$ echo goodbye

goodbye

cvmiller@halaconia:~$ 

expect-lite directive: *NOLOG 



cvmiller@halaconia:~$ INFO: CONST FOUND: arg0 = self_test_directives.txt



cvmiller@halaconia:~$ 

 === check log append



egrep 'hello|goodbye' /tmp/self_test_directives.txt.log

cvmiller@halaconia:~$ echo goodbye


goodbye


cvmiller@halaconia:~$ 



 FAILED COMMAND:egrep 'hello|goodbye' /tmp/self_test_directives.txt.log 



    Expect Failed:\nhello





Including Fail Script: self_test_fail_script.txt





 === In Fail Script





 === FAIL=1





cvmiller@halaconia:~$ 



##Overall Result: FAILED (*NOFAIL on)





$ 

 FAILED COMMAND:expect-lite r=localhost c=self_test_directives.txt el=expect-lite  

    Expect Failed:expect-lite: Appending to log file

exit 
exit
$ 

##Overall Result: FAILED 


