-
Notifications
You must be signed in to change notification settings - Fork 0
/
vte
executable file
·129 lines (124 loc) · 4.32 KB
/
vte
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/bin/sh
###################################################################################################
#
# @file vte
#
# @brief shell script to mount the vte test suite for different platform from nfs
#
###################################################################################################
#
# Copyright (C) 2004, Freescale Semiconductor, Inc. All Rights Reserved
# THIS SOURCE CODE IS CONFIDENTIAL AND PROPRIETARY AND MAY NOT
# BE USED OR DISTRIBUTED WITHOUT THE WRITTEN PERMISSION OF
# Freescale Semiconductor, Inc.
#
###################################################################################################
#Revision History:
# Modification Tracking
#Author Date Number Description of Changes
#------------------------- ------------ ---------- -------------------------------------------
#Hake Huang/----- 20081007 N/A Initial version
#
###################################################################################################
TEST_SERVER=10.192.225.222
start_test()
{
TARGET=$(/mnt/nfs/tools/platfm.sh)
need_reboot=0
platfm=$(/mnt/nfs/tools/platfm.sh)
if [ -z "$TARGET" ]; then
return 1
fi
test_flag=$(cat /proc/cmdline | grep daily_test)
test_file=$(cat /proc/cmdline | sed 's/daily_test=/^/'| cut -d '^' -f 2 | cut -d " " -f 1)
if [ ! -z "$test_flag" ] && [ -e /mnt/nfs/vte_${TARGET}_d/runtest/${test_file} ]; then
#enable watchdog here
echo "start test in 30 seconds, or login then kill the test"
sleep 30
status=0
while [ $status -eq 0 ]
do
sleep 30
status=$(/mnt/nfs/tools/uclient 10.192.225.222 12500 ${platfm}_HELLO | grep ACK | wc -l)
if [ $status -eq 0 ]; then
need_reboot=1
fi
done
#chekc the uboot
release_flag=$(cat /proc/cmdline | sed 's/release=/^/'| cut -d '^' -f 2 | cut -d " " -f 1)
if [ $release_flag = "linaro" ]; then
echo "do not update uboot for linaro release"
else
if [ $platfm = "IMX6-SABREAUTO" ]; then
crc1=$(/mnt/nfs/tools/u-config_8k -g /dev/mmcblk0 | grep UVERSION | cut -d "=" -f 2)
crc2=$(/mnt/nfs/tools/u-config_8k -g /root/u-boot-${platfm}-config.bin | grep UVERSION | cut -d "=" -f 2)
else
crc1=$(/mnt/nfs/tools/u-config -g /dev/mmcblk0 | grep UVERSION | cut -d "=" -f 2)
crc2=$(/mnt/nfs/tools/u-config -g /root/u-boot-${platfm}-config.bin | grep UVERSION | cut -d "=" -f 2)
fi
if [ "$crc1" != "$crc2" ] && [ ! -z $crc1 ] && [ ! -z $crc2 ];then
echo "need update uboot"
dd if=/root/u-boot-${platfm}_d.bin of=/dev/mmcblk0 bs=1024 seek=1 skip=1
#dd if=/root/u-boot-${platfm}-config.bin of=/dev/mmcblk0 bs=1024 seek=768 count=256
/mnt/nfs/tools/setenv UVERSION ${crc2}
reboot
fi
fi
if [ $need_reboot -eq 1 ]; then
reboot
fi
/mnt/nfs/tools/uclient 10.192.225.222 12500 ${platfm}_REGIST
if [ $platfm = "IMX6-SABREAUTO" ]; then
insmod /mnt/nfs/vte_${TARGET}_d/testcases/bin/imx2_wd_test.ko timer_margin=25
else
insmod /mnt/nfs/vte_${TARGET}_d/testcases/bin/mxc_wd_test.ko timer_margin=25
fi
export CONTINUE=y
tstatus=$(/mnt/nfs/tools/uclient 10.192.225.222 12500 ${platfm}_HELLO | grep ACK | wc -l)
if [ $tstatus -gt 0 ]; then
cd /mnt/nfs/vte_${TARGET}_d && /mnt/nfs/vte_${TARGET}_d/mytest $test_file
#test finished start a process to reset board at
if [ $? -eq 0 ]; then
/mnt/nfs/tools/uclient 10.192.225.222 12500 ${platfm}_TESTEND &
fi
fi
while true;
do
sleep 1800;
#if no command can execute guess the rootfs is changed then reboot
ls / || reboot
if [ $release_flag = "linaro" ]; then
echo "do not check for linaro release"
else
kver=$(/mnt/nfs/tools/uclient 10.192.225.222 12500 ${platfm}_HELLO | grep KVER | cut -f 5 -d " ")
kh=$(uname -r | cut -d - -f 1)
if [ $(uname -r) != $kh$kver ]; then
#kernel changed restart test
status=$(/mnt/nfs/tools/uclient 10.192.225.222 12500 ${platfm}_HELLO | grep ACK | wc -l)
if [ $status -eq 1 ];then
reboot
fi
fi
fi
done
fi
}
if [ "$1" != "start" ]; then
echo "say goodby"
exit
fi
#enlarge the memory
echo 1 1 > /proc/sys/vm/lowmem_reserve_ratio
mount -t nfs -o nolock,tcp,rsize=1024,wsize=1024 ${TEST_SERVER}:/rootfs/wb /mnt/nfs
#check time
if [ $? -ne 0 ]; then
echo "mount test nfs failure..."
exit
fi
sleep 1
echo $(hostname -i) > /root/.mounts
/mnt/nfs/util/ntpdate 10.192.225.222
/sbin/hwclock -w
sleep 1
#/mnt/nfs/vte_${TARGET}/mytest
start_test