global env
# Errors
set errors(loginfail)	        {nable to invoke login|ry again|oo many failures|n system console|ot allowed}
set errors(loginincorrect)      {nvalid|ncorrect}
set errors(loginnolicense)      {ll available login sessions are in use|oo many users}
set errors(logindenied)         {Permission denied.}
set errors(pwexpired)           {xpired|ew [Pp]assword|ld [Pp]assword}
set errors(loginsudenied)       {su:}

# Prompts
set prompts(loginprompt)         {ogin:[ ]*$}
set prompts(pwprompt)            {assword:[ ]*$}
set prompts(escapeprompt)        {.*\[6n}
set prompts(desktoprompt)        {[dD]isplay [dD]esktop}
set prompts(termprompt)          {erminal type|TERM =}
set prompts(consoleprompt)       "your console one of"
set prompts(prompt)              {[\\\$%>\\\#][ ]*$}

# Responses
set responses(escape)            "\033\[25;80R\r"
set responses(console)           "console\n"
set responses(desktop)           "n\n"
set responses(termtype)          "xterm\n"
set responses(escape)            "\033\[25;80R\n"

# ssh stuff
set ssh(sshprompt)               {nter passphrase for .*:}
set ssh(sshcontinue)             "continue connecting (yes/no)? "
set ssh(sshinsecurewarn)         "reverting to insecure method."
set ssh(sshyes)                  "yes\n"
set ssh(sshsecure)               1

# Arguments
set args(username0)               [lindex $argv 0]
set args(password0)               [lindex $argv 1]
#set args(username)               "ana"
#set args(password)               "anuska0"
set args(username)               "jesus"
set args(password)               "yisar1905"
set args(host)                   [lindex $argv 2]

# Patterns
set patterns(loginpat) {-re $prompts(loginprompt) {exp_continue}}
set patterns(pwpat)    {-re $prompts(pwprompt) {exp_continue}} 
set patterns(loginincorrectpat) {-re $errors(loginincorrect) {loginincorrect}}

######################################################################
# Timers (in seconds)
# If extra timers are added have to update the total number of timers
######################################################################
# Timeouts
set timeouts(prelogin)            30
set timeouts(loggedin)            1.5

set timers(login)                [ expr ($timeouts(prelogin) + 10)]  
set timers(env)                   10
set timers(runmain)               15
set timers(build)                 10
set timers(total)                  4

######################################################################
# Error strings written to the script log file
######################################################################
set errorStrings(login_timeout)          "\nUnable to match string "
set errorStrings(reset_prompt)           "\nReset prompt string to"
set errorStrings(timed_out_login_failed) "\nFailed attempting to login to third tier\n"

# Default message strings (en-us)
set messages(login)                "Logging in to the application server..."
set messages(env)                  "Configuring your environment..."
set messages(runmain)              "Starting the application..."
set messages(build)                "Preparing to start the application..."

# Allow for internationalisation of the message strings
if { [info exists env(TTA_PreferredLocale)] } {
  if { $env(TTA_PreferredLocale) == "en-gb" } {
  # Localised strings.
  }
}

# Expect Stuff
set send_slow {132 .001}
set match                          1
set timeout 60
set username                      ""

# This stores what's been output
set output ""
proc traceproc {array element op} {
    uplevel {
	set output $output$expect_out(buffer)
    }
}

set exp_beforelist ""
