diff --git a/test/meson.build b/test/meson.build
index a8f9793..eab0c67 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -11,50 +11,37 @@
 else
   dynamic_linker = []
 endif
-
 gmock = dependency('gmock', disabler: true, required: build_tests)
 gtest = dependency('gtest', main: true, disabler: true, required: build_tests)
+dependecy_list = [gtest, gmock, sdbusplus, phosphor_logging, phosphor_dbus_interfaces]
 
-application_src = ['../impl.cpp']
+configuration_inc = include_directories('..', '../vpd-manager', 'vpd-manager-test')
 
-test('store_test', executable('store_test',
-        ['store/store.cpp', application_src],
-build_rpath: get_option('oe-sdk').enabled() ? rpath : '',
+vpd_test = ['store/store.cpp',
+            'ipz_parser/parser.cpp',
+            'keyword_vpd_parser_test/kw_vpd_test.cpp',
+            'vpd-manager-test/reader_test.cpp',
+           ]
 
-link_args: dynamic_linker,
-dependencies: [
-            gtest,
-            gmock,
-            sdbusplus,
-            phosphor_logging,
-    ],
-include_directories: '..'
-),
-workdir: meson.current_source_dir())
+application_src =['../impl.cpp',
+                   '../vpdecc/vpdecc.c',
+                   '../vpdecc/vpdecc_support.c',
+                   '../parser.cpp',
+                   '../utils.cpp',
+                   '../vpd-manager/reader_impl.cpp',
+                   '../keyword_vpd_parser.cpp',
+                  ]
 
-vpd_test = ['ipz_parser/parser.cpp',
-                'keyword_vpd_parser_test/kw_vpd_test.cpp'
-    ]
-application_src += ['../keyword_vpd_parser.cpp',
-  '../vpdecc/vpdecc.c',
-  '../vpdecc/vpdecc_support.c'
-    ]
 foreach t : vpd_test
     test(t, executable(t.underscorify(),
             [t, application_src],
     build_rpath: get_option('oe-sdk').enabled() ? rpath : '',
-
     link_args: dynamic_linker,
-    cpp_args: '-DIPZ_PARSER',
+    cpp_args: ['-DIPZ_PARSER', '-DManagerTest'],
     c_args: ['-Wno-unused-parameter',
       '-Wno-unused-variable'],
-    dependencies: [
-                gtest,
-                gmock,
-                sdbusplus,
-                phosphor_logging,
-        ],
-    include_directories: '..'
+    dependencies: dependecy_list,
+    include_directories: configuration_inc
     ),
     workdir: meson.current_source_dir())
 endforeach
