# How to use this expect-lite file, Lines that begin with:
#	'>' send to remote host, implies "wait for prompt"
#	'<' _MUST_ be received from the remote host, or this config script will fail
#	# are comment lines, and have no effect
#	; are printable (in stdout) comments, and have no other effect
#	@ change the expect timeout value
#	! Embedded Expect commands
# For more info see: expect-lite.html

#
# Test: 	tests editing with vi in expect-lite
# Assumptions:	vi is present
# Platforms: 	i386 & CDS
#



# Source common variable file for this test suite
~mod_common.inc

# Redefine test file to always be in /tmp
$local_char_test_file=/tmp/p_short$DATE.txt

; ==== $local_char_test_file
>
>
> sleep 1
>

#  If needed connect to DUT (PPC)
~$connect_manager


@1
; ==== Create Test File with vi
>vi $local_char_test_file
<~
>>:set noai
>>:%d
>>a
>>STATEFUL_RULE: rule_1

>>  RESET_STATE:
>>    EVENT "login"
>>    GV[1] = 0x02
>>    report { GV[1]:4}
>>    next_state STATE_1

>>  STATE STATE_1:
>>    EVENT "open"
>>    GV[1] = GV[1]+1
>>    report { 'test' }
>>    report { GV[1]:4}
>>    EVENT "END_OF_SUI"
>>    GV[1] = GV[1]+1


>^[
>>:wq
>clear
# ==== end of test file


>cat $local_char_test_file
>
