diff options
-rwxr-xr-x | common/scripts/is-cpu-isolated.sh | 30 | ||||
-rwxr-xr-x | common/scripts/kvm/test-kvm.sh | 8 | ||||
-rwxr-xr-x | common/scripts/ltp-realtime2LAVA.py | 197 | ||||
-rw-r--r-- | openembedded/acpi-smoke-test.yaml | 16 | ||||
-rw-r--r-- | openembedded/ltp-realtime.yaml | 6 | ||||
-rw-r--r-- | openembedded/ltp.yaml | 4 | ||||
-rwxr-xr-x | openembedded/scripts/acpi-smoke-test.sh | 48 | ||||
-rw-r--r-- | ubuntu/acpica-tools.yaml | 37 | ||||
-rw-r--r-- | ubuntu/acpica.yaml | 2 | ||||
-rw-r--r-- | ubuntu/netperf-client-multinode.yaml | 6 | ||||
-rw-r--r-- | ubuntu/netperf-server-multinode.yaml | 6 | ||||
-rwxr-xr-x | ubuntu/scripts/wifi-ubuntu.sh | 107 | ||||
-rw-r--r-- | ubuntu/wifi-ubuntu.yaml | 24 |
13 files changed, 472 insertions, 19 deletions
diff --git a/common/scripts/is-cpu-isolated.sh b/common/scripts/is-cpu-isolated.sh index 0ff03cf..91a2b3c 100755 --- a/common/scripts/is-cpu-isolated.sh +++ b/common/scripts/is-cpu-isolated.sh @@ -3,6 +3,7 @@ # Variable decided outcome of test, this is the minimum isolation we need. MIN_ISOLATION=10 RESULT="PASS" +STRESS_DURATION=500 if [ $2 ]; then MIN_ISOLATION=$2 @@ -49,6 +50,13 @@ get_isolation_duration() { while [ $new_count -eq $old_count ] do new_count=$(get_tick_count) + ps h -C stress -o pid > /dev/null + if [ $? != 0 ]; then + echo "Tick didn't got updated for stress duration:" $STRESS_DURATION + echo "Probably in infinite mode, quiting test" + echo "test_case_id:Min-isolation "$MIN_ISOLATION" secs result:"$RESULT" measurement:"$STRESS_DURATION" units:secs" + exit + fi done isdebug echo "count locked: " $new_count @@ -186,10 +194,24 @@ isolate_cpu1() { # But disallow load balancing within the NOHZ domain echo 0 > /dev/cpuset/rt/sched_load_balance - # Start a single threaded task on CPU1 or RT group - echo $$ > /dev/cpuset/rt/tasks - stress -q --cpu 1 --timeout 2000 & - echo $$ > /dev/cpuset/gp/tasks + stress -q --cpu 1 --timeout $STRESS_DURATION & + + # Restart CPU1 to migrate all tasks to CPU0 + echo 0 > /sys/devices/system/cpu/cpu1/online + echo 1 > /sys/devices/system/cpu/cpu1/online + + # Setup the NOHZ domain again: CPU1 + echo 0 > /dev/cpuset/rt/mems + echo 1 > /dev/cpuset/rt/cpus + + # Try to move all processes in top set to the GP set. + for pid in `ps h -C stress -o pid`; do + echo $pid > /dev/cpuset/rt/tasks 2>/dev/null + if [ $? != 0 ]; then + isdebug echo -n "RT: Cannot move PID $pid: " + isdebug echo "$(cat /proc/$pid/status | grep ^Name | cut -f2)" + fi + done } clear_cpusets() { diff --git a/common/scripts/kvm/test-kvm.sh b/common/scripts/kvm/test-kvm.sh index 2df1c7d..0154482 100755 --- a/common/scripts/kvm/test-kvm.sh +++ b/common/scripts/kvm/test-kvm.sh @@ -14,8 +14,8 @@ fi dmesg|grep 'Hyp mode initialized successfully' && echo "$KVM_INIT pass" || echo "$KVM_INIT fail" if hash curl 2>/dev/null; then - EXTRACT_BUILD_NUMBER="curl -s" - DOWNLOAD_FILE="curl -SO" + EXTRACT_BUILD_NUMBER="curl -sk" + DOWNLOAD_FILE="curl -SOk" else EXTRACT_BUILD_NUMBER="wget -q --no-check-certificate -O -" DOWNLOAD_FILE="wget --progress=dot -e dotbytes=2M --no-check-certificate" @@ -49,7 +49,7 @@ cat >> /mnt/usr/bin/test-guest.sh <<EOF #!/bin/sh exec > /root/guest.log 2>&1 echo "$KVM_BOOT pass" - ping -W 4 -c 10 192.168.1.10 && echo "$KVM_GUEST_NET pass" || echo "$KVM_GUEST_NET fail" + ping -W 4 -c 10 10.0.0.1 && echo "$KVM_GUEST_NET pass" || echo "$KVM_GUEST_NET fail" sh $TEST_SCRIPT EOF chmod a+x /mnt/usr/bin/test-guest.sh @@ -67,7 +67,7 @@ brctl addif br0 eth0 brctl addif br0 tap0 udhcpc -t 10 -i br0 -ping -W 4 -c 10 192.168.1.10 && echo "$KVM_HOST_NET pass" || echo "$KVM_HOST_NET fail" +ping -W 4 -c 10 10.0.0.1 && echo "$KVM_HOST_NET pass" || echo "$KVM_HOST_NET fail" qemu-system-arm -smp 2 -m 1024 -cpu cortex-a15 -M vexpress-a15 \ -kernel ./zImage -dtb ./vexpress-v2p-ca15-tc1.dtb \ diff --git a/common/scripts/ltp-realtime2LAVA.py b/common/scripts/ltp-realtime2LAVA.py new file mode 100755 index 0000000..f5f41fa --- /dev/null +++ b/common/scripts/ltp-realtime2LAVA.py @@ -0,0 +1,197 @@ +#!/usr/bin/python +import re +import sys +import fileinput + +#extract a standard results block from the stream +def standard_results (): + minimum = re.compile("^Min:\s+(?P<min>[\d\.]+)\s+(?P<units>\w+)") + maximum = re.compile("^Max:\s+(?P<max>[\d\.]+)\s+(?P<units>\w+)") + average = re.compile("^Avg:\s+(?P<average>[\d\.]+)\s+(?P<units>\w+)") + standarddev = re.compile("^StdDev:\s+(?P<stddev>[\d\.]+)\s+(?P<units>\w+)") + finished=0 + for line in sys.stdin: + for parser in [maximum,minimum,average,standarddev]: + result = parser.search(line) + if result is not None: + if parser is minimum: + test_min = result.group('min') + units = result.group('units') + print "test_case_id:%s%s min measurement:%s units:%s result:skip" % (test_name, test_args, test_min, units) + finished += 1 + break + if parser is maximum: + test_max = result.group('max') + units = result.group('units') + finished += 1 + print "test_case_id:%s%s max measurement:%s units:%s result:skip" % (test_name, test_args, test_max, units) + break + if parser is average: + test_avg = result.group('average') + units = result.group('units') + print "test_case_id:%s%s avg measurement:%s units:%s result:skip" % (test_name, test_args, test_avg, units) + finished += 1 + break + if parser is standarddev: + test_stddev = result.group('stddev') + units = result.group('units') + print "test_case_id:%s%s stddev measurement:%s units:%s result:skip" % (test_name, test_args, test_stddev, units) + finished += 1 + break + else: + continue + if finished ==4: + return + + print "ERROR: Parser failed and ran to EOF" + sys.exit(-1) + +def result_results (): + results = re.compile("Result:\s+(?P<result>\w+)") + finished=0 + for line in sys.stdin: + for parser in [results]: + result = parser.search(line) + if result is not None: + if parser is results: + test_result = result.group('result') + print "test_case_id:%s%s_test measurement:0 units:none result:%s" % (test_name, test_args, test_result) + finished += 1 + break + else: + continue + if finished ==1: + return + + print "ERROR: Parser failed and ran to EOF" + sys.exit(-1) + + +def sched_jitter_results (): + maximum = re.compile("^max jitter:\s+(?P<max>[\d\.]+)\s+(?P<units>\w+)") + finished=0 + for line in sys.stdin: + for parser in [maximum]: + result = parser.search(line) + if result is not None: + if parser is maximum: + test_max = result.group('max') + units = result.group('units') + print "test_case_id:%s%s max jitter measurement:%s units:%s result:skip" % (test_name, test_args, test_max, units) + finished += 1 + break + else: + continue + if finished ==1: + #print "min:%s max:%s avg:%s stddev:%s" % (test_min, test_max, test_avg, test_stddev) + return + + print "ERROR: Parser failed and ran to EOF" + sys.exit(-1) + +def pi_perf_results (): + minimum = re.compile("^Min delay =\s+(?P<min>[\d\.]+)\s+(?P<units>\w+)") + maximum = re.compile("^Max delay =\s+(?P<max>[\d\.]+)\s+(?P<units>\w+)") + average = re.compile("^Average delay =\s+(?P<average>[\d\.]+)\s+(?P<units>\w+)") + standarddev = re.compile("^Standard Deviation =\s+(?P<stddev>[\d\.]+)\s+(?P<units>\w+)") + finished=0 + for line in sys.stdin: + for parser in [maximum,minimum,average,standarddev]: + result = parser.search(line) + if result is not None: + if parser is minimum: + test_min = result.group('min') + units = result.group('units') + print "test_case_id:%s%s min measurement:%s units:%s result:skip" % (test_name, test_args, test_min, units) + finished += 1 + break + if parser is maximum: + test_max = result.group('max') + units = result.group('units') + print "test_case_id:%s%s max measurement:%s units:%s result:skip" % (test_name, test_args, test_max, units) + finished += 1 + break + if parser is average: + test_avg = result.group('average') + units = result.group('units') + print "test_case_id:%s%s avg measurement:%s units:%s result:skip" % (test_name, test_args, test_avg, units) + finished += 1 + break + if parser is standarddev: + test_stddev = result.group('stddev') + units = result.group('units') + print "test_case_id:%s%s stddev measurement:%s units:%s result:skip" % (test_name, test_args, test_stddev, units) + finished += 1 + break + else: + continue + if finished ==4: + return + + print "ERROR: Parser failed and ran to EOF" + sys.exit(-1) + +def do_nothing (): + return + +#names of the test parsed out fo the input stream, converted to functioncalls +def async_handler(): + standard_results() + result_results() +def tc_2(): + result_results() +def gtod_latency(): + standard_results() +def periodic_cpu_load_single(): + standard_results() +def sched_latency(): + standard_results() +def sched_jitter(): + sched_jitter_results() +def sched_football(): + result_results() +def rt_migrate(): + result_results() +def pthread_kill_latency(): + standard_results() + result_results() +def prio_wake(): + result_results() +def pi_perf(): + pi_perf_results() +def prio_preempt(): + result_results() +def matrix_mult(): + result_results() +def periodic_cpu_load(): + result_results() +def async_handler_jk(): + result_results() + +#Parse the input stream and tuen test names into function calls to parse their +#details + +test_start = re.compile("--- Running testcase (?P<name>[a-zA-Z0-9_-]+)\s+(?P<args>[a-zA-Z0-9_.\- ]*?)\s*---") +test_finish = re.compile("The .* test appears to have completed.") + +for line in sys.stdin: + for parser in [test_start,test_finish]: + result = parser.search(line) + if result is not None: + if parser is test_start: + test_name = result.group('name') + func_name = result.group('name') + func_name = func_name.replace("-","_") + test_args = result.group('args') + test_args = test_args.replace(" ","-") + print + print " test_start= " + test_name + test_args + globals()[func_name]() + break + + if parser is test_finish: + print " test_finished= " + test_name + test_args + break + else: + continue + diff --git a/openembedded/acpi-smoke-test.yaml b/openembedded/acpi-smoke-test.yaml new file mode 100644 index 0000000..7fb54e3 --- /dev/null +++ b/openembedded/acpi-smoke-test.yaml @@ -0,0 +1,16 @@ +metadata: + name: acpi-smoke-test + format: "Lava-Test-Shell Test Definition 1.0" + description: "Testing for the presence of ACPI" + maintainer: + - timothy.anzaku@linaro.org + os: + - openembedded + scope: + - functional + devices: + - rtsm_fvp_base_cortex-a57x1-a53x1 + - rtsm_fvp_base-aemv8a +run: + steps: + - "./openembedded/scripts/acpi-smoke-test.sh" diff --git a/openembedded/ltp-realtime.yaml b/openembedded/ltp-realtime.yaml index f1bb1e5..9e32060 100644 --- a/openembedded/ltp-realtime.yaml +++ b/openembedded/ltp-realtime.yaml @@ -17,12 +17,10 @@ run: steps: - 'cd /opt/ltp' - 'export LTP_REALTIME_TESTS_TO_RUN="func/async_handler func/gtod_latency func/hrtimer-prio func/matrix_mult func/measurement func/periodic_cpu_load func/pi_perf func/prio-preempt func/prio-wake func/pthread_kill_latency func/rt-migrate func/sched_football func/sched_jitter func/sched_latency func/thread_clock"' - - 'for TEST_TO_RUN in ${LTP_REALTIME_TESTS_TO_RUN} ; do ./testscripts/test_realtime.sh -t $TEST_TO_RUN ; done' - - 'for FILE in $(find testcases/realtime/logs -type f) ; do mv $FILE $(dirname $FILE)/$(echo $FILE | sed "s:.*2[0-9]*-[0-9]*-[0-9]*-::g"); done;' - - 'grep -r Result: ./testcases/realtime/logs | sed "s:.*/::g"' + - 'for TEST_TO_RUN in ${LTP_REALTIME_TESTS_TO_RUN} ; do ./testscripts/test_realtime.sh -t $TEST_TO_RUN | /lava/tests/0_ltp-realtime/common/scripts/ltp-realtime2LAVA.py; done' parse: - pattern: "^(?P<test_case_id>.+).log:Result: (?P<result>.+)" + "pattern": "^test_case_id:(?P<test_case_id>.+)\\s+measurement:(?P<measurement>[\\d\\.]+)\\s+units:(?P<units>\\w+)\\s+result:(?P<result>\\w+)" fixupdict: FAIL: fail PASS: pass diff --git a/openembedded/ltp.yaml b/openembedded/ltp.yaml index 9dc4c8f..446b31f 100644 --- a/openembedded/ltp.yaml +++ b/openembedded/ltp.yaml @@ -14,14 +14,14 @@ metadata: - rtsm_ve-armv8 params: - TST_CMDFILES: syscalls,mm,math,timers,fcntl-locktests,ipc,fsx,fs,hugetlb + TST_CMDFILES: syscalls,mm,math,timers,fcntl-locktests,ipc,fsx,fs,hugetlb,io,timers,nptl,pty,containers,fs_bind,filecaps,admin_tools,connectors run: steps: - './openembedded/scripts/ltpfixup.sh $TST_CMDFILES' parse: - pattern: "^(?P<test_case_id>\\S+)\\s+(?P<result>\\w+)\\s+.+" + pattern: "^(?!.+ED)(?P<test_case_id>\\w+)\\s+(?P<result>\\w+)\\s+\\d$" fixupdict: FAIL: fail PASS: pass diff --git a/openembedded/scripts/acpi-smoke-test.sh b/openembedded/scripts/acpi-smoke-test.sh new file mode 100755 index 0000000..176c811 --- /dev/null +++ b/openembedded/scripts/acpi-smoke-test.sh @@ -0,0 +1,48 @@ +#! /bin/bash +# +# Test ACPI Support in UEFI on v7 and v8 +# +# 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. +# +# +DSDTPASS= +echo -n "Testing presence of /sys/firmware/acpi: " +if [ -d /sys/firmware/acpi ]; then + lava-test-case sys-firmware-acpi-present --result pass +else + lava-test-case sys-firmware-acpi-present --result fail +fi +echo -n "Testing presence of /sys/firmware/acpi/tables/DSDT: " +if [ -f /sys/firmware/acpi/tables/DSDT ]; then + lava-test-case sys-firmware-acpi-tables-DSDT --result pass + DSDTPASS=pass +else + lava-test-case sys-firmware-acpi-tables-DSDT --result fail +fi +echo -n "Can decompile DSDT: " +if [ -x /usr/bin/iasl -a -n "$DSDTPASS" ]; then + cp /sys/firmware/acpi/tables/DSDT /tmp/ + ERROR=`/usr/bin/iasl -d /tmp/DSDT 2>&1 | grep DSDT.dsl` + if [ -n "$ERROR" ]; then + lava-test-case can-decompile-DSDT --result pass + else + lava-test-case can-decompile-DSDT --result fail + fi + rm /tmp/DSDT /tmp/DSDT.dsl +else + lava-test-case can-decompile-DSDT --result skip +fi diff --git a/ubuntu/acpica-tools.yaml b/ubuntu/acpica-tools.yaml new file mode 100644 index 0000000..d67f016 --- /dev/null +++ b/ubuntu/acpica-tools.yaml @@ -0,0 +1,37 @@ +metadata: + name: acpica + format: "Lava-Test-Shell Test Definition 1.0" + description: "Test ACPICA ASL" + os: + - ubuntu + devices: + - highbank + scope: + - functional + +install: + git-repos: + - git://git.linaro.org/people/al.stone/acpica-tools.git + steps: + - 'cd acpica-tools' + deps: + - git + - git-core + - bzip2 + - flex + - bison + - build-essential +run: + steps: + - 'cd acpica-tools/tests/' + - 'sudo ./aslts.sh' + +parse: + pattern: "^(?P<test_case_id>\\S+)\\s+\\d+\\s+(?P<result>\\w+)\\s+:\\s+.+" + fixupdict: + TBROK: fail + TCONF: skip + TFAIL: fail + TINFO: unknown + TPASS: pass + TWARN: unknown diff --git a/ubuntu/acpica.yaml b/ubuntu/acpica.yaml index cb98abf..0db6478 100644 --- a/ubuntu/acpica.yaml +++ b/ubuntu/acpica.yaml @@ -11,7 +11,7 @@ metadata: install: git-repos: - - git://git.linaro.org/people/ahs3/acpica.git + - git://git.linaro.org/people/al.stone/acpica.git steps: - 'cd acpica' - 'git branch linaro origin/linaro' diff --git a/ubuntu/netperf-client-multinode.yaml b/ubuntu/netperf-client-multinode.yaml index 49e2175..626822a 100644 --- a/ubuntu/netperf-client-multinode.yaml +++ b/ubuntu/netperf-client-multinode.yaml @@ -23,13 +23,15 @@ install: deps: - netperf - python-minimal +params: + ETH: eth0 run: steps: - ifconfig -a - route - - lava-network broadcast eth0 - - lava-network collect eth0 + - lava-network broadcast $ETH + - lava-network collect $ETH - lava-sync ready - lava-test-case multinode-lava-network --shell ./common/scripts/netperf-client.sh - lava-sync done diff --git a/ubuntu/netperf-server-multinode.yaml b/ubuntu/netperf-server-multinode.yaml index d7d5b37..1a74940 100644 --- a/ubuntu/netperf-server-multinode.yaml +++ b/ubuntu/netperf-server-multinode.yaml @@ -23,13 +23,15 @@ install: deps: - netperf - python-minimal +params: + ETH: eth0 run: steps: - ifconfig -a - route - - lava-network broadcast eth0 - - lava-network collect eth0 + - lava-network broadcast $ETH + - lava-network collect $ETH - lava-test-case multinode-lava-network --shell ./common/scripts/netperf-server.sh - lava-sync ready - lava-sync done diff --git a/ubuntu/scripts/wifi-ubuntu.sh b/ubuntu/scripts/wifi-ubuntu.sh new file mode 100755 index 0000000..5b2d39c --- /dev/null +++ b/ubuntu/scripts/wifi-ubuntu.sh @@ -0,0 +1,107 @@ +#!/bin/bash +# +# WiFi test cases for Linaro ubuntu +# +# Copyright (C) 2013, 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: Botao Sun <botao.sun@linaro.org> + +source include/sh-test-lib + +## Test case definitions +# Check if wifi interface exists or not +test_has_interface() { + TEST="has_interface" + + echo "###########################################" + ifconfig -a + echo "###########################################" + + wifi_interface=`ifconfig -a | grep wlan0` + echo "The WiFi Interface Name is $wifi_interface" + + if [ -z "$wifi_interface" ]; then + fail_test "The WiFi interface doesn't exist, WiFi enable failed" + return 1 + fi + + pass_test +} + +# Check if the wireless access point can be connected or not +test_connect_to_ap() { + TEST="connect_to_ap" + + network_config_file="/etc/network/interfaces" + echo $network_config_file + + # Turn off Ethernet + mv $network_config_file $network_config_file".bak" + echo -ne "auto wlan0\niface wlan0 inet dhcp\nwpa-ssid $1\nwpa-psk $2" > $network_config_file + + service networking restart + + echo "###########################################" + ifconfig wlan0 + echo "###########################################" + + # Get ip address from WiFi interface + ip_address_line=`ifconfig wlan0 | grep "inet addr"` + echo $ip_address_line + + ip_address_array=($ip_address_line) + ip_address_element=${ip_address_array[1]} + echo $ip_address_element + + ip_address=${ip_address_element:5} + echo $ip_address + + # Ping test here + ping -c 5 -I ${ip_address} www.google.com + if [ $? -ne 0 ]; then + fail_test "Ping test failed from $ip_address" + return 1 + fi + + # Packet loss report + packet_loss_line=`ping -c 5 -I ${ip_address} www.google.com | grep "packet loss"` + echo $packet_loss_line + + packet_loss_array=($packet_loss_line) + packet_loss=${packet_loss_array[5]} + echo "The packet loss rate is $packet_loss" + + if [ "$packet_loss" != "0%" ]; then + fail_test "Packet loss happened, rate is $packet_loss" + return 1 + fi + + # Restore the environment + rm -rf $network_config_file + mv $network_config_file".bak" $network_config_file + + service networking restart + sleep 30 + + pass_test +} + +# run the tests +test_has_interface +test_connect_to_ap $1 $2 +# clean exit so lava-test can trust the results +exit 0
\ No newline at end of file diff --git a/ubuntu/wifi-ubuntu.yaml b/ubuntu/wifi-ubuntu.yaml new file mode 100644 index 0000000..60c7bee --- /dev/null +++ b/ubuntu/wifi-ubuntu.yaml @@ -0,0 +1,24 @@ +metadata: + name: wifi-ubuntu + format: "Lava-Test-Shell Test Definition 1.0" + description: "Test WiFi on Linux Linaro ubuntu. SSID and PASSWORD are possible to be set in JSON." + maintainer: + - botao.sun@linaro.org + os: + - ubuntu + devices: + - panda-es + environment: + - lava-test-shell +params: + SSID: LAVA-WiFi-G + PASSWORD: DoubleSuezBun +run: + steps: + - "cd ubuntu/scripts; ./wifi-ubuntu.sh $SSID $PASSWORD" + +parse: + pattern: "(?P<test_case_id>[a-zA-Z0-9_-]+):\\s(?P<result>\\w+)" + fixupdict: + FAIL: fail + PASS: pass
\ No newline at end of file |