LEDS: Provide support to override the default Blink priority
In some cases, it is needed that the Solid-ON action over rules
Blink and this patch adds that support.
Change-Id: Ib0a88b11142ccef3e39ef0a7c6eb3a037c878bc2
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/test/led-test-map.hpp b/test/led-test-map.hpp
index a8a62af..0b44ee3 100644
--- a/test/led-test-map.hpp
+++ b/test/led-test-map.hpp
@@ -1,7 +1,8 @@
static const std::map<std::string,
std::set<phosphor::led::Layout::LedAction>> singleLedOn = {
{ "/xyz/openbmc_project/ledmanager/groups/SingleLed",{
- {"One",phosphor::led::Layout::On},
+ {"One",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::Blink},
}
},
};
@@ -9,7 +10,17 @@
static const std::map<std::string,
std::set<phosphor::led::Layout::LedAction>> singleLedBlink = {
{ "/xyz/openbmc_project/ledmanager/groups/SingleLed",{
- {"One",phosphor::led::Layout::Blink},
+ {"One",phosphor::led::Layout::Blink, 0,
+ 0, phosphor::led::Layout::Blink},
+ }
+ },
+};
+
+static const std::map<std::string,
+ std::set<phosphor::led::Layout::LedAction>> singleLedBlinkOverrideOn = {
+ { "/xyz/openbmc_project/ledmanager/groups/SingleLed",{
+ {"One",phosphor::led::Layout::Blink, 0,
+ 0, phosphor::led::Layout::On},
}
},
};
@@ -17,9 +28,12 @@
static const std::map<std::string,
std::set<phosphor::led::Layout::LedAction>> multipleLedsOn = {
{ "/xyz/openbmc_project/ledmanager/groups/MultipleLeds",{
- {"One",phosphor::led::Layout::On},
- {"Two",phosphor::led::Layout::On},
- {"Three",phosphor::led::Layout::On},
+ {"One",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Two",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Three",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
}
},
};
@@ -27,9 +41,12 @@
static const std::map<std::string,
std::set<phosphor::led::Layout::LedAction>> multipleLedsBlink = {
{ "/xyz/openbmc_project/ledmanager/groups/MultipleLeds",{
- {"One",phosphor::led::Layout::Blink},
- {"Two",phosphor::led::Layout::Blink},
- {"Three",phosphor::led::Layout::Blink},
+ {"One",phosphor::led::Layout::Blink, 0,
+ 0, phosphor::led::Layout::Blink},
+ {"Two",phosphor::led::Layout::Blink, 0,
+ 0, phosphor::led::Layout::Blink},
+ {"Three",phosphor::led::Layout::Blink,0,
+ 0, phosphor::led::Layout::Blink},
}
},
};
@@ -37,11 +54,16 @@
static const std::map<std::string,
std::set<phosphor::led::Layout::LedAction>> multipleLedsOnAndBlink = {
{ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsMix",{
- {"One",phosphor::led::Layout::Blink},
- {"Two",phosphor::led::Layout::On},
- {"Three",phosphor::led::Layout::Blink},
- {"Four",phosphor::led::Layout::On},
- {"Five",phosphor::led::Layout::On},
+ {"One",phosphor::led::Layout::Blink, 0,
+ 0, phosphor::led::Layout::Blink},
+ {"Two",phosphor::led::Layout::On,
+ 0, phosphor::led::Layout::Blink},
+ {"Three",phosphor::led::Layout::Blink,
+ 0, phosphor::led::Layout::On},
+ {"Four",phosphor::led::Layout::On,
+ 0, phosphor::led::Layout::Blink},
+ {"Five",phosphor::led::Layout::On,
+ 0, phosphor::led::Layout::Blink},
}
},
};
@@ -49,15 +71,21 @@
static const std::map<std::string,
std::set<phosphor::led::Layout::LedAction>> twoGroupsWithDistinctLEDsOn = {
{ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",{
- {"One",phosphor::led::Layout::On},
- {"Two",phosphor::led::Layout::On},
- {"Three",phosphor::led::Layout::On},
+ {"One",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::Blink},
+ {"Two",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Three",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::Blink},
}
},
{ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",{
- {"Four",phosphor::led::Layout::On},
- {"Five",phosphor::led::Layout::On},
- {"Six",phosphor::led::Layout::On},
+ {"Four",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::Blink},
+ {"Five",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::Blink},
+ {"Six",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
}
},
};
@@ -65,33 +93,65 @@
static const std::map<std::string,
std::set<phosphor::led::Layout::LedAction>> twoGroupsWithOneComonLEDOn = {
{ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",{
- {"One",phosphor::led::Layout::On},
- {"Two",phosphor::led::Layout::On},
- {"Three",phosphor::led::Layout::On},
+ {"One",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Two",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Three",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
}
},
{ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",{
- {"Four",phosphor::led::Layout::On},
- {"Three",phosphor::led::Layout::On},
- {"Six",phosphor::led::Layout::On},
+ {"Four",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Three",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Six",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
}
},
};
static const std::map<std::string,
- std::set<phosphor::led::Layout::LedAction>>
- twoGroupsWithOneComonLEDInDifferentState = {
+ std::set<phosphor::led::Layout::LedAction>> twoGroupsWithOneComonLEDOnOneLEDBlinkPriority = {
{ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",{
- {"One",phosphor::led::Layout::On},
- {"Two",phosphor::led::Layout::On},
- {"Three",phosphor::led::Layout::On},
+ {"One",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Two",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Three",phosphor::led::Layout::Blink, 0,
+ 0, phosphor::led::Layout::Blink},
}
},
{ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",{
- {"Two",phosphor::led::Layout::Blink},
- {"Four",phosphor::led::Layout::On},
- {"Five",phosphor::led::Layout::On},
- {"Six",phosphor::led::Layout::On},
+ {"Four",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Three",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::Blink},
+ {"Six",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ }
+ },
+};
+
+static const std::map<std::string,
+ std::set<phosphor::led::Layout::LedAction>> twoGroupsWithOneComonLEDOnPriority = {
+ { "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",{
+ {"One",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Two",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Three",phosphor::led::Layout::Blink, 0,
+ 0, phosphor::led::Layout::On},
+ }
+ },
+ { "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",{
+ {"Four",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Three",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Six",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
}
},
};
@@ -100,16 +160,23 @@
std::set<phosphor::led::Layout::LedAction>>
twoGroupsWithMultiplComonLEDOn = {
{ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",{
- {"One",phosphor::led::Layout::On},
- {"Two",phosphor::led::Layout::On},
- {"Three",phosphor::led::Layout::On},
+ {"One",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Two",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Three",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
}
},
{ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",{
- {"Two",phosphor::led::Layout::On},
- {"Six",phosphor::led::Layout::On},
- {"Three",phosphor::led::Layout::On},
- {"Seven",phosphor::led::Layout::On},
+ {"Two",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Six",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Three",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Seven",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
}
},
};
@@ -118,36 +185,56 @@
std::set<phosphor::led::Layout::LedAction>>
twoGroupsWithMultipleComonLEDInDifferentState = {
{ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",{
- {"One",phosphor::led::Layout::On},
- {"Two",phosphor::led::Layout::Blink},
- {"Three",phosphor::led::Layout::On},
- {"Four",phosphor::led::Layout::On},
+ {"One",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Two",phosphor::led::Layout::Blink, 0,
+ 0, phosphor::led::Layout::On},
+ {"Three",phosphor::led::Layout::Blink, 0,
+ 0, phosphor::led::Layout::On},
+ {"Four",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
}
},
{ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",{
- {"Two",phosphor::led::Layout::On},
- {"Three",phosphor::led::Layout::Blink},
- {"Five",phosphor::led::Layout::On},
- {"Six",phosphor::led::Layout::On},
+ {"Two",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Three",phosphor::led::Layout::Blink, 0,
+ 0, phosphor::led::Layout::On},
+ {"Five",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Six",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
}
},
};
static const std::map<std::string,
std::set<phosphor::led::Layout::LedAction>>
- twoGroupsWithMultipleComonLEDInDifferentStateBlinkAgain = {
+ twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority = {
{ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",{
- {"One",phosphor::led::Layout::On},
- {"Two",phosphor::led::Layout::Blink},
- {"Three",phosphor::led::Layout::On},
- {"Four",phosphor::led::Layout::On},
+ {"One",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Two",phosphor::led::Layout::Blink, 0,
+ 0, phosphor::led::Layout::On},
+ {"Three",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::Blink},
+ {"Four",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Ten",phosphor::led::Layout::Blink, 0,
+ 0, phosphor::led::Layout::Blink},
}
},
{ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",{
- {"Two",phosphor::led::Layout::Blink},
- {"Three",phosphor::led::Layout::Blink},
- {"Five",phosphor::led::Layout::On},
- {"Six",phosphor::led::Layout::On},
+ {"Two",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Three",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::Blink},
+ {"Five",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Six",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::On},
+ {"Ten",phosphor::led::Layout::On, 0,
+ 0, phosphor::led::Layout::Blink},
}
},
};