diff --git a/test/test_activation.cpp b/test/test_activation.cpp
index 891cdb6..0c40d97 100644
--- a/test/test_activation.cpp
+++ b/test/test_activation.cpp
@@ -11,16 +11,25 @@
 
 using ::testing::_;
 using ::testing::Return;
+using ::testing::StrEq;
+
+using std::experimental::any;
 
 class TestActivation : public ::testing::Test
 {
   public:
+    using PropertyType = utils::UtilsInterface::PropertyType;
     using Status = Activation::Status;
     using RequestedStatus = Activation::RequestedActivations;
     TestActivation() :
         mockedUtils(
             reinterpret_cast<const utils::MockedUtils&>(utils::getUtils()))
     {
+        // By default make it compatible with the test software
+        ON_CALL(mockedUtils, getPropertyImpl(_, _, _, _, StrEq(MANUFACTURER)))
+            .WillByDefault(Return(any(PropertyType(std::string("TestManu")))));
+        ON_CALL(mockedUtils, getPropertyImpl(_, _, _, _, StrEq(MODEL)))
+            .WillByDefault(Return(any(PropertyType(std::string("TestModel")))));
     }
     ~TestActivation()
     {
@@ -38,13 +47,18 @@
     {
         return activation->activationProgress->progress();
     }
+    const auto& getPsuQueue()
+    {
+        return activation->psuQueue;
+    }
+
     sdbusplus::SdBusMock sdbusMock;
     sdbusplus::bus::bus mockedBus = sdbusplus::get_mocked_new(&sdbusMock);
     const utils::MockedUtils& mockedUtils;
     MockedAssociationInterface mockedAssociationInterface;
     std::unique_ptr<Activation> activation;
     std::string versionId = "abcdefgh";
-    std::string extVersion = "Some Ext Version";
+    std::string extVersion = "manufacturer=TestManu,model=TestModel";
     std::string dBusPath = std::string(SOFTWARE_OBJPATH) + "/" + versionId;
     Status status = Status::Ready;
     AssociationList associations;
@@ -195,3 +209,97 @@
 
     EXPECT_EQ(Status::Failed, activation->activation());
 }
+
+TEST_F(TestActivation, doUpdateOnePSUModelNotCompatible)
+{
+    constexpr auto psu0 = "/com/example/inventory/psu0";
+    extVersion = "manufacturer=TestManu,model=DifferentModel";
+    activation = std::make_unique<Activation>(mockedBus, dBusPath, versionId,
+                                              extVersion, status, associations,
+                                              &mockedAssociationInterface);
+    ON_CALL(mockedUtils, getPSUInventoryPath(_))
+        .WillByDefault(Return(std::vector<std::string>({psu0})));
+    activation->requestedActivation(RequestedStatus::Active);
+
+    EXPECT_EQ(Status::Failed, activation->activation());
+}
+
+TEST_F(TestActivation, doUpdateOnePSUManufactureNotCompatible)
+{
+    constexpr auto psu0 = "/com/example/inventory/psu0";
+    extVersion = "manufacturer=DifferentManu,model=TestModel";
+    activation = std::make_unique<Activation>(mockedBus, dBusPath, versionId,
+                                              extVersion, status, associations,
+                                              &mockedAssociationInterface);
+    ON_CALL(mockedUtils, getPSUInventoryPath(_))
+        .WillByDefault(Return(std::vector<std::string>({psu0})));
+    activation->requestedActivation(RequestedStatus::Active);
+
+    EXPECT_EQ(Status::Failed, activation->activation());
+}
+
+TEST_F(TestActivation, doUpdateOnePSUSelfManufactureIsEmpty)
+{
+    ON_CALL(mockedUtils, getPropertyImpl(_, _, _, _, StrEq(MANUFACTURER)))
+        .WillByDefault(Return(any(PropertyType(std::string("")))));
+    extVersion = "manufacturer=AnyManu,model=TestModel";
+    // Below is the same as doUpdateOnePSUOK case
+    constexpr auto psu0 = "/com/example/inventory/psu0";
+    activation = std::make_unique<Activation>(mockedBus, dBusPath, versionId,
+                                              extVersion, status, associations,
+                                              &mockedAssociationInterface);
+    ON_CALL(mockedUtils, getPSUInventoryPath(_))
+        .WillByDefault(
+            Return(std::vector<std::string>({psu0}))); // One PSU inventory
+    activation->requestedActivation(RequestedStatus::Active);
+
+    EXPECT_EQ(Status::Activating, activation->activation());
+
+    EXPECT_CALL(mockedAssociationInterface, createActiveAssociation(dBusPath))
+        .Times(1);
+    EXPECT_CALL(mockedAssociationInterface, addFunctionalAssociation(dBusPath))
+        .Times(1);
+    onUpdateDone();
+    EXPECT_EQ(Status::Active, activation->activation());
+}
+
+TEST_F(TestActivation, doUpdateFourPSUsSecondPSUNotCompatible)
+{
+    constexpr auto psu0 = "/com/example/inventory/psu0";
+    constexpr auto psu1 = "/com/example/inventory/psu1";
+    constexpr auto psu2 = "/com/example/inventory/psu2";
+    constexpr auto psu3 = "/com/example/inventory/psu3";
+    ON_CALL(mockedUtils, getPropertyImpl(_, _, StrEq(psu1), _, StrEq(MODEL)))
+        .WillByDefault(
+            Return(any(PropertyType(std::string("DifferentModel")))));
+    activation = std::make_unique<Activation>(mockedBus, dBusPath, versionId,
+                                              extVersion, status, associations,
+                                              &mockedAssociationInterface);
+    ON_CALL(mockedUtils, getPSUInventoryPath(_))
+        .WillByDefault(Return(
+            std::vector<std::string>({psu0, psu1, psu2, psu3}))); // 4 PSUs
+    activation->requestedActivation(RequestedStatus::Active);
+
+    const auto& psuQueue = getPsuQueue();
+    EXPECT_EQ(3u, psuQueue.size());
+
+    // Only 3 PSUs shall be updated, and psu1 shall be skipped
+    EXPECT_EQ(Status::Activating, activation->activation());
+    EXPECT_EQ(10, getProgress());
+
+    onUpdateDone();
+    EXPECT_EQ(Status::Activating, activation->activation());
+    EXPECT_EQ(36, getProgress());
+
+    onUpdateDone();
+    EXPECT_EQ(Status::Activating, activation->activation());
+    EXPECT_EQ(62, getProgress());
+
+    EXPECT_CALL(mockedAssociationInterface, createActiveAssociation(dBusPath))
+        .Times(1);
+    EXPECT_CALL(mockedAssociationInterface, addFunctionalAssociation(dBusPath))
+        .Times(1);
+
+    onUpdateDone();
+    EXPECT_EQ(Status::Active, activation->activation());
+}
diff --git a/test/test_version.cpp b/test/test_version.cpp
index cba599f..8481952 100644
--- a/test/test_version.cpp
+++ b/test/test_version.cpp
@@ -65,3 +65,16 @@
     EXPECT_EQ("psu-dummy-test.v0.1", version);
     EXPECT_EQ("model=dummy_model,manufacture=dummy_manufacture", extVersion);
 }
+
+TEST_F(TestVersion, getExtVersionInfo)
+{
+    std::string extVersion = "";
+    auto ret = Version::getExtVersionInfo(extVersion);
+    EXPECT_TRUE(ret.empty());
+
+    extVersion = "manufacturer=TestManu,model=TestModel";
+    ret = Version::getExtVersionInfo(extVersion);
+    EXPECT_EQ(2u, ret.size());
+    EXPECT_EQ("TestManu", ret["manufacturer"]);
+    EXPECT_EQ("TestModel", ret["model"]);
+}
