forked from veracruz-project/veracruz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tz_test.sh
executable file
·37 lines (36 loc) · 945 Bytes
/
run_tz_test.sh
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
#!/bin/bash
# AUTHORS
#
# The Veracruz Development Team.
#
# COPYRIGHT
#
# See the `LICENSE_MIT.markdown` file in the Veracruz root directory for licensing
# and copyright information.
#
# Arguments
# $1 - test program.
# $2 - waiting time before ^C.
echo "running trustzone test: '$1', waiting time: $2s"
rm -f /tmp/screenlog
rm -f /tmp/serial.log
screen -L -d -m -c screenrc -S qemu_screen ./tz_test.sh
sleep 25
screen -S qemu_screen -p 0 -X stuff "root\n"
sleep 5
screen -S qemu_screen -p 0 -X stuff "mkdir shared && mount -t 9p -o trans=virtio host shared\n"
sleep 5
screen -S qemu_screen -p 0 -X stuff "cd shared/test && . ./env.sh\n";
sleep 25
screen -S qemu_screen -p 0 -X stuff "./$1 --test-threads=1\n"
sleep $2
screen -S qemu_screen -p 0 -X stuff "^C"
sleep 5
{
grep "test result: ok." /tmp/screenlog
} || {
cat /tmp/screenlog
echo "Failed to find 'test result: ok.' in the screenlog"
cat /tmp/screenlog
false
}