* configure.ac, dejagnu.h, runtest, runtest.exp,
baseboards/am33_2.0-libremote.exp, baseboards/androideabi.exp,
baseboards/arm-ice.exp, baseboards/arm-sid.exp,
baseboards/arm-sim.exp, baseboards/basic-sid.exp,
baseboards/basic-sim.exp, baseboards/cris-sim.exp,
baseboards/d30v-sim.exp, baseboards/fr30-sim.exp,
baseboards/frv-sim.exp, baseboards/gdbserver-sample.exp,
baseboards/i386-sid.exp, baseboards/iq2000-sim.exp,
baseboards/jmr3904-sim.exp, baseboards/linux-gdbserver.exp,
baseboards/linux-libremote.exp, baseboards/m68k-sid.exp,
baseboards/mcore-moto-sim.exp, baseboards/mcore-sim.exp,
baseboards/mips-lnews-sim.exp, baseboards/mips-lsi-sim.exp,
baseboards/mips-sim-idt32.exp, baseboards/mips-sim-idt64.exp,
baseboards/mips-sim-mti32.exp, baseboards/mips-sim-mti64.exp,
baseboards/mips-sim-mti64_64.exp,
baseboards/mips-sim-mti64_n32.exp, baseboards/mips-sim-sde32.exp,
baseboards/mips-sim-sde64.exp, baseboards/mips-sim.exp,
baseboards/mmixware-sim.exp, baseboards/mn10200-sim.exp,
baseboards/mn10300-sim.exp, baseboards/moxie-sim.exp,
baseboards/mt-sid.exp, baseboards/multi-sim.exp,
baseboards/powerpc-sim.exp, baseboards/powerpcle-sim.exp,
baseboards/rx-sim.exp, baseboards/sh-sid.exp,
baseboards/sh-sim.exp, baseboards/sparc-sim.exp,
baseboards/sparc64-sim.exp, baseboards/sparclite-sim-le.exp,
baseboards/sparclite-sim.exp, baseboards/tx39-sim.exp,
baseboards/unix.exp, baseboards/v850-sim.exp,
baseboards/visium-sim.exp, baseboards/vr4100-sim.exp,
baseboards/vr4111-sim.exp, baseboards/vr4300-sim.exp,
baseboards/xtensa-sim.exp, lib/debugger.exp, lib/dejagnu.exp,
lib/dg.exp, lib/ftp.exp, lib/kermit.exp, lib/remote.exp,
lib/rlogin.exp, lib/rsh.exp, lib/standard.exp, lib/target.exp,
lib/targetdb.exp, lib/telnet.exp, lib/tip.exp, lib/utils.exp,
testsuite/config/default.exp, testsuite/lib/libsup.exp,
testsuite/lib/util-defs.exp, testsuite/libdejagnu/tunit.exp,
testsuite/libdejagnu/unit.cc, testsuite/runtest.all/libs.exp,
testsuite/runtest.all/stats-sub.exp,
testsuite/runtest.all/stats.exp, config/adb.exp,
config/default.exp, config/gdb-comm.exp, config/gdb_stub.exp,
config/sid.exp, config/sim.exp, config/unix.exp,
config/vxworks.exp: Update copyright date for 2016.
Signed-off-by: Ben Elliston <bje@gnu.org>
10 years ago
|
|
|
# Copyright (C) 1992-2016 Free Software Foundation, Inc.
|
|
|
|
|
#
|
|
|
|
|
# This file is part of DejaGnu.
|
|
|
|
|
#
|
|
|
|
|
# DejaGnu is free software; you can redistribute it and/or modify it
|
|
|
|
|
# under the terms of the GNU General Public License as published by
|
|
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# DejaGnu is distributed in the hope that it will be useful, but
|
|
|
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
# General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with DejaGnu; if not, write to the Free Software Foundation,
|
|
|
|
|
# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
|
|
# Connect to DEST using Kermit. Note that we're just using Kermit as a
|
|
|
|
|
# simple serial or network connect program; we don't actually use Kermit
|
|
|
|
|
# protocol to do downloads.
|
|
|
|
|
#
|
|
|
|
|
# Returns -1 if it failed, otherwise it returns the spawn_id.
|
|
|
|
|
#
|
|
|
|
|
proc kermit_open {dest args} {
|
|
|
|
|
global spawn_id
|
|
|
|
|
global board_info
|
|
|
|
|
|
* runtest.exp, baseboards/basic-sim.exp, baseboards/cf.exp,
baseboards/cris-sim.exp, baseboards/i960-cyclone.exp,
baseboards/mcore-moto-sim.exp, baseboards/mips64vr4100-sim.exp,
baseboards/mmixware-sim.exp, baseboards/op50n.exp,
baseboards/rom68k-idp.exp, baseboards/sparclite-sim-le.exp,
baseboards/usparc-cygmon.exp, config/base-config.exp,
config/base68k.exp, config/ddb-ether.exp, config/ddb.exp,
config/dos.exp, config/gdb-comm.exp, config/gdb_stub.exp,
config/i386-bozo.exp, config/i960.exp, config/m68k-emc.exp,
config/netware.exp, config/sid.exp, config/sim.exp,
config/tic80.exp, config/unix.exp, config/vxworks.exp,
lib/debugger.exp, lib/dejagnu.exp, lib/dg.exp, lib/framework.exp,
lib/ftp.exp, lib/kermit.exp, lib/libgloss.exp, lib/remote.exp,
lib/rlogin.exp, lib/rsh.exp, lib/target.exp, lib/targetdb.exp,
lib/telnet.exp, lib/tip.exp, lib/utils.exp: Put braces around if
expressions throughout.
20 years ago
|
|
|
if {[board_info $dest exists name]} {
|
|
|
|
|
set dest [board_info $dest name]
|
|
|
|
|
}
|
* runtest.exp, baseboards/basic-sim.exp, baseboards/cf.exp,
baseboards/cris-sim.exp, baseboards/i960-cyclone.exp,
baseboards/mcore-moto-sim.exp, baseboards/mips64vr4100-sim.exp,
baseboards/mmixware-sim.exp, baseboards/op50n.exp,
baseboards/rom68k-idp.exp, baseboards/sparclite-sim-le.exp,
baseboards/usparc-cygmon.exp, config/base-config.exp,
config/base68k.exp, config/ddb-ether.exp, config/ddb.exp,
config/dos.exp, config/gdb-comm.exp, config/gdb_stub.exp,
config/i386-bozo.exp, config/i960.exp, config/m68k-emc.exp,
config/netware.exp, config/sid.exp, config/sim.exp,
config/tic80.exp, config/unix.exp, config/vxworks.exp,
lib/debugger.exp, lib/dejagnu.exp, lib/dg.exp, lib/framework.exp,
lib/ftp.exp, lib/kermit.exp, lib/libgloss.exp, lib/remote.exp,
lib/rlogin.exp, lib/rsh.exp, lib/target.exp, lib/targetdb.exp,
lib/telnet.exp, lib/tip.exp, lib/utils.exp: Put braces around if
expressions throughout.
20 years ago
|
|
|
if {[board_info ${dest} exists serial]} {
|
|
|
|
|
set port [board_info ${dest} serial]
|
|
|
|
|
set device "-l [board_info ${dest} serial]"
|
* runtest.exp, baseboards/basic-sim.exp, baseboards/cf.exp,
baseboards/cris-sim.exp, baseboards/i960-cyclone.exp,
baseboards/mcore-moto-sim.exp, baseboards/mips64vr4100-sim.exp,
baseboards/mmixware-sim.exp, baseboards/op50n.exp,
baseboards/rom68k-idp.exp, baseboards/sparclite-sim-le.exp,
baseboards/usparc-cygmon.exp, config/base-config.exp,
config/base68k.exp, config/ddb-ether.exp, config/ddb.exp,
config/dos.exp, config/gdb-comm.exp, config/gdb_stub.exp,
config/i386-bozo.exp, config/i960.exp, config/m68k-emc.exp,
config/netware.exp, config/sid.exp, config/sim.exp,
config/tic80.exp, config/unix.exp, config/vxworks.exp,
lib/debugger.exp, lib/dejagnu.exp, lib/dg.exp, lib/framework.exp,
lib/ftp.exp, lib/kermit.exp, lib/libgloss.exp, lib/remote.exp,
lib/rlogin.exp, lib/rsh.exp, lib/target.exp, lib/targetdb.exp,
lib/telnet.exp, lib/tip.exp, lib/utils.exp: Put braces around if
expressions throughout.
20 years ago
|
|
|
if {[board_info ${dest} exists baud]} {
|
|
|
|
|
append device " -b [board_info ${dest} baud]"
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
set port [board_info ${dest} netport]
|
|
|
|
|
set device "-j [board_info ${dest} netport]"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set tries 0
|
|
|
|
|
set result -1
|
|
|
|
|
verbose "kermit $device"
|
|
|
|
|
eval spawn kermit $device
|
|
|
|
|
if {$spawn_id < 0} {
|
|
|
|
|
perror "invalid spawn id from Kermit"
|
|
|
|
|
return -1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
expect {
|
|
|
|
|
-re ".*ermit.*>.*$" {
|
|
|
|
|
send "c\n"
|
|
|
|
|
expect {
|
|
|
|
|
-re "Connecting to.*$port.*Type the escape character followed by C to.*options.*\[\r\n\]$" {
|
|
|
|
|
verbose "Got prompt\n"
|
|
|
|
|
set result 0
|
|
|
|
|
incr tries
|
|
|
|
|
}
|
|
|
|
|
timeout {
|
|
|
|
|
warning "Never got prompt from Kermit."
|
|
|
|
|
set result -1
|
|
|
|
|
incr tries
|
|
|
|
|
if {$tries <= 2} {
|
|
|
|
|
exp_continue
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
-re "Connection Closed.*$" {
|
|
|
|
|
perror "Never connected."
|
|
|
|
|
set result -1
|
|
|
|
|
incr tries
|
|
|
|
|
if {$tries <= 2} {
|
|
|
|
|
exp_continue
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
timeout {
|
|
|
|
|
warning "Timed out trying to connect."
|
|
|
|
|
set result -1
|
|
|
|
|
incr tries
|
|
|
|
|
if {$tries <= 2} {
|
|
|
|
|
exp_continue
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if {$result < 0} {
|
|
|
|
|
perror "Couldn't connect after $tries tries."
|
* runtest.exp, baseboards/basic-sim.exp, baseboards/cf.exp,
baseboards/cris-sim.exp, baseboards/i960-cyclone.exp,
baseboards/mcore-moto-sim.exp, baseboards/mips64vr4100-sim.exp,
baseboards/mmixware-sim.exp, baseboards/op50n.exp,
baseboards/rom68k-idp.exp, baseboards/sparclite-sim-le.exp,
baseboards/usparc-cygmon.exp, config/base-config.exp,
config/base68k.exp, config/ddb-ether.exp, config/ddb.exp,
config/dos.exp, config/gdb-comm.exp, config/gdb_stub.exp,
config/i386-bozo.exp, config/i960.exp, config/m68k-emc.exp,
config/netware.exp, config/sid.exp, config/sim.exp,
config/tic80.exp, config/unix.exp, config/vxworks.exp,
lib/debugger.exp, lib/dejagnu.exp, lib/dg.exp, lib/framework.exp,
lib/ftp.exp, lib/kermit.exp, lib/libgloss.exp, lib/remote.exp,
lib/rlogin.exp, lib/rsh.exp, lib/target.exp, lib/targetdb.exp,
lib/telnet.exp, lib/tip.exp, lib/utils.exp: Put braces around if
expressions throughout.
20 years ago
|
|
|
if {[info exists board_info($dest,fileid)]} {
|
|
|
|
|
unset board_info($dest,fileid)
|
|
|
|
|
}
|
|
|
|
|
return -1
|
|
|
|
|
} else {
|
|
|
|
|
verbose "Kermit connection established with spawn_id $spawn_id."
|
|
|
|
|
set board_info($dest,fileid) $spawn_id
|
|
|
|
|
kermit_command $dest "set file type binary" "set transfer display none"
|
* runtest.exp, baseboards/basic-sim.exp, baseboards/cf.exp,
baseboards/cris-sim.exp, baseboards/i960-cyclone.exp,
baseboards/mcore-moto-sim.exp, baseboards/mips64vr4100-sim.exp,
baseboards/mmixware-sim.exp, baseboards/op50n.exp,
baseboards/rom68k-idp.exp, baseboards/sparclite-sim-le.exp,
baseboards/usparc-cygmon.exp, config/base-config.exp,
config/base68k.exp, config/ddb-ether.exp, config/ddb.exp,
config/dos.exp, config/gdb-comm.exp, config/gdb_stub.exp,
config/i386-bozo.exp, config/i960.exp, config/m68k-emc.exp,
config/netware.exp, config/sid.exp, config/sim.exp,
config/tic80.exp, config/unix.exp, config/vxworks.exp,
lib/debugger.exp, lib/dejagnu.exp, lib/dg.exp, lib/framework.exp,
lib/ftp.exp, lib/kermit.exp, lib/libgloss.exp, lib/remote.exp,
lib/rlogin.exp, lib/rsh.exp, lib/target.exp, lib/targetdb.exp,
lib/telnet.exp, lib/tip.exp, lib/utils.exp: Put braces around if
expressions throughout.
20 years ago
|
|
|
if {[board_info $dest exists transmit_pause]} {
|
|
|
|
|
kermit_command $dest "set transmit pause [board_info $dest transmit_pause]"
|
|
|
|
|
}
|
|
|
|
|
return $spawn_id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Send a list of commands to the Kermit session connected to DEST.
|
|
|
|
|
#
|
|
|
|
|
proc kermit_command {dest args} {
|
* runtest.exp, baseboards/basic-sim.exp, baseboards/cf.exp,
baseboards/cris-sim.exp, baseboards/i960-cyclone.exp,
baseboards/mcore-moto-sim.exp, baseboards/mips64vr4100-sim.exp,
baseboards/mmixware-sim.exp, baseboards/op50n.exp,
baseboards/rom68k-idp.exp, baseboards/sparclite-sim-le.exp,
baseboards/usparc-cygmon.exp, config/base-config.exp,
config/base68k.exp, config/ddb-ether.exp, config/ddb.exp,
config/dos.exp, config/gdb-comm.exp, config/gdb_stub.exp,
config/i386-bozo.exp, config/i960.exp, config/m68k-emc.exp,
config/netware.exp, config/sid.exp, config/sim.exp,
config/tic80.exp, config/unix.exp, config/vxworks.exp,
lib/debugger.exp, lib/dejagnu.exp, lib/dg.exp, lib/framework.exp,
lib/ftp.exp, lib/kermit.exp, lib/libgloss.exp, lib/remote.exp,
lib/rlogin.exp, lib/rsh.exp, lib/target.exp, lib/targetdb.exp,
lib/telnet.exp, lib/tip.exp, lib/utils.exp: Put braces around if
expressions throughout.
20 years ago
|
|
|
if {[board_info $dest exists name]} {
|
|
|
|
|
set dest [board_info $dest name]
|
|
|
|
|
}
|
|
|
|
|
set shell_id [board_info $dest fileid]
|
|
|
|
|
|
|
|
|
|
# Sometimes we have to send multiple ^\c sequences. Don't know
|
|
|
|
|
# why.
|
|
|
|
|
set timeout 2
|
|
|
|
|
for {set i 1} {$i <= 5} {incr i} {
|
|
|
|
|
send -i $shell_id "c"
|
|
|
|
|
expect {
|
|
|
|
|
-i $shell_id -re ".*Back at.*ermit.*>.*$" {set i 10}
|
|
|
|
|
-i $shell_id timeout {
|
|
|
|
|
if {$i > 2} {
|
|
|
|
|
warning "Unable to get prompt from kermit."
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
foreach command $args {
|
|
|
|
|
set timeout 120
|
|
|
|
|
send -i $shell_id "${command}\r"
|
|
|
|
|
expect {
|
|
|
|
|
-i $shell_id -re ".*ermit.*>.*$" { }
|
|
|
|
|
-i $shell_id timeout {
|
|
|
|
|
perror "Response failed from Kermit."
|
|
|
|
|
return -1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
send -i $shell_id "c\r"
|
|
|
|
|
expect {
|
|
|
|
|
-i $shell_id -re ".*other options.\[\r\n\]+" { }
|
|
|
|
|
-i $shell_id timeout {
|
|
|
|
|
perror "Unable to resume Kermit connection."
|
|
|
|
|
return -1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Send STRING to DEST.
|
|
|
|
|
#
|
|
|
|
|
proc kermit_send {dest string args} {
|
* runtest.exp, baseboards/basic-sim.exp, baseboards/cf.exp,
baseboards/cris-sim.exp, baseboards/i960-cyclone.exp,
baseboards/mcore-moto-sim.exp, baseboards/mips64vr4100-sim.exp,
baseboards/mmixware-sim.exp, baseboards/op50n.exp,
baseboards/rom68k-idp.exp, baseboards/sparclite-sim-le.exp,
baseboards/usparc-cygmon.exp, config/base-config.exp,
config/base68k.exp, config/ddb-ether.exp, config/ddb.exp,
config/dos.exp, config/gdb-comm.exp, config/gdb_stub.exp,
config/i386-bozo.exp, config/i960.exp, config/m68k-emc.exp,
config/netware.exp, config/sid.exp, config/sim.exp,
config/tic80.exp, config/unix.exp, config/vxworks.exp,
lib/debugger.exp, lib/dejagnu.exp, lib/dg.exp, lib/framework.exp,
lib/ftp.exp, lib/kermit.exp, lib/libgloss.exp, lib/remote.exp,
lib/rlogin.exp, lib/rsh.exp, lib/target.exp, lib/targetdb.exp,
lib/telnet.exp, lib/tip.exp, lib/utils.exp: Put braces around if
expressions throughout.
20 years ago
|
|
|
if {[board_info $dest exists transmit_pause]} {
|
|
|
|
|
set f [open "/tmp/fff" "w"]
|
|
|
|
|
puts -nonewline $f "$string"
|
|
|
|
|
close $f
|
|
|
|
|
set result [remote_transmit $dest /tmp/fff]
|
|
|
|
|
remote_file build delete "/tmp/fff"
|
|
|
|
|
return "$result"
|
|
|
|
|
} else {
|
|
|
|
|
return [standard_send $dest $string]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Transmit FILE directly to DEST as raw data.
|
|
|
|
|
# No translation is performed.
|
|
|
|
|
#
|
|
|
|
|
proc kermit_transmit {dest file args} {
|
* runtest.exp, baseboards/basic-sim.exp, baseboards/cf.exp,
baseboards/cris-sim.exp, baseboards/i960-cyclone.exp,
baseboards/mcore-moto-sim.exp, baseboards/mips64vr4100-sim.exp,
baseboards/mmixware-sim.exp, baseboards/op50n.exp,
baseboards/rom68k-idp.exp, baseboards/sparclite-sim-le.exp,
baseboards/usparc-cygmon.exp, config/base-config.exp,
config/base68k.exp, config/ddb-ether.exp, config/ddb.exp,
config/dos.exp, config/gdb-comm.exp, config/gdb_stub.exp,
config/i386-bozo.exp, config/i960.exp, config/m68k-emc.exp,
config/netware.exp, config/sid.exp, config/sim.exp,
config/tic80.exp, config/unix.exp, config/vxworks.exp,
lib/debugger.exp, lib/dejagnu.exp, lib/dg.exp, lib/framework.exp,
lib/ftp.exp, lib/kermit.exp, lib/libgloss.exp, lib/remote.exp,
lib/rlogin.exp, lib/rsh.exp, lib/target.exp, lib/targetdb.exp,
lib/telnet.exp, lib/tip.exp, lib/utils.exp: Put braces around if
expressions throughout.
20 years ago
|
|
|
if {[board_info $dest exists transmit_pause]} {
|
|
|
|
|
kermit_command $dest "transmit $file"
|
|
|
|
|
return ""
|
|
|
|
|
} else {
|
|
|
|
|
return [standard_transmit $dest $file]
|
|
|
|
|
}
|
|
|
|
|
}
|