Fix ids-files test - MonitorsDB is not shipped anymore,

update pci.ids URL to be aligned with upstream
This commit is contained in:
Vitezslav Crhonek 2019-03-27 14:24:31 +01:00
parent a38491e555
commit 84a36c333f

View File

@ -33,10 +33,9 @@
PACKAGE="hwdata"
HWDATA_DIR="/usr/share/hwdata"
PCI_IDS_FILE="pci.ids"
PCI_IDS_URL="http://pci-ids.ucw.cz/v2.2/pci.ids"
PCI_IDS_URL="https://raw.githubusercontent.com/pciutils/pciids/master/pci.ids"
USB_IDS_FILE="usb.ids"
USB_IDS_URL="http://www.linux-usb.org/usb.ids"
MONITORS_FILE="MonitorsDB"
rlJournalStart
rlPhaseStartSetup
@ -44,9 +43,6 @@ rlJournalStart
rlAssertRpm wget
rlAssertExists ${HWDATA_DIR}/${PCI_IDS_FILE}
rlAssertExists ${HWDATA_DIR}/${USB_IDS_FILE}
if rlIsRHEL 6 ; then
rlAssertExists ${HWDATA_DIR}/${MONITORS_FILE}
fi
rlPhaseEnd
rlPhaseStartTest
@ -65,21 +61,6 @@ rlJournalStart
echo "Common lines: "`comm -1 -2 ${USB_IDS_FILE} ${HWDATA_DIR}/${USB_IDS_FILE} | wc -l`
echo "Different lines in upstream file: "`comm -2 -3 ${USB_IDS_FILE} ${HWDATA_DIR}/${USB_IDS_FILE} | wc -l`
echo "Different lines in our file: "`comm -1 -3 ${USB_IDS_FILE} ${HWDATA_DIR}/${USB_IDS_FILE} | wc -l`
if ! rlIsRHEL 7 ; then
rlLog "Checking the format of ${HWDATA_DIR}/${MONITORS_FILE}"
fi
LINE=0
while read ; do
let "LINE += 1"
if echo ${REPLY} | grep -e '^#' -e '^ *$' >& /dev/null ; then
continue
fi
COUNT=`echo ${REPLY} | tr ';' '\n' | wc -l`
if [ ${COUNT} -lt 5 -o ${COUNT} -gt 6 ] ; then
rlFail "Wrong format on line ${LINE}"
fi
done < ${HWDATA_DIR}/${MONITORS_FILE}
rlPhaseEnd
rlPhaseStartCleanup