Implement sendTrap function

This function gets all the objects from the specific
notification class and send the snmp trap using the
netsnmp lib functions.

This commt adds the configure, makefile, bootstrap.sh,
clangformat file.

Add the unit test cases for ErrorNotification unit.

Change-Id: I2e982f18eb2745f2c0c8de0702cc85d12e80f6e3
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/test/Makefile.am.include b/test/Makefile.am.include
new file mode 100644
index 0000000..9c5435a
--- /dev/null
+++ b/test/Makefile.am.include
@@ -0,0 +1,18 @@
+AM_CPPFLAGS = \
+	-I${top_srcdir} \
+	-I${top_builddir} \
+	-Igtest \
+	$(GTEST_CPPFLAGS) \
+	$(CODE_COVERAGE_CPPFLAGS)
+
+AM_LDFLAGS = -lgtest_main -lgtest -lstdc++fs \
+	$(OESDK_TESTCASE_FLAGS) \
+	$(CODE_COVERAGE_LIBS)
+
+AM_CXXFLAGS = $(PTHREAD_CFLAGS) \
+	$(CODE_COVERAGE_CXXFLAGS)
+
+test_notification_SOURCES = \
+	%reldir%/test_error_notification.cpp
+
+check_PROGRAMS += %reldir%/notification
diff --git a/test/test_error_notification.cpp b/test/test_error_notification.cpp
new file mode 100644
index 0000000..4556a3e
--- /dev/null
+++ b/test/test_error_notification.cpp
@@ -0,0 +1,60 @@
+#include "snmp_notification.hpp"
+#include <gtest/gtest.h>
+#include <netinet/in.h>
+
+namespace phosphor
+{
+namespace network
+{
+namespace snmp
+{
+
+constexpr auto ERROR_NOTIF_FIELD_COUNT = 4;
+
+class TestErrorNotification : public testing::Test
+{
+  public:
+    OBMCErrorNotification notif;
+    TestErrorNotification()
+    {
+        // Empty
+    }
+    std::vector<Object> getFieldOIDList()
+    {
+        return notif.getFieldOIDList();
+    }
+};
+
+TEST_F(TestErrorNotification, VerifyErrorNotificationFields)
+{
+    auto oidList = getFieldOIDList();
+
+    // verify the number of the fields in the notification.
+    EXPECT_EQ(ERROR_NOTIF_FIELD_COUNT, oidList.size());
+
+    // Verify the type of each field.
+    EXPECT_EQ(ASN_UNSIGNED, std::get<Type>(oidList[0]));
+
+    EXPECT_EQ(ASN_OPAQUE_U64, std::get<Type>(oidList[1]));
+    EXPECT_EQ(ASN_INTEGER, std::get<Type>(oidList[2]));
+    EXPECT_EQ(ASN_OCTET_STR, std::get<Type>(oidList[3]));
+}
+
+TEST_F(TestErrorNotification, GetASNType)
+{
+    auto type = getASNType<uint32_t>();
+    EXPECT_EQ(ASN_UNSIGNED, type);
+
+    type = getASNType<uint64_t>();
+    EXPECT_EQ(ASN_OPAQUE_U64, type);
+
+    type = getASNType<int32_t>();
+    EXPECT_EQ(ASN_INTEGER, type);
+
+    type = getASNType<std::string>();
+    EXPECT_EQ(ASN_OCTET_STR, type);
+}
+
+} // namespec snmp
+} // namespce network
+} // namespace phosphor