Blame tests/p_libbpf-tools/libbpf-tools_tests.sh

Carlos Rodriguez-Fernandez adc497
#!/bin/bash
Carlos Rodriguez-Fernandez adc497
# Author: Carlos Rodriguez-Fernandez <carlosrodrifernandez@gmail.com>
Carlos Rodriguez-Fernandez adc497
Carlos Rodriguez-Fernandez adc497
t_Log "Running $0 - libbpf tools"
Carlos Rodriguez-Fernandez adc497
Carlos Rodriguez-Fernandez 2ef0f6
if [[ "$centos_ver" -le 8 ]]; then
Carlos Rodriguez-Fernandez adc497
  t_Log "Running $0 in EL8 or less -> SKIP"
Carlos Rodriguez-Fernandez adc497
  exit 0
Carlos Rodriguez-Fernandez adc497
fi
Carlos Rodriguez-Fernandez adc497
Carlos Rodriguez-Fernandez adc497
version_tests=(
Carlos Rodriguez-Fernandez adc497
"bpf-bindsnoop -V"
Carlos Rodriguez-Fernandez adc497
"bpf-biolatency -V"
Carlos Rodriguez-Fernandez adc497
"bpf-biopattern -V"
Carlos Rodriguez-Fernandez adc497
"bpf-biosnoop -V"
Carlos Rodriguez-Fernandez adc497
"bpf-biostacks -V"
Carlos Rodriguez-Fernandez adc497
"bpf-biotop -V"
Carlos Rodriguez-Fernandez adc497
"bpf-bitesize -V"
Carlos Rodriguez-Fernandez adc497
"bpf-btrfsdist -V"
Carlos Rodriguez-Fernandez adc497
"bpf-btrfsslower -V"
Carlos Rodriguez-Fernandez adc497
"bpf-cachestat -V"
Carlos Rodriguez-Fernandez adc497
"bpf-capable -V"
Carlos Rodriguez-Fernandez adc497
"bpf-cpudist -V"
Carlos Rodriguez-Fernandez adc497
"bpf-cpufreq -V"
Carlos Rodriguez-Fernandez adc497
"bpf-drsnoop -V"
Carlos Rodriguez-Fernandez adc497
"bpf-execsnoop -V"
Carlos Rodriguez-Fernandez adc497
"bpf-exitsnoop -V"
Carlos Rodriguez-Fernandez adc497
"bpf-ext4dist -V"
Carlos Rodriguez-Fernandez adc497
"bpf-ext4slower -V"
Carlos Rodriguez-Fernandez adc497
"bpf-filelife -V"
Carlos Rodriguez-Fernandez adc497
"bpf-filetop -V"
Carlos Rodriguez-Fernandez adc497
"bpf-fsdist -V"
Carlos Rodriguez-Fernandez adc497
"bpf-fsslower -V"
Carlos Rodriguez-Fernandez adc497
"bpf-funclatency -V"
Carlos Rodriguez-Fernandez adc497
"bpf-gethostlatency -V"
Carlos Rodriguez-Fernandez adc497
"bpf-hardirqs -V"
Carlos Rodriguez-Fernandez adc497
"bpf-javagc -V"
Carlos Rodriguez-Fernandez adc497
"bpf-killsnoop -V"
Carlos Rodriguez-Fernandez adc497
"bpf-klockstat -V"
Carlos Rodriguez-Fernandez adc497
"bpf-ksnoop -V"
Carlos Rodriguez-Fernandez adc497
"bpf-llcstat -V"
Carlos Rodriguez-Fernandez adc497
"bpf-mdflush -V"
Carlos Rodriguez-Fernandez adc497
"bpf-mountsnoop -V"
Carlos Rodriguez-Fernandez adc497
"bpf-nfsdist -V"
Carlos Rodriguez-Fernandez adc497
"bpf-nfsslower -V"
Carlos Rodriguez-Fernandez adc497
"bpf-numamove -V"
Carlos Rodriguez-Fernandez adc497
"bpf-offcputime -V"
Carlos Rodriguez-Fernandez adc497
"bpf-oomkill -V"
Carlos Rodriguez-Fernandez adc497
"bpf-opensnoop -V"
Carlos Rodriguez-Fernandez adc497
"bpf-readahead -V"
Carlos Rodriguez-Fernandez adc497
"bpf-runqlat -V"
Carlos Rodriguez-Fernandez adc497
"bpf-runqlen -V"
Carlos Rodriguez-Fernandez adc497
"bpf-runqslower -V"
Carlos Rodriguez-Fernandez adc497
"bpf-sigsnoop -V"
Carlos Rodriguez-Fernandez adc497
"bpf-slabratetop -V"
Carlos Rodriguez-Fernandez adc497
"bpf-softirqs -V"
Carlos Rodriguez-Fernandez adc497
"bpf-solisten -V"
Carlos Rodriguez-Fernandez adc497
"bpf-statsnoop -V"
Carlos Rodriguez-Fernandez adc497
"bpf-syscount -V"
Carlos Rodriguez-Fernandez adc497
"bpf-tcpconnect -V"
Carlos Rodriguez-Fernandez adc497
"bpf-tcpconnlat -V"
Carlos Rodriguez-Fernandez adc497
"bpf-tcplife -V"
Carlos Rodriguez-Fernandez adc497
"bpf-tcprtt -V"
Carlos Rodriguez-Fernandez adc497
"bpf-tcpstates -V"
Carlos Rodriguez-Fernandez adc497
"bpf-tcpsynbl -V"
Carlos Rodriguez-Fernandez adc497
"bpf-tcptop -V"
Carlos Rodriguez-Fernandez adc497
"bpf-tcptracer -V"
Carlos Rodriguez-Fernandez adc497
"bpf-vfsstat -V"
Carlos Rodriguez-Fernandez adc497
"bpf-wakeuptime -V"
Carlos Rodriguez-Fernandez adc497
"bpf-xfsdist -V"
Carlos Rodriguez-Fernandez adc497
"bpf-xfsslower -V"
Carlos Rodriguez-Fernandez adc497
)
Carlos Rodriguez-Fernandez adc497
Carlos Rodriguez-Fernandez adc497
tracing_tests=(
Carlos Rodriguez-Fernandez adc497
"bpf-biolatency 1 1"
Carlos Rodriguez-Fernandez adc497
"bpf-biopattern 1 1"
Carlos Rodriguez-Fernandez f6ccec
# IGNORE, CURRENTLY BROKEN: "bpf-biosnoop 1", see https://bugzilla.redhat.com/show_bug.cgi?id=2219196
Carlos Rodriguez-Fernandez adc497
"bpf-biostacks 1"
Carlos Rodriguez-Fernandez adc497
"bpf-biotop 1 1"
Carlos Rodriguez-Fernandez adc497
"bpf-bitesize 1 1"
Carlos Rodriguez-Fernandez adc497
"bpf-cachestat 1 1"
Carlos Rodriguez-Fernandez adc497
"bpf-cpudist 1 1"
Carlos Rodriguez-Fernandez f6ccec
# IGNORE, CURRENTLY BROKEN: "bpf-cpufreq -d 1", see https://github.com/iovisor/bcc/issues/4651
Carlos Rodriguez-Fernandez adc497
"bpf-drsnoop -d 1"
Carlos Rodriguez-Fernandez adc497
"bpf-filetop 1 1"
Carlos Rodriguez-Fernandez adc497
"bpf-fsdist -t $(df -T $(pwd) | tail -1 | awk '{print $2}') 1 1"
Carlos Rodriguez-Fernandez adc497
"bpf-fsslower -t $(df -T $(pwd) | tail -1 | awk '{print $2}') -d 1"
Carlos Rodriguez-Fernandez adc497
"bpf-funclatency -i 1 -d 1 vfs_read"
Carlos Rodriguez-Fernandez adc497
"bpf-hardirqs 1 1"
Carlos Rodriguez-Fernandez adc497
"bpf-klockstat -d 1"
Carlos Rodriguez-Fernandez adc497
"bpf-llcstat 1"
Carlos Rodriguez-Fernandez adc497
"bpf-offcputime 1"
Carlos Rodriguez-Fernandez adc497
# IGNORE, CURRENTLY BROKEN: "bpf-opensnoop -d 1", see https://bugzilla.redhat.com/show_bug.cgi?id=2219192
Carlos Rodriguez-Fernandez adc497
# IGNORE, CURRENTLY BROKEN: "bpf-readahead -d 1", see https://bugzilla.redhat.com/show_bug.cgi?id=2219193
Carlos Rodriguez-Fernandez adc497
"bpf-runqlat 1 1"
Carlos Rodriguez-Fernandez adc497
"bpf-runqlen 1 1"
Carlos Rodriguez-Fernandez adc497
"bpf-slabratetop 1 1"
Carlos Rodriguez-Fernandez adc497
"bpf-softirqs 1 1"
Carlos Rodriguez-Fernandez adc497
"bpf-syscount -d 1 -T 1"
Carlos Rodriguez-Fernandez adc497
"bpf-tcprtt -d 1 -i 1"
Carlos Rodriguez-Fernandez adc497
"bpf-tcpsynbl 1 1"
Carlos Rodriguez-Fernandez adc497
"bpf-tcptop 1 1"
Carlos Rodriguez-Fernandez adc497
"bpf-vfsstat 1 1"
Carlos Rodriguez-Fernandez adc497
"bpf-wakeuptime 1"
Carlos Rodriguez-Fernandez adc497
)
Carlos Rodriguez-Fernandez adc497
Carlos Rodriguez-Fernandez adc497
one_failed=0
Carlos Rodriguez-Fernandez adc497
Carlos Rodriguez-Fernandez adc497
for cmd in "${version_tests[@]}"; do
Carlos Rodriguez-Fernandez cd6298
  t_Log "Running $0 - libbpf-tools test: ${cmd}"