diff --git a/test/vpd-manager-test/reader_test.cpp b/test/vpd-manager-test/reader_test.cpp
new file mode 100644
index 0000000..b6cf80c
--- /dev/null
+++ b/test/vpd-manager-test/reader_test.cpp
@@ -0,0 +1,254 @@
+#include "reader_test.hpp"
+
+#include "const.hpp"
+#include "reader_impl.hpp"
+#include "types.hpp"
+
+#include <fstream>
+#include <nlohmann/json.hpp>
+#include <tuple>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+using namespace openpower::vpd::manager::reader;
+using namespace openpower::vpd::inventory;
+using namespace openpower::vpd::constants;
+
+class vpdManagerReaderTest : public ::testing::Test
+{
+  protected:
+    nlohmann::json jsonFile;
+
+    // map to hold the mapping of location code and inventory path
+    LocationCodeMap fruLocationCode;
+
+    // dummy value of node number
+    const uint8_t nodeNumber = 1;
+
+  public:
+    // constructor
+    vpdManagerReaderTest()
+    {
+        processJson();
+    }
+
+    void processJson();
+};
+
+using namespace openpower::vpd;
+
+void vpdManagerReaderTest::processJson()
+{
+    // read the json file and parse it
+    std::ifstream json("vpd-manager-test/vpd_reader_test.json",
+                       std::ios::binary);
+
+    if (!json)
+    {
+        throw std::runtime_error("json file not found");
+    }
+
+    jsonFile = nlohmann::json::parse(json);
+
+    if (jsonFile.find("frus") == jsonFile.end())
+    {
+        throw std::runtime_error("frus group not found in json");
+    }
+
+    const nlohmann::json& groupFRUS =
+        jsonFile["frus"].get_ref<const nlohmann::json::object_t&>();
+    for (const auto& itemFRUS : groupFRUS.items())
+    {
+        const std::vector<nlohmann::json>& groupEEPROM =
+            itemFRUS.value().get_ref<const nlohmann::json::array_t&>();
+        for (const auto& itemEEPROM : groupEEPROM)
+        {
+            fruLocationCode.emplace(
+                itemEEPROM["extraInterfaces"][LOCATION_CODE_INF]["LocationCode"]
+                    .get_ref<const nlohmann::json::string_t&>(),
+                itemEEPROM["inventoryPath"]
+                    .get_ref<const nlohmann::json::string_t&>());
+        }
+    }
+}
+
+TEST_F(vpdManagerReaderTest, isValidLocationCode_invalid)
+{
+    // No MTS or FCS in the collapsed location code
+    std::string unexpandedLocationCode_Invalid = "Uabc-X0";
+
+    MockUtilCalls uCalls;
+    ReaderImpl read(uCalls);
+    EXPECT_ANY_THROW({
+        read.getExpandedLocationCode(unexpandedLocationCode_Invalid, nodeNumber,
+                                     fruLocationCode);
+    });
+
+    // not starting with U
+    unexpandedLocationCode_Invalid = "Mabc-X0";
+    EXPECT_ANY_THROW({
+        read.getExpandedLocationCode(unexpandedLocationCode_Invalid, nodeNumber,
+                                     fruLocationCode);
+    });
+}
+
+TEST_F(vpdManagerReaderTest, getExpandedLocationCode_Invalid)
+{
+    std::string unexpandedLocationCode_Invalid = "Uabc-X0";
+
+    MockUtilCalls uCalls;
+    ReaderImpl read(uCalls);
+    EXPECT_ANY_THROW({
+        read.getExpandedLocationCode(unexpandedLocationCode_Invalid, nodeNumber,
+                                     fruLocationCode);
+    });
+}
+
+TEST_F(vpdManagerReaderTest, getExpandedLocationCode_Valid)
+{
+    // mock the call to read bus property
+    MockUtilCalls uCalls;
+    EXPECT_CALL(uCalls, readBusProperty("/system/chassis/motherboard",
+                                        LOCATION_CODE_INF, "LocationCode"))
+        .Times(1)
+        .WillOnce(testing::Return("U78DA.ND1.1234567-P0"));
+
+    std::string unexpandedLocationCode = "Ufcs-P0";
+    ReaderImpl read(uCalls);
+    std::string res = read.getExpandedLocationCode(unexpandedLocationCode,
+                                                   nodeNumber, fruLocationCode);
+
+    EXPECT_EQ(res, "U78DA.ND1.1234567-P0");
+}
+
+TEST_F(vpdManagerReaderTest, getFrusAtLocation_Invalid)
+{
+    // invalid lication code
+    std::string unexpandedLocationCode = "Uabc-X0";
+
+    MockUtilCalls uCalls;
+    ReaderImpl read(uCalls);
+    EXPECT_ANY_THROW({
+        read.getFrusAtLocation(unexpandedLocationCode, nodeNumber,
+                               fruLocationCode);
+    });
+
+    // map to hold the mapping of location code and inventory path, empty in
+    // this case
+    LocationCodeMap mapLocationCode;
+    unexpandedLocationCode = "Ufcs-P0";
+    EXPECT_ANY_THROW({
+        read.getFrusAtLocation(unexpandedLocationCode, nodeNumber,
+                               mapLocationCode);
+    });
+}
+
+TEST_F(vpdManagerReaderTest, getFrusAtLocation_Valid)
+{
+    std::string LocationCode = "Ufcs-P0";
+
+    MockUtilCalls uCalls;
+    ReaderImpl read(uCalls);
+    ListOfPaths paths =
+        read.getFrusAtLocation(LocationCode, nodeNumber, fruLocationCode);
+    std::string expected =
+        "/xyz/openbmc_project/inventory/system/chassis/motherboard";
+    EXPECT_EQ(paths.at(0), expected);
+}
+
+TEST_F(vpdManagerReaderTest, getFRUsByExpandedLocationCode_invalid)
+{
+    // not starting from U
+    std::string locationCode = "9105.22A.SIMP10R";
+
+    MockUtilCalls uCalls;
+    ReaderImpl read(uCalls);
+    ListOfPaths paths;
+    EXPECT_ANY_THROW({
+        paths =
+            read.getFRUsByExpandedLocationCode(locationCode, fruLocationCode);
+    });
+
+    // unused variable warning
+    (void)paths;
+
+    // length is les sthan 17 for expanded location code
+    locationCode = "U9105.22A.SIMP10";
+    EXPECT_ANY_THROW({
+        paths =
+            read.getFRUsByExpandedLocationCode(locationCode, fruLocationCode);
+    });
+
+    // Invalid location code. No "."
+    locationCode = "U78DAND11234567-P0";
+
+    // Mock readBUsproperty call
+    EXPECT_CALL(uCalls,
+                readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VCEN", "FC"))
+        .Times(1)
+        .WillOnce(
+            testing::Return("78DAPQRS")); // return a dummy value for FC keyword
+
+    // unused variable warning
+    (void)paths;
+    EXPECT_ANY_THROW({
+        paths =
+            read.getFRUsByExpandedLocationCode(locationCode, fruLocationCode);
+    });
+}
+
+TEST_F(vpdManagerReaderTest, getFRUsByExpandedLocationCode_Valid_FC)
+{
+    // valid location code with FC kwd.
+    std::string validLocationCode = "U78DA.ND1.1234567-P0";
+
+    // Mock readBUsproperty call
+    MockUtilCalls uCalls;
+    EXPECT_CALL(uCalls,
+                readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VCEN", "FC"))
+        .WillRepeatedly(
+            testing::Return("78DAPQRS")); // return a dummy value for FC keyword
+
+    ReaderImpl read(uCalls);
+    ListOfPaths paths =
+        read.getFRUsByExpandedLocationCode(validLocationCode, fruLocationCode);
+
+    std::string expected =
+        "/xyz/openbmc_project/inventory/system/chassis/motherboard";
+    EXPECT_EQ(paths.at(0), expected);
+}
+
+TEST_F(vpdManagerReaderTest, getFRUsByExpandedLocationCode_Valid_TM)
+{
+    // valid location code with TM kwd.
+    std::string validLocationCode = "U9105.22A.SIMP10R";
+
+    // Mock readBUsproperty call
+    MockUtilCalls uCalls;
+    EXPECT_CALL(uCalls,
+                readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VCEN", "FC"))
+        .Times(1)
+        .WillOnce(
+            testing::Return("78DAPQRS")); // return a dummy value for FC keyword
+
+    EXPECT_CALL(uCalls,
+                readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VSYS", "TM"))
+        .Times(1)
+        .WillOnce(
+            testing::Return("9105PQRS")); // return a dummy value for TM keyword
+
+    ReaderImpl read(uCalls);
+    ListOfPaths paths =
+        read.getFRUsByExpandedLocationCode(validLocationCode, fruLocationCode);
+
+    std::string expected = "/xyz/openbmc_project/inventory/system";
+    EXPECT_EQ(paths.at(0), expected);
+}
+
+int main(int argc, char** argv)
+{
+    ::testing::InitGoogleTest(&argc, argv);
+
+    return RUN_ALL_TESTS();
+}
\ No newline at end of file
diff --git a/test/vpd-manager-test/reader_test.hpp b/test/vpd-manager-test/reader_test.hpp
new file mode 100644
index 0000000..85d458f
--- /dev/null
+++ b/test/vpd-manager-test/reader_test.hpp
@@ -0,0 +1,15 @@
+#pragma once
+
+#include "utilInterface.hpp"
+
+#include <gmock/gmock.h>
+
+using namespace openpower::vpd::utils::interface;
+
+class MockUtilCalls : public UtilityInterface
+{
+  public:
+    MOCK_METHOD(std::string, readBusProperty,
+                (const string& obj, const string& inf, const string& prop),
+                (override));
+};
diff --git a/test/vpd-manager-test/vpd_reader_test.json b/test/vpd-manager-test/vpd_reader_test.json
new file mode 100644
index 0000000..f74e05a
--- /dev/null
+++ b/test/vpd-manager-test/vpd_reader_test.json
@@ -0,0 +1,172 @@
+{
+  "commonInterfaces": {
+    "xyz.openbmc_project.Inventory.Decorator.Asset": {
+      "PartNumber": {
+        "recordName": "VINI",
+        "keywordName": "PN"
+      },
+      "SerialNumber": {
+        "recordName": "VINI",
+        "keywordName": "SN"
+      },
+      "BuildDate": {
+        "recordName": "VR10",
+        "keywordName": "DC",
+        "encoding": "DATE"
+      }
+    },
+    "xyz.openbmc_project.Inventory.Item": {
+      "PrettyName": {
+        "recordName": "VINI",
+        "keywordName": "DR"
+      },
+     "Present": true
+    }
+  },
+  "frus": {
+    "/sys/bus/i2c/drivers/at24/8-0050/eeprom": [
+      {
+        "inventoryPath": "/system/chassis/motherboard",
+        "isSystemVpd": true,
+        "extraInterfaces": {
+          "xyz.openbmc_project.Inventory.Item.Board.Motherboard": null,
+          "com.ibm.ipzvpd.Location" : {
+              "LocationCode" : "Ufcs-P0"
+          }
+        }
+      },
+      {
+        "inventoryPath": "/system",
+        "inherit": false,
+        "isSystemVpd": true,
+        "extraInterfaces": {
+          "xyz.openbmc_project.Inventory.Item.System": null,
+          "xyz.openbmc_project.Inventory.Decorator.Asset": {
+            "SerialNumber": {
+              "recordName": "VSYS",
+              "keywordName": "SE"
+            },
+            "Model": {
+              "recordName": "VSYS",
+              "keywordName": "TM"
+            }
+          },
+          "com.ibm.ipzvpd.Location" : {
+              "LocationCode" : "Umts"
+          }
+        }
+      },
+      {
+        "inventoryPath": "/system/chassis",
+        "inherit": false,
+        "isSystemVpd": true,
+        "extraInterfaces": {
+          "xyz.openbmc_project.Inventory.Item.Chassis": null,
+          "com.ibm.ipzvpd.Location" : {
+              "LocationCode" : "Ufcs"
+          }
+        }
+      }
+    ],
+    "/sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a480.i2c-bus/i2c-8/8-0051/8-00510/nvmem": [
+      {
+        "inventoryPath": "/system/chassis/motherboard/ebmc_card_bmc",
+        "extraInterfaces": {
+          "xyz.openbmc_project.Inventory.Item.Bmc": null,
+          "com.ibm.ipzvpd.Location" : {
+              "LocationCode" : "Ufcs-P0-C5"
+          }
+        }
+      },
+      {
+        "inventoryPath": "/system/chassis/motherboard/ebmc_card_bmc/ethernet0",
+        "inherit": false,
+        "extraInterfaces": {
+          "xyz.openbmc_project.Inventory.Item.Ethernet": null,
+          "com.ibm.ipzvpd.Location" : {
+              "LocationCode" : "Ufcs-P0-C5-T0"
+          },
+          "xyz.openbmc_project.Inventory.Item.NetworkInterface": {
+            "MACAddress": {
+              "recordName": "VCFG",
+              "keywordName": "Z0",
+              "encoding": "MAC"
+            }
+          }
+        }
+      },
+      {
+        "inventoryPath": "/system/chassis/motherboard/ebmc_card_bmc/ethernet1",
+        "inherit": false,
+        "extraInterfaces": {
+          "xyz.openbmc_project.Inventory.Item.Ethernet": null,
+          "com.ibm.ipzvpd.Location" : {
+              "LocationCode" : "Ufcs-P0-C5-T1"
+          },
+          "xyz.openbmc_project.Inventory.Item.NetworkInterface": {
+            "MACAddress": {
+              "recordName": "VCFG",
+              "keywordName": "Z1",
+              "encoding": "MAC"
+            }
+          }
+        }
+      }
+    ],
+    "/sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a080.i2c-bus/i2c-0/0-0051/0-00510/nvmem": [
+      {
+        "inventoryPath": "/system/chassis/motherboard/tpm_wilson",
+        "extraInterfaces": {
+          "xyz.openbmc_project.Inventory.Item.Tpm": null,
+          "com.ibm.ipzvpd.Location" : {
+              "LocationCode" : "Ufcs-P0-C22"
+          }
+        }
+      }
+    ],
+    "/sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a400.i2c-bus/i2c-7/7-0050/7-00500/nvmem": [
+      {
+        "inventoryPath": "/system/chassis/motherboard/base_op_panel_blyth",
+        "extraInterfaces": {
+          "xyz.openbmc_project.Inventory.Item.Panel": null,
+          "com.ibm.ipzvpd.Location" : {
+              "LocationCode" : "Ufcs-D0"
+          }
+        }
+      }
+    ],
+    "/sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a400.i2c-bus/i2c-7/7-0051/7-00510/nvmem": [
+      {
+        "inventoryPath": "/system/chassis/motherboard/lcd_op_panel_hill",
+        "extraInterfaces": {
+          "xyz.openbmc_project.Inventory.Item.Panel": null,
+          "com.ibm.ipzvpd.Location" : {
+              "LocationCode" : "Ufcs-D1"
+          }
+        }
+      }
+    ],
+    "/sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a500.i2c-bus/i2c-9/9-0050/9-00500/nvmem": [
+      {
+        "inventoryPath": "/system/chassis/motherboard/vdd_vrm0",
+        "extraInterfaces": {
+          "xyz.openbmc_project.Inventory.Item.Vrm": null,
+          "com.ibm.ipzvpd.Location" : {
+              "LocationCode" : "Ufcs-P0-C14"
+          }
+        }
+      }
+    ],
+    "/sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a580.i2c-bus/i2c-10/10-0050/10-00500/nvmem": [
+      {
+        "inventoryPath": "/system/chassis/motherboard/vdd_vrm1",
+        "extraInterfaces": {
+          "xyz.openbmc_project.Inventory.Item.Vrm": null,
+          "com.ibm.ipzvpd.Location" : {
+              "LocationCode" : "Ufcs-P0-C23"
+          }
+        }
+      }
+    ]
+  }
+}
