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 "*****************************************************" 42 43 read -t 30 -p "please input test moudle: " MODULE_CHOICE 44} 45 46npu_stress_test() 47{ 48 bash ${CURRENT_DIR}/npu/npu_test.sh 49} 50 51npu2_stress_test() 52{ 53 bash ${CURRENT_DIR}/npu2/npu_test.sh 54} 55 56ddr_test() 57{ 58 bash ${CURRENT_DIR}/ddr/ddr_test.sh 59} 60 61cpu_test() 62{ 63 bash ${CURRENT_DIR}/cpu/cpu_test.sh 64} 65 66flash_stress_test() 67{ 68 bash ${CURRENT_DIR}/flash_test/flash_stress_test.sh 5 20000 & 69} 70 71recovery_test() 72{ 73 bash ${CURRENT_DIR}/recovery/recovery_test.sh 74} 75 76suspend_resume_test() 77{ 78 bash ${CURRENT_DIR}/suspend_resume/suspend_resume.sh 79} 80 81wifi_test() 82{ 83 bash ${CURRENT_DIR}/wifibt/wifi_onoff.sh & 84} 85 86bluetooth_test() 87{ 88 bash ${CURRENT_DIR}/wifibt/bt_onoff.sh & 89} 90 91audio_test() 92{ 93 bash ${CURRENT_DIR}/audio/audio_functions_test.sh 94} 95 96auto_reboot_test() 97{ 98 fcnt=/userdata/rockchip/reboot_cnt; 99 if [ -e "$fcnt" ]; then 100 rm -f $fcnt; 101 fi 102 bash ${CURRENT_DIR}/auto_reboot/auto_reboot.sh 103} 104 105camera_test() 106{ 107 bash ${CURRENT_DIR}/camera/camera_test.sh 108} 109 110video_test() 111{ 112 bash ${CURRENT_DIR}/video/video_test.sh 113} 114 115gpu_test() 116{ 117 bash ${CURRENT_DIR}/gpu/gpu_test.sh 118} 119 120chromium_test() 121{ 122 bash ${CURRENT_DIR}/chromium/chromium_test.sh 123} 124 125power_lost_test() 126{ 127 fcnt=/userdata${CURRENT_DIR}/power_lost/reboot_cnt; 128 if [ -e "$fcnt" ]; then 129 rm -f $fcnt; 130 fi 131 bash ${CURRENT_DIR}/flash_test/power_lost_test.sh & 132} 133 134module_test() 135{ 136 case ${MODULE_CHOICE} in 137 1) 138 ddr_test 139 ;; 140 2) 141 cpu_test 142 ;; 143 3) 144 gpu_test 145 ;; 146 4) 147 npu2_stress_test 148 ;; 149 5) 150 suspend_resume_test 151 ;; 152 6) 153 auto_reboot_test 154 ;; 155 7) 156 power_lost_test 157 ;; 158 8) 159 flash_stress_test 160 ;; 161 9) 162 recovery_test 163 ;; 164 10) 165 audio_test 166 ;; 167 11) 168 camera_test 169 ;; 170 12) 171 video_test 172 ;; 173 13) 174 bluetooth_test 175 ;; 176 14) 177 wifi_test 178 ;; 179 15) 180 chromium_test 181 ;; 182 esac 183} 184 185module_choice 186module_test 187