debian/tests/01-numcpus
raw| 1 | #!/bin/bash |
| 2 | |
| 3 | # atop reports number of CPU and two extra lines |
| 4 | ATOPSOPINION="$(atop -P cpu 5 1 | grep -cvE '^(RESET|SEP)')" |
| 5 | TRUTH="$(lscpu -p | grep -cvE '^#')" |
| 6 | |
| 7 | if [ "${TRUTH}" -ne "${ATOPSOPINION}" ]; then |
| 8 | printf >&2 "autopkgtest 01-numcpus failed" |
| 9 | printf >&2 "atop thinks %s CPUs, truth is %s CPUs\n" "${ATOPSOPINION}" "${TRUTH}" |
| 10 | atop -P cpu 5 1 >&2 |
| 11 | lscpu -p >&2 |
| 12 | exit 1 |
| 13 | else |
| 14 | exit 0 |
| 15 | fi |
| 16 |