Merge branch 'upstream-16.11-stable' into 16.11.x
[deb_dpdk.git] / debian / tests / test-autotest
1 #!/bin/bash
2 set -u
3
4 basedir=$(dirname "$0")
5 . "${basedir}"/check-dpdk-supported-arch.sh
6
7 # since these tests really execute dpdk code they have to check for the
8 # required minimum cpu features
9 ARCH=$(dpkg --print-architecture)
10 echo "Check required features on arch: ${ARCH}"
11 case "${ARCH}" in
12     amd64)
13         if ! grep -q '^flags.*sse3' /proc/cpuinfo; then
14             echo "Missing sse3 on ${ARCH} - not supported, SKIP test"
15             exit 0
16         fi
17         ;;
18     *)
19         echo "DPDK autotest not supported on ${ARCH}, SKIP test"
20         exit 0
21         ;;
22 esac
23 echo "no known missing feature on ${ARCH}, continue test"
24
25 echo "Get required 1G huge pages"
26 echo 512 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
27 sleep 5s
28 realhp=$(cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages)
29 if [[ "$realhp" != "512" ]]; then
30     echo "Unable to allocate the huge pages required for the test, SKIP test"
31     exit 0
32 fi
33
34 # fetch build config
35 . /usr/share/dpdk/dpdk-sdk-env.sh
36
37 # Reasons for not being an dh_autotest
38 # - needs root and hugepages
39 # - build environment capabilities too unpredictable
40 # - certain workarounds needed to get running, needing root for some which is
41 #   not available in the build environment
42
43 # blacklist reasons:
44 # known upstream: http://www.dpdk.org/ml/archives/dev/2016-May/038849.html
45 # - KNI: we deliver via dkms but test doesn't match
46 # - power_acpi_cpufreq: in many environments blocked by other cpufreq
47 # - power_kvm_vm_autotest: no avail in all environments, only for virt power management e.g. /dev/virtio-ports/virtio.serial.port.poweragent.0
48 # - IVSHMEM fails in virtual environment
49 # - eal_flags needs at least 8 cpus for lcores test not to fail
50 # - pci doesn't initialize in all virt env causing command not found issues
51 # - rather slow performance tests not suited for regular build associated tests: ring_perf,mempool_perf,memcpy_perf,hash_perf,timer_perf
52
53 python "${RTE_SDK}/test/autotest.py" \
54     "${RTE_SDK}/test/test" \
55     "${RTE_TARGET}" \
56     "-KNI,power_acpi_cpufreq,power_kvm_vm,IVSHMEM,eal_flags,pci,ring_perf,mempool_perf,memcpy_perf,hash_perf,timer_perf" \
57
58 # Pass/Fail
59 # For now the autotest is too unreliable, so we run it to get some logs in
60 # different environments, but never (want to) fail until it is stable.
61
62 echo "OK"