aboutsummaryrefslogtreecommitdiff
path: root/run_stress_switcher_tests.sh
blob: bd323f513ece9ce49677994e52cb6d58c5aff388 (plain)
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
# Copyright (C) 2012, Linaro Limited.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#
# Author: Amit Pundir <amit.pundir@linaro.org>
# Modified-by: Naresh Kamboju <naresh.kamboju@linaro.org> 
#

usage()
{
        echo ""
        echo "usage: $0 [<option> <argument>] .."
        echo "Options: -a [Run all tests]"
        echo "         -b [Run all basic module and switcher tests]"
        echo "         -c [Run all cache-coherency tests]"
        echo "         -d [Run all data-corruption tests]"
        echo "         -i [Run all disk-io tests]"
        echo "         -g [Run all governor tests]"
        echo "         -m [Run all memory tests]"
        echo "         -p [Run all perf tests]"
        echo "         -s [Run only switcher tests]"
        echo "         -v [Run all vfp-ffmpeg tests]"
        echo "         -t <specify the test-id(s)> [Run the specified tests]"
        echo "            [ 1 : cache-coherency-a7]"
        echo "            [ 2 : cache-coherency-a15]"
        echo "            [ 3 : cache-coherency-switching]"
        echo "            [ 4 : data-corruption-a7]"
        echo "            [ 5 : data-corruption-a15]"
        echo "            [ 6 : data-corruption-switching]"
        echo "            [ 7 : disk-io-stress-a7]"
        echo "            [ 8 : disk-io-stress-a15]"
        echo "            [ 9 : disk-io-stress-switching]"
        echo "            [10 : mem-stress-a7]"
        echo "            [11 : mem-stress-a15]"
        echo "            [12 : mem-stress-switching]"
        echo "            [13 : bl-basic-tests]"
        echo "            [14 : switcher-tests]"
        echo "            [15 : vfp-ffmpeg-a7]"
        echo "            [16 : vfp-ffmpeg-a15]"
        echo "            [17 : vfp-ffmpeg-switching]"
        echo "            [18 : interactive-governor-test]"
	echo "            [19 : cache-coherency-simultaneous-thread-switching]"
	echo "            [20 : data-corruption-simultaneous-thread-switching]"
	echo "            [21 : disk-io-stress-simultaneous-thread-switching]"
	echo "            [22 : mem-stress-simultaneous-thread-switching]"
	echo "            [23 : vfp-ffmpeg-simultaneous-thread-switching]"
	echo "            [24 : perf-mem-stress-a7]"
	echo "            [25 : perf-mem-stress-a15]"
	echo "            [26 : perf-mem-stress-switching]"
	echo "            [27 : perf-disk-io-stress-a7]"
	echo "            [28 : perf-disk-io-stress-a15]"
	echo "            [29 : perf-disk-io-stress-switching]"
	echo "       	  [30 : cpu-freq-vs-cluster-freq]"
        echo ""
        exit 1
}

enable_switcher ()
{
	echo 1 > /sys/kernel/bL_switcher/active
	SWITCHER_STATUS=`cat /sys/kernel/bL_switcher/active`
	if [ $SWITCHER_STATUS -eq 1 ] ; then
		echo "Switcher enabled"
	else
		echo "Failed"
		echo "cat /sys/kernel/bL_switcher/active != 1"
		echo "Switcher not supported on this kernel"
		echo "Test execution aborted"
		exit 1
	fi
}

disable_switcher ()
{
	echo 0 > /sys/kernel/bL_switcher/active
	SWITCHER_STATUS=`cat /sys/kernel/bL_switcher/active`
	if [ $SWITCHER_STATUS -eq 0 ] ; then
		echo "Switcher disabled"
	else
		echo "Failed"
		echo "cat /sys/kernel/bL_switcher/active != 0"
		echo "Switcher not supported on this kernel"
		echo "Test execution aborted"
		exit 1
	fi
}

check_kernel_oops()
{
	KERNEL_ERR=`dmesg | grep "Unable to handle kernel "`
	if [ -n "$KERNEL_ERR" ]; then
		echo "Kernel OOPS. Abort!!"
		exit 1
	fi
}

