runtest.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. # vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
  3. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. #
  5. # runtest.sh of /kernel/hwdata/idfiles/syntax
  6. # Description: checks for basic syntax errors
  7. # Author: Milos Malik <mmalik@redhat.com>
  8. #
  9. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  10. #
  11. # Copyright (c) 2009 Red Hat, Inc. All rights reserved.
  12. #
  13. # This copyrighted material is made available to anyone wishing
  14. # to use, modify, copy, or redistribute it subject to the terms
  15. # and conditions of the GNU General Public License version 2.
  16. #
  17. # This program is distributed in the hope that it will be
  18. # useful, but WITHOUT ANY WARRANTY; without even the implied
  19. # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  20. # PURPOSE. See the GNU General Public License for more details.
  21. #
  22. # You should have received a copy of the GNU General Public
  23. # License along with this program; if not, write to the Free
  24. # Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  25. # Boston, MA 02110-1301, USA.
  26. #
  27. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  28. # Include rhts environment
  29. . /usr/share/beakerlib/beakerlib.sh || exit 1
  30. PACKAGE="hwdata"
  31. rlJournalStart
  32. rlPhaseStartSetup
  33. rlAssertRpm ${PACKAGE}
  34. rlAssertRpm pciutils
  35. rlAssertRpm usbutils
  36. OUTPUT_FILE=`mktemp`
  37. rlPhaseEnd
  38. rlPhaseStartTest
  39. rlRun "lspci >& ${OUTPUT_FILE}"
  40. rlRun "grep -i 'unknown line' ${OUTPUT_FILE}" 1
  41. rlRun "lsusb >& ${OUTPUT_FILE}" 0,1
  42. rlRun "grep -i 'unknown line' ${OUTPUT_FILE}" 1
  43. rlPhaseEnd
  44. rlPhaseStartCleanup
  45. rm -f ${OUTPUT_FILE}
  46. rlPhaseEnd
  47. rlJournalPrintText
  48. rlJournalEnd