aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/testsuite/boards/local-remote-host.exp27
-rw-r--r--gdb/testsuite/lib/gdb.exp2
2 files changed, 25 insertions, 4 deletions
diff --git a/gdb/testsuite/boards/local-remote-host.exp b/gdb/testsuite/boards/local-remote-host.exp
index e208504..f265208 100644
--- a/gdb/testsuite/boards/local-remote-host.exp
+++ b/gdb/testsuite/boards/local-remote-host.exp
@@ -22,12 +22,33 @@
# Like local-remote-host-notty, but with readline/editing enabled.
-global GDB
-set GDB [file join [pwd] "../gdb"]
+set GDB [file normalize [file join [pwd] "../gdb"]]
set_board_info hostname 127.0.0.1
-set_board_info username $env(USER)
+if { [info exists REMOTE_HOST_USERNAME] } {
+ set_board_info username $REMOTE_HOST_USERNAME
+} else {
+ set_board_info username $env(USER)
+}
+
+# Handle separate test account.
+if { [board_info $board username] != $env(USER) } {
+ # We're pretending that some local user account is remote host.
+ # Make things a bit more realistic by restricting file permissions.
+
+ # Make sure remote host can't see files on build.
+ remote_exec build "chmod go-rx $objdir"
+
+ # Make sure build can't see files on remote host. We can't use
+ # remote_exec host, because we're in the middle of parsing the
+ # host board.
+ remote_exec build \
+ "[board_info $board rsh_prog] \
+ -l [board_info $board username] \
+ [board_info $board hostname] \
+ chmod go-rx ."
+}
# The ssh key should be correctly set up that you ssh to 127.0.0.1
# without having to type password.
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 7ceb702..8f3bbd9 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -176,7 +176,7 @@ verbose "using GDB = $GDB" 2
# we're testing a non-installed GDB in the build directory. Users may
# also explictly override the -data-directory from the command line.
if ![info exists GDB_DATA_DIRECTORY] {
- set GDB_DATA_DIRECTORY "[pwd]/../data-directory"
+ set GDB_DATA_DIRECTORY [file normalize "[pwd]/../data-directory"]
}
verbose "using GDB_DATA_DIRECTORY = $GDB_DATA_DIRECTORY" 2