test_insert_module()
{
	echo ""

	ANDROID_MOD_PATH=/system/modules
	UBUNTU_MOD_PATH=/lib/modules/`uname -r`/kernel/drivers/cpufreq
	if [ -d $ANDROID_MOD_PATH ]; then
   		 MOD_LOCATION=$ANDROID_MOD_PATH/arm-bl-cpufreq.ko
	else if [ -d $UBUNTU_MOD_PATH ]; then
    		MOD_LOCATION=$UBUNTU_MOD_PATH/arm-bl-cpufreq.ko
    		ONDEMAND_MOD_LOCATION=$UBUNTU_MOD_PATH/cpufreq_ondemand.ko
	else
    		echo "ERROR: No arm-bl-cpufreq.ko module found"
    		exit 1
		fi
	fi
	CPU_FREQ_KM=`lsmod | grep cpufreq | awk '{print $1}'`
	if [ -z "$CPU_FREQ_KM" ]; then
		if [ -d $ANDROID_MOD_PATH ]; then
	# on Android none of the module is expected to be loaded as default
			echo "" 
		elif [ -d $UBUNTU_MOD_PATH ]; then
	# On Ubuntu below two modules are expected to be loaded as default 
			insmod $MOD_LOCATION
			insmod $ONDEMAND_MOD_LOCATION
		fi
	fi
}


test_remove_module()
{
	echo ""

	ANDROID_MOD_PATH=/system/modules
	UBUNTU_MOD_PATH=/lib/modules/`uname -r`/kernel/drivers/cpufreq

	CPU_FREQ_KM=`lsmod | grep cpufreq | awk '{print $1}'`
	if [ -n "$CPU_FREQ_KM" ]; then
		if [ -d $ANDROID_MOD_PATH ]; then
	# On Android remove module if any loaded 
			rmmod arm_bl_cpufreq > /dev/null 2>&1
		elif [ -d $UBUNTU_MOD_PATH ]; then
	# On Ubuntu remove modules if any loaded
	# /etc/init.d/ondemand will load cpufreq_ondemand after
	# 60 sec from the boot time. if we remove modules right
	# away. cpufreq_ondemand will load again which we do want.
	# we will wait here for 90 sec and remove modules
	# I know this is ugly hack, but left no other option.
	# TODO: if /etc/init.d/ondemand is not exists in distro
	# remove sleep
			sleep 90
			echo "list of modules present"
			lsmod
			echo "remove modules arm_bl_cpufreq & cpufreq_ondemand"
			rmmod arm_bl_cpufreq > /dev/null  2>&1
			rmmod cpufreq_ondemand > /dev/null  2>&1
		fi
	fi
}

test_remove_android_module()
{
	echo ""

	ANDROID_MOD_PATH=/system/modules

	CPU_FREQ_KM=`lsmod | grep cpufreq | awk '{print $1}'`
	if [ -n "$CPU_FREQ_KM" ]; then
		if [ -d $ANDROID_MOD_PATH ]; then
	# On Android remove module if any loaded before exit 
			rmmod arm_bl_cpufreq > /dev/null  2>&1
		fi
	fi
}

test_init() 
{
	# Remove the module(s). 
	# Let Each Test case will insert whenever it is required
	echo ""
	echo "test init"
	test_remove_module
}

test_cleanup()
{
	echo "test cleanup"
	# To make default Env Insert modules back on Ubuntu
	test_insert_module
	# To make default Env Remove module from Android
	test_remove_android_module
	# ensure every thing is perfect
	check_kernel_oops
	echo "cleanup done"
}

trap_handler() 
{
	echo "Abnormal Exit"
	test_cleanup
	echo "cleanup done"
	exit 1
}

