xref: /OK3568_Linux_fs/debian/overlay-debug/rockchip-test/rockchip_test.sh (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/bash
2### file: rockchip-test.sh
3### function: ddr cpu gpio flash bt audio recovery s2r sdio/pcie(wifi)
4###           ethernet reboot ddrfreq npu camera video and so on.
5
6CURRENT_DIR=`dirname $0`
7
8moudle_env()
9{
10	export MODULE_CHOICE
11}
12
13module_choice()
14{
15    echo "******************************************************"
16    echo "***                                                ***"
17    echo "***          *****************************         ***"
18    echo "***          *    ROCKCHIPS TEST TOOLS   *         ***"
19    echo "***          *  V2.1 updated on 20230413 *         ***"
20    echo "***          *****************************         ***"
21    echo "***                                                ***"
22    echo "*****************************************************"
23
24
25    echo "*****************************************************"
26    echo "ddr test:              1 (ddr stress test)"
27    echo "cpu test:              2 (cpu stress test)"
28    echo "gpu test:              3 (gpu stress test)"
29    echo "npu test:              4 (npu stress test)"
30    echo "suspend_resume test:   5 (suspend resume)"
31    echo "reboot test:           6 (auto reboot test)"
32    echo "power lost test:       7 (power lost test)"
33    echo "flash stress test:     8 (flash stress test)"
34    echo "recovery test:         9 (recovery wipe all test)"
35    echo "audio test:           10 (audio test)"
36    echo "camera test:          11 (camera test)"
37    echo "video test:           12 (video test)"
38    echo "bluetooth test:       13 (bluetooth on off test)"
39    echo "wifi test:            14 (wifi on off test)"
40    echo "chromium test:        15 (chromium with video test)"
41    echo "hardware infomation:  16 (to get the hardware infomation)"
42    echo "*****************************************************"
43
44    read -t 30 -p "please input test moudle: " MODULE_CHOICE
45}
46
47npu_stress_test()
48{
49    bash ${CURRENT_DIR}/npu/npu_test.sh
50}
51
52npu2_stress_test()
53{
54    bash ${CURRENT_DIR}/npu2/npu_test.sh
55}
56
57ddr_test()
58{
59    bash ${CURRENT_DIR}/ddr/ddr_test.sh
60}
61
62cpu_test()
63{
64    bash ${CURRENT_DIR}/cpu/cpu_test.sh
65}
66
67flash_stress_test()
68{
69    bash ${CURRENT_DIR}/flash_test/flash_stress_test.sh 5 20000 &
70}
71
72recovery_test()
73{
74    bash ${CURRENT_DIR}/recovery/recovery_test.sh
75}
76
77suspend_resume_test()
78{
79    bash ${CURRENT_DIR}/suspend_resume/suspend_resume.sh
80}
81
82wifi_test()
83{
84    bash ${CURRENT_DIR}/wifibt/wifi_onoff.sh &
85}
86
87bluetooth_test()
88{
89    bash ${CURRENT_DIR}/wifibt/bt_onoff.sh &
90}
91
92audio_test()
93{
94    bash ${CURRENT_DIR}/audio/audio_functions_test.sh
95}
96
97auto_reboot_test()
98{
99    fcnt=/userdata/rockchip/reboot_cnt;
100    if [ -e "$fcnt" ]; then
101	rm -f $fcnt;
102    fi
103    bash ${CURRENT_DIR}/auto_reboot/auto_reboot.sh
104}
105
106camera_test()
107{
108    bash ${CURRENT_DIR}/camera/camera_test.sh
109}
110
111video_test()
112{
113    bash ${CURRENT_DIR}/video/video_test.sh
114}
115
116gpu_test()
117{
118    bash ${CURRENT_DIR}/gpu/gpu_test.sh
119}
120
121chromium_test()
122{
123    bash ${CURRENT_DIR}/chromium/chromium_test.sh
124}
125
126sys_info_get()
127{
128    bash ${CURRENT_DIR}/system_infomation/get_sys_info.sh
129}
130
131power_lost_test()
132{
133    fcnt=/userdata${CURRENT_DIR}/power_lost/reboot_cnt;
134    if [ -e "$fcnt" ]; then
135        rm -f $fcnt;
136    fi
137    bash ${CURRENT_DIR}/flash_test/power_lost_test.sh  &
138}
139
140module_test()
141{
142	case ${MODULE_CHOICE} in
143		1)
144			ddr_test
145			;;
146		2)
147			cpu_test
148			;;
149		3)
150			gpu_test
151			;;
152		4)
153			npu2_stress_test
154			;;
155		5)
156			suspend_resume_test
157			;;
158		6)
159			auto_reboot_test
160			;;
161		7)
162			power_lost_test
163			;;
164		8)
165			flash_stress_test
166			;;
167		9)
168			recovery_test
169			;;
170		10)
171			audio_test
172			;;
173		11)
174			camera_test
175			;;
176		12)
177			video_test
178			;;
179		13)
180			bluetooth_test
181			;;
182		14)
183			wifi_test
184			;;
185		15)
186			chromium_test
187			;;
188		16)
189			sys_info_get
190			;;
191	esac
192}
193
194module_choice
195module_test
196