summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity
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:32:13 +0000
commit19a626d6b3f39b151fd62dbf0594018cc112320e (patch)
tree518d70a32a0fa282ce1b97df6d7e86c894fd7531 /meta/recipes-connectivity
parent81b59e759ee6732ffd28a15244ed8529d096156a (diff)
downloadpoky-19a626d6b3f39b151fd62dbf0594018cc112320e.tar.gz
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 (From OE-Core rev: 5ca6bb9b73bf09c1847ec3e5a7477829bd3d77b5) Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity')
-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 @@
3export TEST_SHELL=sh 3export TEST_SHELL=sh
4 4
5cd regress 5cd regress
6sed -i "/\t\tagent-ptrace /d" Makefile
6make -k .OBJDIR=`pwd` .CURDIR=`pwd` SUDO="sudo" tests \ 7make -k .OBJDIR=`pwd` .CURDIR=`pwd` SUDO="sudo" tests \
7 | sed -e 's/^skipped/SKIP: /g' -e 's/^ok /PASS: /g' -e 's/^failed/FAIL: /g' 8 | sed -e 's/^skipped/SKIP: /g' -e 's/^ok /PASS: /g' -e 's/^failed/FAIL: /g'
9
10
11SSHAGENT=`which ssh-agent`
12GDB=`which gdb`
13
14if [ -z "${SSHAGENT}" -o -z "${GDB}" ]; then
15 echo "SKIP: agent-ptrace"
16fi
17
18useradd openssh-test
19
20eval `su -c "${SSHAGENT} -s" openssh-test` > /dev/null
21r=$?
22if [ $r -ne 0 ]; then
23 echo "FAIL: could not start ssh-agent: exit code $r"
24else
25 su -c "gdb -p ${SSH_AGENT_PID}" openssh-test > /tmp/gdb.out 2>&1 << EOF
26 quit
27EOF
28 r=$?
29 if [ $r -ne 0 ]; then
30 echo "gdb failed: exit code $r"
31 fi
32 egrep 'ptrace: Operation not permitted.|procfs:.*Permission denied.|ttrace.*Permission denied.|procfs:.*: Invalid argument.|Unable to access task ' >/dev/null /tmp/gdb.out
33 r=$?
34 rm -f /tmp/gdb.out
35 if [ $r -ne 0 ]; then
36 echo "FAIL: ptrace agant"
37 else
38 echo "PASS: ptrace agant"
39 fi
40
41 ${SSHAGENT} -k > /dev/null
42fi
43userdel openssh-test
44