Blame tests/scripts/run_tests.sh

Qiao Zhao b222df
#!/usr/bin/bash
Qiao Zhao b222df
Qiao Zhao b222df
if rpm -q --quiet libtraceevent; then
Qiao Zhao b222df
    :
Qiao Zhao b222df
else
Qiao Zhao b222df
    sudo dnf install -y libtraceevent
Qiao Zhao b222df
    if [[ $? != 0 ]]; then
Qiao Zhao b222df
       echo "install of libtraceevent failed!"
Qiao Zhao b222df
       exit 1
Qiao Zhao b222df
    fi
Qiao Zhao b222df
fi
Qiao Zhao b222df
Qiao Zhao b222df
echo "libtraceevent is a library to parse raw trace event formats. Check installation."
Qiao Zhao b222df
if [[ ! -f /usr/lib64/libtraceevent.so.1 ]]; then
Qiao Zhao b222df
    echo "/usr/lib64/libtraceevent.so.1 not found!"
Qiao Zhao b222df
    exit 2
Qiao Zhao b222df
fi
Qiao Zhao b222df
Qiao Zhao b222df
echo "Check the trace-cmd works."
Qiao Zhao b222df
if ! rpm -q --quiet trace-cmd; then
Qiao Zhao b222df
    sudo dnf install -y trace-cmd
Qiao Zhao b222df
    if [[ $? != 0 ]]; then
Qiao Zhao b222df
        echo "install trace-cmd failed when libtraceevent exist!"
Qiao Zhao b222df
        exit 3
Qiao Zhao b222df
    fi
Qiao Zhao b222df
fi
Qiao Zhao b222df
trace-cmd list || exit 4
Qiao Zhao b222df
Qiao Zhao b222df
exit 0
Qiao Zhao b222df