forked from wolfSSL/wolfssh
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexternal.test
More file actions
executable file
·69 lines (56 loc) · 1.4 KB
/
Copy pathexternal.test
File metadata and controls
executable file
·69 lines (56 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh
# external tests
host="$WOLFSSH_EXTERNAL_HOST"
user="$WOLFSSH_EXTERNAL_USER"
password="$WOLFSSH_EXTERNAL_PASSWORD"
if test -n "$WOLFSSH_EXTERNAL_TEST"; then
echo "WOLFSSH_EXTERNAL_TEST set, running test..."
else
echo "WOLFSSH_EXTERNAL_TEST NOT set, won't run"
exit 77
fi
# test for nonblocking only
./examples/client/client -h | grep WOLFSSH_TEST_BLOCK
if [ $? -eq 0 ]
then
echo "macro NO_WOLFSSH_CLIENT was used"
echo "skipping for now"
exit 77
fi
do_cleanup() {
echo "in cleanup"
}
do_trap() {
echo "got trap"
do_cleanup
exit -1
}
trap do_trap INT TERM
[ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1
echo "Testing client connection to $host : "
./examples/client/client -u $user -P $password -h $host -p 22 -x
RESULT=$?
if [ $RESULT -ne 0 ]; then
echo -e "failed to connect\n"
do_cleanup
exit 1
fi
echo -e "Success\n"
# not having the sftp client built in is not a failure case
./examples/sftpclient/wolfsftp -h
if [ $? -eq 0 ]; then
echo "Testing wolfsftp connection to $host : "
echo "exit" | ./examples/sftpclient/wolfsftp -u $user -P $password -h $host -p 22
RESULT=$?
if [ $RESULT -ne 0 ]; then
echo -e "failed to connect\n"
do_cleanup
exit 1
else
echo -e "Success\n"
fi
else
echo -e "\n\nwolfSFTP client doesn't exist"
fi
echo -e "\nALL Tests Passed"
exit 0