summaryrefslogtreecommitdiff
path: root/meta/recipes-connectivity/openssh
diff options
context:
space:
mode:
authorRoy Li <rongqing.li@windriver.com>2015-11-25 09:53:54 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-01 21:31:03 +0000
commit5ca6bb9b73bf09c1847ec3e5a7477829bd3d77b5 (patch)
treed0d4409dec5123cbcde833debf00a6afa8b33ef1 /meta/recipes-connectivity/openssh
parentdbdcd87144cc1cd6c5d50c800c7f266aaf25ca17 (diff)
downloadopenembedded-core-5ca6bb9b73bf09c1847ec3e5a7477829bd3d77b5.tar.gz
openembedded-core-5ca6bb9b73bf09c1847ec3e5a7477829bd3d77b5.tar.bz2
openembedded-core-5ca6bb9b73bf09c1847ec3e5a7477829bd3d77b5.zip
openssh: redesign ssh-agent.sh regression test case
ssh-agent regression test case should be run by non-root user, but non-root user will has issue to run other testcase, so rewrite it on run-ptest Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-connectivity/openssh')
-rwxr-xr-xmeta/recipes-connectivity/openssh/openssh/run-ptest37
1 files changed, 37 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh/run-ptest b/meta/recipes-connectivity/openssh/openssh/run-ptest
index 564c0c8256..769162e0c8 100755
--- a/meta/recipes-connectivity/openssh/openssh/run-ptest
+++ b/meta/recipes-connectivity/openssh/openssh/run-ptest
@@ -3,5 +3,42 @@
export TEST_SHELL=sh
cd regress
+sed -i "/\t\tagent-ptrace /d" Makefile
make -k .OBJDIR=`pwd` .CURDIR=`pwd` SUDO="sudo" tests \
| sed -e 's/^skipped/SKIP: /g' -e 's/^ok /PASS: /g' -e 's/^failed/FAIL: /g'
+
+
+SSHAGENT=`which ssh-agent`
+GDB=`which gdb`
+
+if [ -z "${SSHAGENT}" -o -z "${GDB}" ]; then
+ echo "SKIP: agent-ptrace"
+fi
+
+useradd openssh-test
+
+eval `su -c "${SSHAGENT} -s" openssh-test` > /dev/null
+r=$?
+if [ $r -ne 0 ]; then
+ echo "FAIL: could not start ssh-agent: exit code $r"
+else
+ su -c "gdb -p ${SSH_AGENT_PID}" openssh-test > /tmp/gdb.out 2>&1 << EOF
+ quit
+EOF
+ r=$?
+ if [ $r -ne 0 ]; then
+ echo "gdb failed: exit code $r"
+ fi
+ egrep 'ptrace: Operation not permitted.|procfs:.*Permission denied.|ttrace.*Permission denied.|procfs:.*: Invalid argument.|Unable to access task ' >/dev/null /tmp/gdb.out
+ r=$?
+ rm -f /tmp/gdb.out
+ if [ $r -ne 0 ]; then
+ echo "FAIL: ptrace agant"
+ else
+ echo "PASS: ptrace agant"
+ fi
+
+ ${SSHAGENT} -k > /dev/null
+fi
+userdel openssh-test
+