fw update: tests for common code

Tests for the common code introduced in another commit.

These tests should check that the common code behaves as outlined in the
design [1]

References:
[1] https://github.com/openbmc/docs/blob/master/designs/code-update.md

Tested: unit tests pass

Change-Id: I8f12839afd47ef3403a80439af54fedcc00f10be
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/test/common/nopdevice/nopdevice.hpp b/test/common/nopdevice/nopdevice.hpp
new file mode 100644
index 0000000..0f3b24e
--- /dev/null
+++ b/test/common/nopdevice/nopdevice.hpp
@@ -0,0 +1,51 @@
+#pragma once
+
+#include "common/include/device.hpp"
+#include "common/include/software_manager.hpp"
+
+#include <phosphor-logging/lg2.hpp>
+#include <sdbusplus/asio/connection.hpp>
+#include <sdbusplus/asio/object_server.hpp>
+#include <sdbusplus/async.hpp>
+#include <sdbusplus/server.hpp>
+#include <xyz/openbmc_project/Association/Definitions/server.hpp>
+#include <xyz/openbmc_project/Software/Update/server.hpp>
+
+#include <memory>
+
+class NopCodeUpdater : public SoftwareManager
+{
+  public:
+    NopCodeUpdater(sdbusplus::async::context& ctx);
+    NopCodeUpdater(sdbusplus::async::context& ctx, long uniqueSuffix);
+
+    sdbusplus::async::task<> getInitialConfigurationSingleDevice(
+        const std::string& service, const std::string& path,
+        DeviceConfig& config) final;
+};
+
+const std::string exampleConfigObjPath =
+    "/xyz/openbmc_project/inventory/system/board/Tyan_S5549_Baseboard/HostSPIFlash";
+const std::string exampleName = "HostSPIFlash";
+
+const uint32_t exampleVendorIANA = 0x0000a015;
+const std::string exampleCompatible = "com.example.compatible";
+
+class NopDevice : public Device
+{
+  public:
+    NopDevice(sdbusplus::async::context& ctx, const DeviceConfig& config,
+              SoftwareManager* parent);
+    NopDevice(sdbusplus::async::context& ctx, SoftwareManager* parent);
+
+    // NOLINTBEGIN
+    sdbusplus::async::task<bool> updateDevice(
+        const uint8_t* image, size_t image_size,
+        std::unique_ptr<SoftwareActivationProgress>& activationProgress)
+        override;
+    // NOLINTEND
+
+    sdbusplus::async::task<std::string> getInventoryItemObjectPath() override;
+
+    bool deviceSpecificUpdateFunctionCalled = false;
+};