URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc
- from Rev 552 to Rev 553
- ↔ Reverse comparison
Rev 552 → Rev 553
/trunk/gnu-src/run-all-tests.sh
132,7 → 132,7
expect -f - <<EOF > /dev/null 2>&1 |
spawn "${command}" |
|
set timeout 2 |
set timeout 30 |
expect { |
"${command}> " {} |
timeout {exit 1} |
140,7 → 140,6
|
send "open ${ip}\n" |
|
set timeout 5 |
expect { |
-re "${conn_prompt}" {} |
timeout {exit 2} |
148,7 → 147,6
|
send "root\n" |
|
set timeout 2 |
expect { |
-re "${op_prompt}" {} |
timeout {exit 3} |
156,7 → 154,6
|
send "exit\n" |
|
set timeout 5 |
expect { |
-re "${close_mess}" {exit 0} |
timeout {exit 4} |
267,14 → 264,25
|
# If the telnet or FTP to the IP address is dead, we assume the test |
# failed, the target machine having died (at last partially), so we return |
# failure. |
# failure having blown away that IP address. |
|
# We also need to fail if we see any TCL or expect error messages (with |
# the string "ERROR: ". These are indicative of transient failures. |
ip=`sed < ${tool}/${log_file} -n -e 's/OR32 target hostname is //p'` |
if check_telnet_ftp ${ip} |
then |
echo "Running ${test_file} on ${ip} completed successfully" |
res=0 |
if grep "ERROR: " ${tool}/${log_file} > /dev/null 2>&1 |
then |
echo "Running ${test_file} on ${ip} hit TCL/expect failure" |
mv ${tool}/${log_file} ${tool}/${log_file}-failed-$$-${index} |
mv ${tool}/${sum_file} ${tool}/${sum_file}-failed-$$-${index} |
res=1 |
else |
echo "Running ${test_file} on ${ip} completed successfully" |
res=0 |
fi |
else |
echo "Running ${test_file} on ${ip} died" |
echo "Running ${test_file} on ${ip} died with code $?" |
mv ${tool}/${log_file} ${tool}/${log_file}-failed-$$-${index} |
mv ${tool}/${sum_file} ${tool}/${sum_file}-failed-$$-${index} |
${root_dir}/get-ip.sh --delete ${ip} |
333,6 → 341,15
tool=$1 |
shift |
|
# If we have no IP addresses, give up here. |
if ${root_dir}/get-ip.sh > /dev/null 2>&1 |
then |
true |
else |
echo "No IP addresses - exiting" |
exit 1 |
fi |
|
# Create the local config file for DejaGnu |
create_local_config ${test_dir} |
|
347,13 → 364,30
# Run the test in the background |
( |
index=1 |
|
until run_test_block ${test_dir} ${src_dir} ${tool} ${t} ${index} |
do |
# Give up if there are no more IP addresses. |
if ${root_dir}/get-ip.sh > /dev/null 2>&1 |
then |
continue |
else |
break |
fi |
index=$(( ${index} + 1 )) |
done |
|
inc_count |
) & |
|
# If we have exhausted all the IP addresses, give up here. |
if ${root_dir}/get-ip.sh > /dev/null 2>&1 |
then |
true |
else |
echo "Out of IP addresses - exiting" |
exit 1 |
fi |
done |
} |
|
580,6 → 614,7
conformance-20#conformance.exp=${conf20_list} \ |
conformance-21#conformance.exp=${conf21_list}" |
|
|
run_tool_tests ${gcc_test_dir} ${gcc_src_dir} "gcc" ${gcc_test_list} |
run_tool_tests ${gcc_test_dir} ${gcc_src_dir} "g++" ${gpp_test_list} |
run_tool_tests ${lib_test_dir} ${lib_src_dir} "libstdc++" ${lib_test_list} |
/trunk/gnu-src/check-results.sh
29,7 → 29,8
tmpf=/tmp/check-results-$$ |
|
# Get the individual results if we have any. Note that we don't check for the |
# strings at start of line, since they may have FTP prompts showing. |
# strings at start of line, since they may have FTP prompts showing. Don't |
# print out lines which have no tests at all. |
echo " PASS FAIL XPASS XFAIL UNRES UNSUP UNTES TOTAL" |
|
if ls $* > /dev/null 2>&1 |
46,9 → 47,13
us=`grep 'UNSUPPORTED:' ${logfile} | wc -l` |
ut=`grep 'UNTESTED:' ${logfile} | wc -l` |
tot=`echo "${p} ${f} + ${xp} + ${xf} + ${ur} + ${us} + ${ut} + p" | dc` |
printf "%-25s %5d %5d %5d %5d %5d %5d %5d %5d\n" \ |
${tname} ${p} ${f} ${xp} ${xf} ${ur} ${us} ${ut} ${tot} | \ |
tee -a ${tmpf} |
|
if [ "x${tot}" != "x0" ] |
then |
printf "%-25s %5d %5d %5d %5d %5d %5d %5d %5d\n" \ |
${tname} ${p} ${f} ${xp} ${xf} ${ur} ${us} ${ut} ${tot} | \ |
tee -a ${tmpf} |
fi |
done |
fi |
|
/trunk/gnu-src/boards/or32-linux-sim.exp
27,26 → 27,46
# ----------------------------------------------------------------------------- |
# Custom proc to close a telnet session |
|
# @param[in] connhost The connected host being closed. |
# ----------------------------------------------------------------------------- |
proc telnet_close {connhost} { |
|
verbose "telnet_close: connhost $connhost" 3 |
|
# Use the standard close proc from remote.exp |
standard_close $connhost |
} |
|
|
# ----------------------------------------------------------------------------- |
# Custom proc to check if we have had too many failures |
|
# @param[in] boardname The board being closed. |
# ----------------------------------------------------------------------------- |
proc telnet_close {hostname} { |
proc telnet_failure_check { connhost errmess } { |
|
verbose "telnet_close: hostname $hostname" 3 |
# Get the maximum failure count |
set max_fc 10 |
|
# Get the connected host name, if it exists (actually, we think this can |
# never be set, but it is for consistency with telnet_open |
if {[board_info $hostname exists name]} { |
set connhost [board_info $hostname name] |
} else { |
set connhost $hostname |
if [board_info $connhost exists max_failure_count] { |
set max_fc [board_info $connhost max_failure_count] |
} |
verbose "telnet_failure_check: Max failure count $max_fc" |
|
if [board_info $connhost exists hostname] { |
set hostname [board_info $connhost hostname] |
# Increment the current failure count |
set fc 1 |
if [board_info $connhost exists failure_count] { |
verbose "telnet_failure_check: Incrementing failure count" |
set fc [expr [board_info $connhost failure_count] + 1] |
} |
set board_info($connhost,failure_count) $fc |
verbose "telnet_failure_check: current failure count is [board_info $fc" |
verbose "telnet_failure_check: board_info is [board_info $connhost failure_count]" |
|
# Use the standard close proc from remote.exp |
standard_close $connhost |
# Die if we are over the limit |
if {$fc >= $max_fc} { |
error "Too many failures: $errmess" |
} |
} |
|
|
56,9 → 76,11
# We seem to only pass in the first of the arguments supplied to the command. |
|
# The timeout is a mess. It seems to always be 10, not the timeout needed to |
# execute a regression test (typicall 300 seconds). Fixed by using our onw |
# execute a regression test (typicall 300 seconds). Fixed by using our own |
# timeout data. |
|
# It also seems that only the first argument is passed. |
|
# @param[in] hostname The board we are telnetting to |
# @param[in] cmd The command to run |
# @param[in] args Arguments to the command |
67,14 → 89,25
# ----------------------------------------------------------------------------- |
proc telnet_exec {hostname cmd args} { |
global timeout |
global verbos |
set output "(no output)" |
global verbose |
global spawn_id |
|
# Save the old timeout, since its global, and we'll want to restore it. |
set old_timeout $timeout |
# Get the connected host name, if it exists. This code matches |
# telnet_open. |
verbose "telnet_exec: original hostname is $hostname" |
|
verbose "Executing $hostname $cmd $args" |
if {[board_info $hostname exists name]} { |
set connhost [board_info $hostname name] |
} else { |
set connhost $hostname |
} |
verbose "telnet_exec: connhost is $connhost" |
|
if [board_info $connhost exists hostname] { |
set hostname [board_info $connhost hostname] |
} |
verbose "telnet_exec: hostname is $hostname" |
|
# Get the first argument, if any. |
if { [llength $args] > 0 } { |
set pargs [lindex $args 0]; |
82,108 → 115,164
set pargs "" |
} |
|
verbose "telnet_exec: executing on $connhost, command \"$cmd\", pargs \"$pargs\"" |
|
# Just check if we have more args. Potentially a second arg is an input |
# file. |
if { [llength $args] > 1 } { |
set tinp [lindex $args 1] |
if {$tinp != {}} { |
verbose "telnet_exec: long args: $args" |
} |
} |
|
# Set the shell prompt |
if [board_info $hostname exists shell_prompt] { |
set shell_prompt [board_info $hostname shell_prompt] |
if [board_info $connhost exists shell_prompt] { |
set shell_prompt [board_info $connhost shell_prompt] |
} elseif ![info exists shell_prompt] { |
# if no prompt, then set it to something generic |
set shell_prompt "\[^\r\n\]*\[$#\] " |
} |
if ![info exists shell_prompt] { # if no prompt, then set it to |
something generic |
set shell_prompt ".*> " |
} |
|
# Start a new telnet session if one doesn't already exist. If sucessful |
# the fileid field associated with $hostname will be set to the spawn_id |
# the fileid field associated with $connhost will be set to the spawn_id |
# of the new telnet process. |
if ![board_info $hostname exists fileid] { |
if {[telnet_open $hostname] == -1} { |
return [list -1 |
"telnet to $hostname failed for $cmd, couldn't begin telnet session"] |
if ![board_info $connhost exists fileid] { |
if {[telnet_open $connhost] == -1} { |
return [list -1 "telnet to $hostname failed for $cmd, couldn't begin telnet session"] |
} |
} |
|
# Make the telnet session the current process. Short timeout for this. |
set spawn_id [board_info $hostname fileid] |
set timeout 10 |
set spawn_id [board_info $connhost fileid] |
set timeout 30 |
|
#Hit enter to make sure you get a shell prompt |
send -- "\r" |
send "\r" |
|
expect { |
# A prompt indicates the current session is alive |
-re "$shell_prompt.*$" { |
verbose "Got a prompt" |
-re "$shell_prompt" { |
verbose "telnet_exec: got prompt at start" |
} |
default { |
# No response try closing the connection and reopening. |
telnet_close $hostname |
if {[telnet_open $hostname] != -1} { |
verbose "problem: hostname is \"$hostname\"" |
verbose "started new telnet session, spawn_id is [board_info $hostname fileid]" |
send -- "\r" |
# Timeout or EOF. Die if we have had too many failures |
telnet_failure_check $connhost "no prompt at telnet start" |
|
# Try closing the connection and reopening. |
telnet_close $connhost |
if {[telnet_open $connhost] != -1} { |
set spawn_id [board_info $connhost fileid] |
verbose "telnet_exec: new telnet session, spawn_id: $spawn_id" |
send "\r" |
exp_continue |
} else { |
set timeout $old_timeout |
return [list -1 "telnet to $hostname failed for $cmd, couldn't get |
a shell prompt"] |
return [list -1 "telnet to $hostname failed for $cmd, couldn't get a shell prompt"] |
} |
# I don't think we can get here. Comment out the old code and |
# trigger an error |
# send -- "\r" |
# exp_continue |
set timeout $old_timeout |
error "Problem reconnecting to telnet." |
} |
} |
|
# JPB to set custom timeout. Old timeout saved, so we can restore it, |
# since it's global. Not sure why we only use the first of the arguments. |
if [board_info $hostname exists telnet_exec_timeout] { |
set timeout [board_info $hostname telnet_exec_timeout] |
verbose "Telnet exec timeout set to $timeout" |
# Send the command. We can't cope with any input, so only the first |
# argument (group) is sent. |
send "$cmd $pargs\r" |
|
# We really should get the command echoed back immediately. This is a good |
# way of slurping up unexpected prompts. We first swap out any characters |
# from the command and args that might cause us grief. |
regsub -all "\\+" "$cmd $pargs" "." cmdpargs |
|
expect { |
"$cmdpargs" { |
verbose "telnet_exec: got command echoed back" |
} |
} |
|
# Set the telnet command custom timeout to wait for the command |
# prompt. Old timeout saved, so we can restore it, since it's global. |
set old_timeout $timeout |
|
if [board_info $connhost exists telnet_exec_timeout] { |
set timeout [board_info $connhost telnet_exec_timeout] |
verbose "telnet_exec: command timeout set to $timeout" |
} else { |
# Appropriate default |
set timeout 300 |
verbose "Telnet exec timeout set to default value $timeout" |
verbose "telnet_exec: command timeout set to default value $timeout" |
} |
|
send "$cmd $pargs\r" |
|
expect { |
-re "$shell_prompt.*$" { |
-re "$shell_prompt" { |
verbose "telnet_exec: got prompt after command" |
} |
timeout { |
if [info exists expect_out(buffer)] { |
set execute_output_string $expect_out(buffer) |
} |
default { |
# Give up on timeout or EOF |
set timeout $old_timeout |
telnet_close $hostname |
telnet_close $connhost |
return [list -1 "telnet to $hostname for $cmd $pargs failed (timeout)"] |
} |
} |
|
#Remove unnecessary strings from the output string |
# Restore the old timeout |
set timeout $old_timeout |
|
#If the file path contains any "+" signs, it will mess things up when $cmd |
#is used as a regsub pattern (2 lines down), so we replace all "+"s with "." |
regsub -all "\\+" $cmd "." cmd |
regsub -all $cmd "$expect_out(buffer)" {} output |
regsub "\(~ \)?$shell_prompt" $output {} output |
# Remove unnecessary strings from the output string |
verbose "telnet_exec: command expect_out(buffer): \"$expect_out(buffer)\"" |
regsub -all $cmdpargs "$expect_out(buffer)" {} output |
regsub "$shell_prompt" $output {} output |
regsub -all "\[\r\n\]" $output {} output |
|
#Check the return status. Use a short timeout for this. |
if {$output == ""} { |
set output "(no output)" |
} else { |
set output "\"$output\"" |
} |
|
verbose "telnet_exec: command output $output" |
|
# Check the return status. Use a short timeout for this. |
set timeout 30 |
send -- "echo \$?\r" |
expect -re "$shell_prompt.*$" |
send "echo \$?\r" |
|
#Regsub the output to get the status number |
# Once again, look for the "echo" reflected back as a way of slurping up |
# unexpected prompts. We don't worry about timeout here - we'll sort that |
# out on the next one. |
expect { |
-re "echo \\$\\?" { |
verbose "telnet_exec: got \"echo\" echoed back" |
} |
} |
|
expect { |
-re "$shell_prompt" { |
verbose "telnet_exec: got status shell prompt" |
} |
default { |
warning "No response to status request" |
|
# Die if we have had too many failures like this. |
telnet_failure_check $connhost "no shell prompt from status" |
|
# See if another carriage return will prompt a response |
send "\r" |
exp_continue |
} |
} |
|
# Regsub the output to get the status number |
verbose "telnet_exec: status expect_out(buffer): \"$expect_out(buffer)\"" |
regsub -all {echo \$\?} $expect_out(buffer) {} status |
regsub "\(~ \)?$shell_prompt" $status {} status |
regsub "$shell_prompt" $status {} status |
regsub -all "\[\r\n \]" $status {} status |
verbose "telnet_exec: status \"$status\"" |
|
#This probably isn't neccessary.. |
# This shouldn't be neccessary... |
if {[regexp {[0123456789]+} $status] != 1} { |
warning "status not a number, it is <$status>, setting it to 1" |
warning "status not a number (\"$status\"), setting to 1" |
verbose "telnet_exec: status (\"$status\"), expect_out(buffer): \"$expect_out(buffer)\"" |
set status 1 |
|
# Die if we have had too many failures like this. |
telnet_failure_check $connhost "bad status" |
} |
|
# Restore timeout |
371,7 → 460,7
set target_alias "or32-linux" |
|
set_board_info connect telnet |
set_board_info shell_prompt "# " |
set_board_info shell_prompt "\[^\r\n\]*# " |
set_board_info telnet_username "root" |
set_board_info telnet_password "" |
set_board_info telnet_exec_timeout 1200 |
/trunk/gnu-src/find-linuxes.sh
22,7 → 22,7
# ------------------------------------------------------------------------------ |
|
# IP list excluding all known IPs |
ip_list="192.168.0.2-39,41-59,61-79,81-127,129,130,133-255" |
ip_list="192.168.0.2-39,41-59,61-79,82-127,129,130,133-255" |
ip_file=`dirname ${DEJAGNU}`/ip-avail.txt |
|
# Keep using nmap until we get the same number of IP addresses twice running. |