#!/bin/bash # vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k . /usr/share/beakerlib/beakerlib.sh || exit 1 rlJournalStart rlPhaseStartSetup rlAssertRpm "libcpuid" TestDir=$(pwd) rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory" rlRun "pushd $tmp" rlIsRHEL && repos="--enablerepo=rhel-CRB --enablerepo=rhel-buildroot" rlIsCentOS && repos="--enablerepo=crb" rlIsRHELLike && rlRun "dnf install -y $(rlGetRecommended) $repos" rlCheckDependencies rlRun "gcc $TestDir/test_libcpuid.c -o test_libcpuid -I/usr/include/libcpuid -lcpuid" rlAssertExists "./test_libcpuid" rlPhaseEnd rlPhaseStartTest rlRun "./test_libcpuid &> libcpuid.log" rlAssertNotGrep "Error getting raw CPU data" libcpuid.log rlAssertNotGrep "Error identifying CPU" libcpuid.log rlAssertNotGrep "Error retrieving clock frequency" libcpuid.log rlAssertNotGrep "Error: Vendor string is empty or NULL." libcpuid.log rlAssertNotGrep "Error: Model string is empty or NULL" libcpuid.log rlAssertNotGrep "Error: Number of cores is not greater than 0" libcpuid.log rlAssertNotGrep "Error: Number of logical CPUs is not greater than 0" libcpuid.log rlRun "cat libcpuid.log" rlPhaseEnd rlPhaseStartCleanup rlRun "popd" rlRun "rm -r $tmp" 0 "Remove tmp directory" rlPhaseEnd rlJournalEnd