attn: Remove stub code intended for native build
Removed some stub code that was originally used to build
openpower-hw-diags natively (via local meson/ninja). Building in this
manner is not supported right now due to the numerous external
dependencies required by the final binary.
Signed-off-by: Ben Tyner <ben.tyner@ibm.com>
Change-Id: I58c932f68e6cfe980a9a9503fc6e8d71bbd3528a
diff --git a/test/end2end/bp_handler.cpp b/test/end2end/bp_handler.cpp
deleted file mode 100644
index dd0935d..0000000
--- a/test/end2end/bp_handler.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <util/trace.hpp>
-
-namespace attn
-{
-
-/** @brief Breakpoint special attention handler */
-void bpHandler()
-{
- // trace message
- trace::inf("breakpoint handler");
-}
-
-} // namespace attn
diff --git a/test/end2end/logging.cpp b/test/end2end/logging.cpp
deleted file mode 100644
index 6342e27..0000000
--- a/test/end2end/logging.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <attn/attn_logging.hpp>
-
-#include <iostream>
-
-namespace attn
-{
-
-void eventAttentionFail(int i_error)
-{
- std::cout << "event: attention fail" << i_error << std::endl;
-}
-
-void eventTerminate(std::map<std::string, std::string> i_additionalData,
- char* i_tiInfoData)
-{
- std::cout << "event: terminate" << std::endl;
-
- std::map<std::string, std::string>::iterator itr;
- for (itr = i_additionalData.begin(); itr != i_additionalData.end(); ++itr)
- {
- std::cout << '\t' << itr->first << '\t' << itr->second << '\n';
- }
- std::cout << std::endl;
-
- if (nullptr != i_tiInfoData)
- {
- std::cout << "TI data present" << std::endl;
- }
-}
-
-uint32_t eventVital()
-{
- std::cout << "event: vital" << std::endl;
- return 0;
-}
-
-} // namespace attn
diff --git a/test/end2end/main.cpp b/test/end2end/main.cpp
index c523842..ff7d468 100644
--- a/test/end2end/main.cpp
+++ b/test/end2end/main.cpp
@@ -1,8 +1,20 @@
#include <libpdbg.h>
+#include <attn/attention.hpp>
#include <attn/attn_config.hpp>
#include <attn/attn_handler.hpp>
#include <cli.hpp>
+#include <util/trace.hpp>
+
+#include <vector>
+
+namespace attn
+{
+// these are in the attn_lib but not all exposed via headers
+int handleSpecial(Attention* i_attention);
+int handleCheckstop(Attention* i_attention);
+int handleVital(Attention* i_attention);
+} // namespace attn
/** @brief Attention handler test application */
int main(int argc, char* argv[])
@@ -21,5 +33,39 @@
// exercise attention gpio event path
attn::attnHandler(&attnConfig);
+ // Get first enabled proc for testing
+ pdbg_target* target = nullptr;
+ pdbg_for_each_class_target("proc", target)
+ {
+ trace::inf("proc: %u", pdbg_target_index(target));
+ if (PDBG_TARGET_ENABLED == pdbg_target_probe(target))
+ {
+ trace::inf("target enabled");
+ break;
+ }
+ }
+
+ // Exercise special, checkstop and vital attention handler paths
+ if ((nullptr != target) &&
+ (PDBG_TARGET_ENABLED == pdbg_target_probe(target)))
+ {
+ std::vector<attn::Attention> attentions;
+
+ attentions.emplace_back(attn::Attention::AttentionType::Special,
+ attn::handleSpecial, target, &attnConfig);
+
+ attentions.emplace_back(attn::Attention::AttentionType::Checkstop,
+ attn::handleCheckstop, target, &attnConfig);
+
+ attentions.emplace_back(attn::Attention::AttentionType::Vital,
+ attn::handleVital, target, &attnConfig);
+
+ std::for_each(std::begin(attentions), std::end(attentions),
+ [](attn::Attention attention) {
+ trace::inf("calling handler");
+ attention.handle();
+ });
+ }
+
return rc;
}
diff --git a/test/end2end/meson.build b/test/end2end/meson.build
index 9a12d7b..adb8eeb 100644
--- a/test/end2end/meson.build
+++ b/test/end2end/meson.build
@@ -1,10 +1,6 @@
# Source files specific to end2end test.
end2end_src = [
- 'bp_handler.cpp',
- 'logging.cpp',
'main.cpp',
- 'ti_handler.cpp',
- 'vital_handler.cpp'
]
# Additional source files needed for test.
@@ -13,11 +9,11 @@
]
# create openpower-hw-diags executable for local testing
-end2end = executable('openpower-hw-diags-test',
+end2end = executable('test-openpower-hw-diags',
end2end_src, additional_src,
link_with : hwdiags_libs,
include_directories : incdir,
cpp_args : test_arg,
install : false)
-test('openpower-hw-diags-test', end2end)
+test('test-openpower-hw-diags', end2end)
diff --git a/test/end2end/ti_handler.cpp b/test/end2end/ti_handler.cpp
deleted file mode 100644
index f869c81..0000000
--- a/test/end2end/ti_handler.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-//#include <attn/attn_logging.hpp>
-#include <util/trace.hpp>
-
-namespace attn
-{
-
-/** @brief Handle TI special attention */
-void tiHandler()
-{
- // trace message
- trace::inf("TI handler");
-}
-
-} // namespace attn
diff --git a/test/end2end/vital_handler.cpp b/test/end2end/vital_handler.cpp
deleted file mode 100644
index 342ab69..0000000
--- a/test/end2end/vital_handler.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <attn/attention.hpp> // for Attention
-#include <attn/attn_common.hpp> // for RC_SUCCESS
-#include <util/trace.hpp>
-
-namespace attn
-{
-
-/** @brief Handle SBE vital attention */
-int handleVital(Attention* i_attention)
-{
- int rc = RC_SUCCESS;
-
- // trace message
- trace::inf("Vital handler");
-
- // sanity check
- if (nullptr == i_attention)
- {
- trace::inf("attention type is null");
- rc = RC_NOT_HANDLED;
- }
-
- return rc;
-}
-
-} // namespace attn