summaryrefslogtreecommitdiffstats
path: root/scripts/qemuimage-tests/sanity/scp
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/qemuimage-tests/sanity/scp')
-rwxr-xr-xscripts/qemuimage-tests/sanity/scp71
1 files changed, 0 insertions, 71 deletions
diff --git a/scripts/qemuimage-tests/sanity/scp b/scripts/qemuimage-tests/sanity/scp
deleted file mode 100755
index b0b693d0c8..0000000000
--- a/scripts/qemuimage-tests/sanity/scp
+++ /dev/null
@@ -1,71 +0,0 @@
1#!/bin/bash
2# SCP Test Case for Sanity Test
3# The case boot up the Qemu target with `runqemu qemuxxx`.
4# Then check if file can be copied into target with scp command.
5#
6# Author: Jiajun Xu <jiajun.xu@intel.com>
7#
8# This file is licensed under the GNU General Public License,
9# Version 2.
10#
11
12. $COREBASE/scripts/qemuimage-testlib
13
14TIMEOUT=400
15RET=1
16SPID=0
17i=0
18
19# Start qemu and check its network
20Test_Create_Qemu ${TIMEOUT}
21
22# If qemu network is up, check ssh service in qemu
23if [ $? -eq 0 ]; then
24 Test_Info "Begin to Test SSH Service in Qemu"
25 Test_SSH_UP ${TARGET_IPADDR} ${TIMEOUT}
26 RET=$?
27else
28 RET=1
29fi
30
31# Check if file can be copied from host into target
32# For qemu target, the file is 5M
33if [ $RET -eq 0 ]; then
34 echo $QEMUARCH | grep -q "qemu"
35
36 if [ $? -eq 0 ]; then
37 dd if=/dev/zero of=${TEST_TMP}/scp_test_file bs=512k count=10
38 Test_SCP ${TARGET_IPADDR} ${TEST_TMP}/scp_test_file /home/root &
39 SPID=$!
40 fi
41
42 # Check if scp finished or not
43 while [ $i -lt $TIMEOUT ]
44 do
45 ps -fp $SPID > /dev/null
46 if [ $? -ne 0 ]; then
47 RET=0
48 break
49 fi
50 i=$((i+5))
51 sleep 5
52 done
53
54 # Kill scp process if scp is not finished in time
55 if [ $i -ge $TIMEOUT ]; then
56 RET=1
57 kill $SPID
58 fi
59fi
60
61if [ ${RET} -eq 0 ]; then
62 Test_Info "SCP Test PASS"
63 Test_Kill_Qemu
64 Test_Print_Result "SCP" 0
65 exit 0
66else
67 Test_Info "SCP Test FAIL"
68 Test_Kill_Qemu
69 Test_Print_Result "SCP" 1
70 exit 1
71fi