diff options
author | Roy Li <rongqing.li@windriver.com> | 2015-11-25 09:53:54 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-01 21:32:13 +0000 |
commit | 19a626d6b3f39b151fd62dbf0594018cc112320e (patch) | |
tree | 518d70a32a0fa282ce1b97df6d7e86c894fd7531 /meta/recipes-connectivity | |
parent | 81b59e759ee6732ffd28a15244ed8529d096156a (diff) | |
download | poky-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-x | meta/recipes-connectivity/openssh/openssh/run-ptest | 37 |
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 @@ | |||
3 | export TEST_SHELL=sh | 3 | export TEST_SHELL=sh |
4 | 4 | ||
5 | cd regress | 5 | cd regress |
6 | sed -i "/\t\tagent-ptrace /d" Makefile | ||
6 | make -k .OBJDIR=`pwd` .CURDIR=`pwd` SUDO="sudo" tests \ | 7 | make -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 | |||
11 | SSHAGENT=`which ssh-agent` | ||
12 | GDB=`which gdb` | ||
13 | |||
14 | if [ -z "${SSHAGENT}" -o -z "${GDB}" ]; then | ||
15 | echo "SKIP: agent-ptrace" | ||
16 | fi | ||
17 | |||
18 | useradd openssh-test | ||
19 | |||
20 | eval `su -c "${SSHAGENT} -s" openssh-test` > /dev/null | ||
21 | r=$? | ||
22 | if [ $r -ne 0 ]; then | ||
23 | echo "FAIL: could not start ssh-agent: exit code $r" | ||
24 | else | ||
25 | su -c "gdb -p ${SSH_AGENT_PID}" openssh-test > /tmp/gdb.out 2>&1 << EOF | ||
26 | quit | ||
27 | EOF | ||
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 | ||
42 | fi | ||
43 | userdel openssh-test | ||
44 | |||