Carlos Rodriguez-Fernandez adc497
  if ! eval "${cmd}" > /dev/null 2>&1; then
Carlos Rodriguez-Fernandez cd6298
    t_Log "FAIL: $0: libbpf-tools test: ${cmd}"
Carlos Rodriguez-Fernandez adc497
    one_failed=1
Carlos Rodriguez-Fernandez adc497
  else
Carlos Rodriguez-Fernandez cd6298
    t_Log "PASS: $0: libbpf-tools test: ${cmd}"
Carlos Rodriguez-Fernandez adc497
  fi
Carlos Rodriguez-Fernandez adc497
done
Carlos Rodriguez-Fernandez adc497
Carlos Rodriguez-Fernandez adc497
for cmd in "${tracing_tests[@]}"; do
Carlos Rodriguez-Fernandez cd6298
  t_Log "Running $0 - libbpf-tools test: ${cmd}"
Carlos Rodriguez-Fernandez adc497
  if ! eval "${cmd}" > /dev/null 2>&1; then
Carlos Rodriguez-Fernandez cd6298
    t_Log "FAIL: $0: libbpf-tools test: ${cmd}"
Carlos Rodriguez-Fernandez adc497
    one_failed=1
Carlos Rodriguez-Fernandez adc497
  else
Carlos Rodriguez-Fernandez cd6298
    t_Log "PASS: $0: libbpf-tools test: ${cmd}"
Carlos Rodriguez-Fernandez adc497
  fi
Carlos Rodriguez-Fernandez adc497
done
Carlos Rodriguez-Fernandez adc497
Carlos Rodriguez-Fernandez f6ccec
if [[ "${one_failed}" == "1" ]]; then
Carlos Rodriguez-Fernandez f6ccec
  t_Log "FAIL: $0: At least one test failed, see logs above"
Carlos Rodriguez-Fernandez f6ccec
fi
Carlos Rodriguez-Fernandez f6ccec
Carlos Rodriguez-Fernandez adc497
exit ${one_failed}