get_no_of_cpu()
{

	TASKSET=affinity_tools

	CPU_FAST=
	CPU_SLOW=

	NO_OF_CPU_FAST=
	NO_OF_CPU_SLOW=
	#ARM
	IMPLEMENTER=0x41
	#A7
	PART_SLOW=0xc07
	#A15
	PART_FAST=0xc0f
	eachslow=
	eachfast=
	total_no_of_cpu=`ls /sys/devices/system/cpu/cpu*/online | wc -l`
#	echo " total_no_of_cpu= $total_no_of_cpu"

	cpu=0
	while [ $cpu -lt $total_no_of_cpu ];
	do
	$TASKSET -part $cpu,$IMPLEMENTER,$PART_SLOW >/dev/null
		if [ $? == 0 ] ; then
			eachslow=" -c "
			CPU_SLOW=$CPU_SLOW$eachslow$cpu
		fi
	$TASKSET -part $cpu,$IMPLEMENTER,$PART_FAST >/dev/null
		if [ $? == 0 ] ; then
			eachfast=" -c "
			CPU_FAST=$CPU_FAST$eachfast$cpu
		fi
		cpu=$((cpu+1))
	done
	EACH_CPU="$CPU_SLOW$CPU_FAST"
#	echo " EACH_CPU = $EACH_CPU"	

	cpu=0
	no_of_cpus=" -n"
	while [ $cpu -lt $total_no_of_cpu ];
	do
	$TASKSET -part $cpu,$IMPLEMENTER,$PART_SLOW >/dev/null
		if [ $? == 0 ] ; then
			spaceslow=" "
			NO_OF_CPU_SLOW=$NO_OF_CPU_SLOW$spaceslow$cpu
		fi
	$TASKSET -part $cpu,$IMPLEMENTER,$PART_FAST >/dev/null
		if [ $? == 0 ] ; then
			spacefast=" "
			NO_OF_CPU_FAST=$NO_OF_CPU_FAST$spacefast$cpu
		fi
		cpu=$((cpu+1))
	done
	NO_OF_CPUS="$no_of_cpus$NO_OF_CPU_SLOW$NO_OF_CPU_FAST"
#	echo "NO_OF_CPUS : $NO_OF_CPUS"
}

set_userspce_governor()
{
	GOVERNOR="userspace"
	for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
	do echo $GOVERNOR > $file
	done
	sleep 5;
}

run_test()
{
	TOTAL_TESTS=$((TOTAL_TESTS+1))
	echo ""
	echo "Running $1 .."
	$2
	ERR_CODE=$?
	if [ $ERR_CODE -ne 0 ]; then
		echo "$1 : FAIL"
		FAIL_TESTS=$((FAIL_TESTS+1))
	else
		echo "$1 : PASS"
		PASS_TESTS=$((PASS_TESTS+1))
	fi
}

run_all_cache_coherency_tests()
{
	echo ""
	echo "Running all cache-coherency tests .."
	run_test cache-coherency-a7 "cache-coherency-switcher.sh -f little $EACH_CPU"
	run_test cache-coherency-a15 "cache-coherency-switcher.sh -f big $EACH_CPU"
	run_test cache-coherency-switching "cache-coherency-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
	run_test cache-coherency-simultaneous-thread-switching "cache-coherency-switcher.sh -f big -c 0 $NO_OF_CPUS -s 100 -S"
}

run_all_data_corruption_tests()
{
	echo ""
	echo "Running all data-corruption tests .."
	run_test data-corruption-a7 "data-corruption-switcher.sh -f little $EACH_CPU"
	run_test data-corruption-a15 "data-corruption-switcher.sh -f big $EACH_CPU"
	run_test data-corruption-switching "data-corruption-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
	run_test data-corruption-simultaneous-thread-switching "data-corruption-switcher.sh -f big -c 0 $NO_OF_CPUS -s 100 -S"
}

run_all_disk_io_tests()
{
	echo ""
	echo "Running all disk-io tests .."
	run_test disk-io-stress-a7 "disk-io-stress-switcher.sh -f little $EACH_CPU"
	run_test disk-io-stress-a15 "disk-io-stress-switcher.sh -f big $EACH_CPU"
	run_test disk-io-stress-switching "disk-io-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
	run_test disk-io-stress-simultaneous-thread-switching "disk-io-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -s 100 -S"
}

run_all_memory_tests()
{
	echo ""
	echo "Running all memory tests .."
	run_test mem-stress-a7 "mem-stress-switcher.sh -f little $EACH_CPU"
	run_test mem-stress-a15 "mem-stress-switcher.sh -f big $EACH_CPU"
	run_test mem-stress-switching "mem-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
	run_test mem-stress-simultaneous-thread-switching "mem-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -s 100 -S"
}

