summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting/common/processMrw.pl
diff options
context:
space:
mode:
authorRick Ward <rward15@us.ibm.com>2018-08-07 12:49:41 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-08-20 12:26:34 -0500
commitb265c68d057a1e9175cdc97268d940b95a219245 (patch)
tree3a89c77d109bea02b844201e4b6212ecdbdd8840 /src/usr/targeting/common/processMrw.pl
parent498b466c442549c0bd261ebd149dc7b610fbf2f1 (diff)
downloadtalos-hostboot-b265c68d057a1e9175cdc97268d940b95a219245.tar.gz
talos-hostboot-b265c68d057a1e9175cdc97268d940b95a219245.zip
OP issue: processMrw.pl should error on duplicate sensor IDs #75
Modified processMrw.pl to track sensor IDs seen, and to error out if the same sensor ID is seen more than once. Resolves: #75 Change-Id: Ic8b9aae67ae037acc771cac6c8920dfcfba7515e Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/64047 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-by: Roland Veloz <rveloz@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/targeting/common/processMrw.pl')
-rwxr-xr-xsrc/usr/targeting/common/processMrw.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/usr/targeting/common/processMrw.pl b/src/usr/targeting/common/processMrw.pl
index 9af8673b7..3d1a04759 100755
--- a/src/usr/targeting/common/processMrw.pl
+++ b/src/usr/targeting/common/processMrw.pl
@@ -509,6 +509,7 @@ sub processIpmiSensors {
$huid=$targetObj->getAttribute($target,"HUID");
}
my @sensors;
+ my %sensorIdsCnt;
foreach my $child (@{$targetObj->getTargetChildren($target)})
{
@@ -549,6 +550,16 @@ sub processIpmiSensors {
$sensor_name,$name,oct($entity_id),oct($sensor_type),
oct($sensor_evt), $sensor_id_str,$instance,$fru_id,
$huid,$target);
+
+ # Check that the sensor id hasn't already been used. Don't check
+ # blank sensor ids.
+ if (($sensor_id ne "") && (++$sensorIdsCnt{$sensor_id} >= 2)) {
+ print "ERROR: Duplicate IPMI_SENSOR_ID ($sensor_id_str)" .
+ " found in MRW. Sensor name is $sensor_name.\n";
+ print "$str";
+ $targetObj->myExit(3);
+ }
+
$targetObj->writeReport($str);
if ($name =~ /^GPU\d$/)
OpenPOWER on IntegriCloud