diff options
author | Matt Spinler <spinler@us.ibm.com> | 2019-12-12 10:04:33 -0600 |
---|---|---|
committer | Matt Spinler <spinler@us.ibm.com> | 2020-01-27 08:06:26 -0600 |
commit | f77debb9afbbe007ed7e2c3f79ddeb6f1b6f7c49 (patch) | |
tree | ef5d6ebba9d86054835000c213164e88d48fcfa8 /test | |
parent | 3019c6fb08b99af5e550910f241836e6e46f1c7b (diff) | |
download | phosphor-logging-f77debb9afbbe007ed7e2c3f79ddeb6f1b6f7c49.tar.gz phosphor-logging-f77debb9afbbe007ed7e2c3f79ddeb6f1b6f7c49.zip |
PEL: Take a PEL off the queue and send to host
Fill in the code that looks for the first PEL on the queue that still
needs to be sent up, and send it.
If the failure retry timer is active, or it has already retried the max
number of times, then don't send anything. In the former case the timer
callback will do the send, and in the latter the next time a log comes
in it will start trying again.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ibb9692ca83b23e5e021db8b8a89b5549fb979df1
Diffstat (limited to 'test')
-rw-r--r-- | test/openpower-pels/host_notifier_test.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/openpower-pels/host_notifier_test.cpp b/test/openpower-pels/host_notifier_test.cpp index 2f2e1f0..3608539 100644 --- a/test/openpower-pels/host_notifier_test.cpp +++ b/test/openpower-pels/host_notifier_test.cpp @@ -131,15 +131,18 @@ TEST_F(HostNotifierTest, TestPolicyAckedPEL) // This is required EXPECT_TRUE(notifier.enqueueRequired(pel->id())); + EXPECT_TRUE(notifier.notifyRequired(pel->id())); // Not in the repo EXPECT_FALSE(notifier.enqueueRequired(42)); + EXPECT_FALSE(notifier.notifyRequired(42)); // Now set this PEL to host acked repo.setPELHostTransState(pel->id(), TransmissionState::acked); // Since it's acked, doesn't need to be enqueued or transmitted EXPECT_FALSE(notifier.enqueueRequired(pel->id())); + EXPECT_FALSE(notifier.notifyRequired(pel->id())); } // Test the 'don't report' PEL flag @@ -189,6 +192,9 @@ TEST_F(HostNotifierTest, TestPolicyHiddenNoHMC) // Still need to enqueue this EXPECT_TRUE(notifier.enqueueRequired(pel->id())); + + // Still need to send it + EXPECT_TRUE(notifier.notifyRequired(pel->id())); } // Don't need to enqueue a hidden log already acked by the HMC @@ -220,6 +226,32 @@ TEST_F(HostNotifierTest, TestPolicyHiddenWithHMCAcked) EXPECT_FALSE(notifier.enqueueRequired(pel->id())); } +// Test that changing the HMC manage status affects +// the policy with hidden log notification. +TEST_F(HostNotifierTest, TestPolicyHiddenWithHMCManaged) +{ + Repository repo{repoPath}; + MockDataInterface dataIface; + + std::unique_ptr<HostInterface> hostIface = + std::make_unique<MockHostInterface>(event, dataIface); + + HostNotifier notifier{repo, dataIface, std::move(hostIface)}; + + // hiddenFlagBit + auto pel = makePEL(0x4000); + + repo.add(pel); + + // The first time, the HMC managed is false + EXPECT_TRUE(notifier.notifyRequired(pel->id())); + + dataIface.setHMCManaged(true); + + // This time, HMC managed is true so no need to notify + EXPECT_FALSE(notifier.notifyRequired(pel->id())); +} + // Test that PELs are enqueued on startup TEST_F(HostNotifierTest, TestStartup) { |