run_all_switching_tests()
{
	echo ""
	echo "Running all switching tests .."
	run_test mem-stress-switching "mem-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
	run_test data-corruption-switching "data-corruption-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
	run_test disk-io-stress-switching "disk-io-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
	run_test cache-coherency-switching "cache-coherency-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
	run_test vfp-ffmpeg-switching "vfp-ffmpeg-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
	run_test cache-coherency-simultaneous-thread-switching "cache-coherency-switcher.sh -f big -c 0 $NO_OF_CPUS -s 100 -S"
	run_test data-corruption-simultaneous-thread-switching "data-corruption-switcher.sh -f big -c 0 $NO_OF_CPUS -s 100 -S"
	run_test disk-io-stress-simultaneous-thread-switching "disk-io-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -s 100 -S"
	run_test mem-stress-simultaneous-thread-switching "mem-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -s 100 -S"
	run_test vfp-ffmpeg-simultaneous-thread-switching "vfp-ffmpeg-switcher.sh -f big -c 0 $NO_OF_CPUS -s 100 -S"
	run_test perf-mem-stress-switching "perf-mem-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
	run_test perf-disk-io-stress-switching "perf-disk-io-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
}

run_all_vfp_ffmpeg_tests()
{
	echo ""
	echo "Running all vfp-ffmpeg tests .."
	run_test vfp-ffmpeg-a7 "vfp-ffmpeg-switcher.sh -f little $EACH_CPU"
	run_test vfp-ffmpeg-a15 "vfp-ffmpeg-switcher.sh -f big $EACH_CPU"
	run_test vfp-ffmpeg-switching "vfp-ffmpeg-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
	run_test vfp-ffmpeg-simultaneous-thread-switching "vfp-ffmpeg-switcher.sh -f big -c 0 $NO_OF_CPUS -s 100 -S"
}

run_all_basic_module_switcher_tests()
{
	echo ""
	echo "Running basic module and switcher tests .."
	run_test bl-basic-tests "run-bl-basic-tests.sh"
	run_test switcher-tests "switcher-tests.sh"
	# This test intended for TC2 only
	if [ "$MODEL" = "V2P-CA15_CA7" ]; then
		run_test cpu-freq-vs-cluster-freq "cpu_freq_vs_cluster_freq.sh"
	fi
}

run_all_governor_tests()
{
	echo ""
	echo "Running governor tests .."
	run_test interactive-governor-tests "interactive-governor-test.sh"
}

run_all_perf_tests()
{
	echo ""
	echo "Running perf tests .."
	run_test perf-mem-stress-a7 "perf-mem-stress-switcher.sh -f little $EACH_CPU -a7 1"
	run_test perf-mem-stress-a15 "perf-mem-stress-switcher.sh -f big $EACH_CPU -a15 1"
	run_test perf-mem-stress-switching "perf-mem-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
	run_test perf-disk-io-stress-a7 "perf-disk-io-stress-switcher.sh -f little $EACH_CPU -a7 1"
	run_test perf-disk-io-stress-a15 "perf-disk-io-stress-switcher.sh -f big $EACH_CPU -a15 1"
	run_test perf-disk-io-stress-switching "perf-disk-io-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"

}

run_all_tests()
{
	echo ""
	echo "Running all tests .."
	run_all_basic_module_switcher_tests
	run_all_memory_tests
	run_all_disk_io_tests
	run_all_data_corruption_tests
	run_all_cache_coherency_tests
	run_all_vfp_ffmpeg_tests
#       perf tests are deprecated on IKS
#       https://bugs.launchpad.net/linaro-big-little-system/+bug/1183821
#	run_all_perf_tests
	run_all_governor_tests
}

summary()
{
	echo ""
	echo "Summary .."
	echo "Total Tests = $TOTAL_TESTS"
	echo "Tests Passed = $PASS_TESTS"
	echo "Tests Failed = $FAIL_TESTS"
}

if [ -z "$1" ]; then
	usage
fi

TOTAL_TESTS=0
PASS_TESTS=0
FAIL_TESTS=0

MODEL=`cat /proc/device-tree/model`

# I feel below three signal are good enough to handle
# trap trap_handler SIGINT SIGTERM SIGTSTP
trap trap_handler 2 15 20 

# enable switcher
enable_switcher

# get no of cpus online
get_no_of_cpu

# For TC2
if [ "$MODEL" = "V2P-CA15_CA7" ]; then
	# Test setup before real test start 
	set_userspce_governor
fi
# For RTSM
if [ "$MODEL" = "RTSM_VE_CortexA15x4-A7x4" ]; then
	# Test setup before real test start 
	test_init
fi

