Blame tests/p_sysstat/20-pidstat-basic.sh

Carlos Rodriguez-Fernandez b1a011
#!/bin/bash
Carlos Rodriguez-Fernandez b1a011
# Author: Carlos Rodriguez-Fernandez <carlosrodrifernandez@gmail.com>
Carlos Rodriguez-Fernandez b1a011
Carlos Rodriguez-Fernandez b1a011
t_Log "Running $0 - pidstat test"
Carlos Rodriguez-Fernandez b1a011
Carlos Rodriguez-Fernandez 71fbf8
output_file=$(mktemp)
Carlos Rodriguez-Fernandez 71fbf8
trap "rm -f ${output_file}" EXIT
Carlos Rodriguez-Fernandez 71fbf8
Carlos Rodriguez-Fernandez 71fbf8
if ! pidstat 1 1 > ${output_file} 2>&1; then
Carlos Rodriguez-Fernandez 71fbf8
  cat ${output_file}
Carlos Rodriguez-Fernandez 71fbf8
  exit 1
Carlos Rodriguez-Fernandez 71fbf8
fi