Add testcases for hypervisor nw manager
This commit includes three changes:
1. Add testcases for hypervisor nw manager
2. Removal of vmi_if_count support, as it is no longer
available in the bios table
3. Add methods to set default values to bios table
attributes
Tested.
Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
Change-Id: I78397f653658c88097e4566632b0ce36c7b3861b
diff --git a/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.hpp b/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.hpp
index fa56d96..a1b4d9a 100644
--- a/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.hpp
+++ b/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.hpp
@@ -67,11 +67,7 @@
HypNetworkMgr(sdbusplus::bus::bus& bus, sdeventplus::Event& event,
const char* path) :
bus(bus),
- event(event), objectPath(path)
- {
- // Create the hypervisor eth interface objects
- createIfObjects();
- };
+ event(event), objectPath(path){};
/** @brief Get the BaseBiosTable attributes
*
@@ -91,7 +87,24 @@
std::variant<std::string, int64_t> attrValue,
std::string attrType);
- private:
+ /** @brief Method to set all the interface 0 attributes
+ * to its default value in biosTableAttrs data member
+ */
+ void setDefaultBIOSTableAttrsOnIntf(const std::string& intf);
+
+ /** @brief Method to set the hostname attribute
+ * to its default value in biosTableAttrs
+ * data member
+ */
+ void setDefaultHostnameInBIOSTableAttrs();
+
+ /** @brief Fetch the interface and the ipaddress details
+ * from the Bios table and create the hyp ethernet interfaces
+ * dbus object.
+ */
+ void createIfObjects();
+
+ protected:
/**
* @brief get Dbus Prop
*
@@ -104,18 +117,6 @@
auto getDBusProp(const std::string& objectName,
const std::string& interface, const std::string& kw);
- /** @brief Fetch the interface and the ipaddress details
- * from the Bios table and create the hyp ethernet interfaces
- * dbus object.
- */
- void createIfObjects();
-
- /** @brief Get the hypervisor eth interfaces count
- *
- * @return number of interfaces
- */
- uint16_t getIntfCount();
-
/** @brief Setter method for biosTableAttrs data member
* GET operation on the BIOS table to
* read all the hyp attrbutes (name, value pair)
@@ -137,9 +138,6 @@
*/
std::map<std::string, std::shared_ptr<HypEthInterface>> interfaces;
- /** @brief interface count */
- uint16_t intfCount;
-
/** @brief map of bios table attrs and values */
std::map<biosAttrName, biosAttrCurrValue> biosTableAttrs;
};