while [ "$1" ]; do
	case "$1" in
	-a|--all)
		run_all_tests
		;;
	-b|--basic-tests)
		run_all_basic_module_switcher_tests
		;;
	-c|--cache-coherency)
		run_all_cache_coherency_tests
		;;
        -d|--data-corruption)
		run_all_data_corruption_tests
                ;;
	-i|--disk-io)
		run_all_disk_io_tests
		;;
	-g|--governor-test)
		run_all_governor_tests
		;;
	-m|--memory)
		run_all_memory_tests
		;;
	-p|--perf)
		run_all_perf_tests
		;;
        -s|--switching)
		run_all_switching_tests
                ;;
        -v|--vfp-ffmpeg)
        	run_all_vfp_ffmpeg_tests
                ;;
        -t|--test-id)
		if [ -z "$2" ]; then
			echo ""
			echo "Error: Specify the test-id(s) to run!!"
			echo "       [ 1 : cache-coherency-a7]"
			echo "       [ 2 : cache-coherency-a15]"
			echo "       [ 3 : cache-coherency-switching]"
			echo "       [ 4 : data-corruption-a7]"
			echo "       [ 5 : data-corruption-a15]"
			echo "       [ 6 : data-corruption-switching]"
			echo "       [ 7 : disk-io-stress-a7]"
			echo "       [ 8 : disk-io-stress-a15]"
			echo "       [ 9 : disk-io-stress-switching]"
			echo "       [10 : mem-stress-a7]"
			echo "       [11 : mem-stress-a15]"
			echo "       [12 : mem-stress-switching]"
			echo "       [13 : bl-basic-tests]"
			echo "       [14 : switcher-tests]"
			echo "       [15 : vfp-ffmpeg-a7]"
        		echo "       [16 : vfp-ffmpeg-a15]"
        		echo "       [17 : vfp-ffmpeg-switching]"
        		echo "       [18 : interactive-governor-test]"
			echo "       [19 : cache-coherency-simultaneous-thread-switching]"
			echo "       [20 : data-corruption-simultaneous-thread-switching]"
			echo "       [21 : disk-io-stress-simultaneous-thread-switching]"
			echo "       [22 : mem-stress-simultaneous-thread-switching]"
			echo "       [23 : vfp-ffmpeg-simultaneous-thread-switching]"
			echo "       [24 : perf-mem-stress-a7]"
			echo "       [25 : perf-mem-stress-a15]"
			echo "       [26 : perf-mem-stress-switching]"
			echo "       [27 : perf-disk-io-stress-a7]"
			echo "       [28 : perf-disk-io-stress-a15]"
			echo "       [29 : perf-disk-io-stress-switching]"
			echo "       [30 : cpu-freq-vs-cluster-freq]"
        		echo ""
			exit 1;
		fi

		while [ "$2" ]; do
			case "$2" in
			1)
				echo " run_test cache-coherency-a7 "cache-coherency-switcher.sh -f little $EACH_CPU" "
				run_test cache-coherency-a7 "cache-coherency-switcher.sh -f little $EACH_CPU"
				;;
			2)
				run_test cache-coherency-a15 "cache-coherency-switcher.sh -f big $EACH_CPU"
				;;
			3)
				run_test cache-coherency-switching "cache-coherency-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
				;;
			4)
				run_test data-corruption-a7 "data-corruption-switcher.sh -f little $EACH_CPU"
				;;
			5)
				run_test data-corruption-a15 "data-corruption-switcher.sh -f big $EACH_CPU"
				;;
			6)
				run_test data-corruption-switching "data-corruption-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
				;;
			7)
				run_test disk-io-stress-a7 "disk-io-stress-switcher.sh -f little $EACH_CPU"
				;;
			8)
				run_test disk-io-stress-a15 "disk-io-stress-switcher.sh -f big $EACH_CPU"
				;;
			9)
				run_test disk-io-stress-switching "disk-io-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
				;;
			10)
				run_test mem-stress-a7 "mem-stress-switcher.sh -f little $EACH_CPU"
				;;
			11)
				run_test mem-stress-a15 "mem-stress-switcher.sh -f big $EACH_CPU"
				;;
			12)
				run_test mem-stress-switching "mem-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
				;;
			13)
				run_test bl-basic-tests "run-bl-basic-tests.sh"
				;;
			14)
				run_test switcher-tests "switcher-tests.sh"
				;;
			15)
				run_test vfp-ffmpeg-a7 "vfp-ffmpeg-switcher.sh -f little $EACH_CPU"
				;;
			16)
				run_test vfp-ffmpeg-a15 "vfp-ffmpeg-switcher.sh -f big $EACH_CPU"
				;;
			17)
				run_test vfp-ffmpeg-switching "vfp-ffmpeg-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
				;;
			18)
				run_test interactive-governor-tests "interactive-governor-test.sh"
				;;
			19)
				run_test cache-coherency-simultaneous-thread-switching "cache-coherency-switcher.sh -f big -c 0 $NO_OF_CPUS -s 100 -S"
				;;
			20)
				run_test data-corruption-simultaneous-thread-switching "data-corruption-switcher.sh -f big -c 0 $NO_OF_CPUS -s 100 -S"
				;;
			21)
				run_test disk-io-stress-simultaneous-thread-switching "disk-io-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -s 100 -S"
				;;
			22)
				run_test mem-stress-simultaneous-thread-switching "mem-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -s 100 -S"
				;;
			23)
				run_test vfp-ffmpeg-simultaneous-thread-switching "vfp-ffmpeg-switcher.sh -f big -c 0 $NO_OF_CPUS -s 100 -S"
				;;
			24)
				run_test perf-mem-stress-a7 "perf-mem-stress-switcher.sh -f little $EACH_CPU -a7 1"
				;;
			25)
				run_test perf-mem-stress-a15 "perf-mem-stress-switcher.sh -f big $EACH_CPU -a15 1"
				;;
			26)
				run_test perf-mem-stress-switching "perf-mem-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
				;;
			27)
				run_test perf-disk-io-stress-a7 "perf-disk-io-stress-switcher.sh -f little $EACH_CPU -a7 1"
				;;
			28)
				run_test perf-disk-io-stress-a15 "perf-disk-io-stress-switcher.sh -f big $EACH_CPU -a15 1"
				;;
			29)
				run_test perf-disk-io-stress-switching "perf-disk-io-stress-switcher.sh -f big -c 0 $NO_OF_CPUS -r 100 -l 1000"
				;;
			30)
				run_test cpu-freq-vs-cluster-freq "cpu_freq_vs_cluster_freq.sh"
				;;

			*)
				echo ""
				echo "Error: Unknown test-id \"$2\""
				echo "       Specify the correct test(s) to run!!"
				echo "       [ 1 : cache-coherency-a7]"
				echo "       [ 2 : cache-coherency-a15]"
				echo "       [ 3 : cache-coherency-switching]"
				echo "       [ 4 : data-corruption-a7]"
				echo "       [ 5 : data-corruption-a15]"
				echo "       [ 6 : data-corruption-switching]"
				echo "       [ 7 : disk-io-stress-a7]"
				echo "       [ 8 : disk-io-stress-a15]"
				echo "       [ 9 : disk-io-stress-switching]"
				echo "       [10 : mem-stress-a7]"
				echo "       [11 : mem-stress-a15]"
				echo "       [12 : mem-stress-switching]"
				echo "       [13 : bl-basic-tests]"
				echo "       [14 : switcher-tests]"
				echo "       [15 : vfp-ffmpeg-a7]"
        			echo "       [16 : vfp-ffmpeg-a15]"
        			echo "       [17 : vfp-ffmpeg-switching]"
        			echo "       [18 : interactive-governor-test]"
				echo "       [19 : cache-coherency-simultaneous-thread-switching]"
				echo "       [20 : data-corruption-simultaneous-thread-switching]"
				echo "       [21 : disk-io-stress-simultaneous-thread-switching]"
				echo "       [22 : mem-stress-simultaneous-thread-switching]"
				echo "       [23 : vfp-ffmpeg-simultaneous-thread-switching]"
				echo "       [24 : perf-mem-stress-a7]"
				echo "       [25 : perf-mem-stress-a15]"
				echo "       [26 : perf-mem-stress-switching]"
				echo "       [27 : perf-disk-io-stress-a7]"
				echo "       [28 : perf-disk-io-stress-a15]"
				echo "       [29 : perf-disk-io-stress-switching]"
				echo "       [30 : cpu-freq-vs-cluster-freq]"
				echo ""
				exit 1;
				;;
			esac
			shift;
		done
                ;;
	-h | --help | *)
		usage
		;;
	esac
	shift;
done

# For RTSM
if [ "$MODEL" = "RTSM_VE_CortexA15x4-A7x4" ]; then
	# Test cleanup before exit
	test_cleanup
fi

# disable switcher
disable_switcher

summary

exit 0