5 #ifndef vnsw_agent_test_xml_test_xml_h
6 #define vnsw_agent_test_xml_test_xml_h
10 #include <pugixml/pugixml.hpp>
11 #include <boost/uuid/uuid.hpp>
31 const std::string &mac,
const std::string vm_name);
32 void LinkXmlNode(pugi::xml_node *parent,
const std::string <ype,
33 const std::string lname,
const std::string &rtype,
34 const std::string rname);
37 const std::string &value);
47 const std::string &name,
49 const pugi::xml_node &node,
54 (
const std::string &
type,
const std::string &name,
58 typedef std::map<std::string, AgentUtXmlTestConfigCreateFn>
60 typedef std::map<std::string, AgentUtXmlTestValidateCreateFn>
70 bool Run(std::string test_case);
98 virtual void ToString(std::string *str);
121 virtual bool ToXml(pugi::xml_node *parent) = 0;
123 virtual void ToString(std::string *str);
124 virtual bool Run() { assert(0);
return false; }
153 virtual bool ToXml(pugi::xml_node *parent);
155 virtual void ToString(std::string *str);
173 virtual bool ToXml(pugi::xml_node *parent);
175 virtual void ToString(std::string *str);
199 virtual void ToString(std::string *str);
boost::asio::ip::address_v4 Ip4Address
virtual ~AgentUtXmlConfig()
DISALLOW_COPY_AND_ASSIGN(AgentUtXmlConfig)
AgentUtXmlConfig(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
virtual void ToString(std::string *str)
AgentUtXmlConfig(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, bool gen_xml, AgentUtXmlTestCase *test_case)
void AddIdPerms(pugi::xml_node *parent)
const boost::uuids::uuid & id() const
virtual void ToString(std::string *str)
DISALLOW_COPY_AND_ASSIGN(AgentUtXmlLink)
virtual bool ToXml(pugi::xml_node *parent)
virtual ~AgentUtXmlLink()
AgentUtXmlLink(const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
virtual std::string NodeType()
void set_gen_xml(bool val)
AgentUtXmlTestCase * test_case_
void set_op_delete(bool val)
const pugi::xml_node & node() const
AgentUtXmlNode(const std::string &name, const pugi::xml_node &node, bool gen_xml, AgentUtXmlTestCase *test_case)
DISALLOW_COPY_AND_ASSIGN(AgentUtXmlNode)
virtual void ToString(std::string *str)
AgentUtXmlTestCase * test_case()
AgentUtXmlNode(const std::string &name, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
virtual ~AgentUtXmlNode()
virtual bool ToXml(pugi::xml_node *parent)=0
virtual std::string NodeType()=0
const std::string & name() const
virtual bool ToXml(pugi::xml_node *parent)
DISALLOW_COPY_AND_ASSIGN(AgentUtXmlTask)
AgentUtXmlTask(const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
virtual std::string NodeType()
virtual ~AgentUtXmlTask()
virtual void ToString(std::string *str)
virtual void ToString(std::string *str)
void set_verbose(bool val)
DISALLOW_COPY_AND_ASSIGN(AgentUtXmlTestCase)
std::vector< AgentUtXmlNode * > AgentUtXmlNodeList
pugi::xml_document gen_doc_
AgentUtXmlTestCase(const std::string &name, const pugi::xml_node &node, AgentUtXmlTest *test)
AgentUtXmlNodeList node_list_
const std::string & name() const
virtual ~AgentUtXmlTestCase()
AgentUtXmlTestList test_list_
boost::function< AgentUtXmlNode *(const std::string type, const std::string &name, const boost::uuids::uuid &id, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)> AgentUtXmlTestConfigCreateFn
AgentUtXmlTestConfigFactory config_factory_
std::vector< AgentUtXmlTestCase * > AgentUtXmlTestList
boost::function< AgentUtXmlValidationNode *(const std::string &type, const std::string &name, const boost::uuids::uuid &id, const pugi::xml_node &node)> AgentUtXmlTestValidateCreateFn
std::map< std::string, AgentUtXmlTestConfigCreateFn > AgentUtXmlTestConfigFactory
std::map< std::string, AgentUtXmlTestValidateCreateFn > AgentUtXmlTestValidateFactory
AgentUtXmlTest(const std::string &file_name)
void AddValidateEntry(const std::string &name, AgentUtXmlTestValidateCreateFn fn)
virtual ~AgentUtXmlTest()
AgentUtXmlTestConfigCreateFn GetConfigCreateFn(const std::string &name)
AgentUtXmlTestValidateFactory validate_factory_
DISALLOW_COPY_AND_ASSIGN(AgentUtXmlTest)
void ToString(std::string *str)
AgentUtXmlTestValidateCreateFn GetValidateCreateFn(const std::string &name)
void AddConfigEntry(const std::string &name, AgentUtXmlTestConfigCreateFn fn)
bool GetIntAttribute(const xml_node &node, const string &name, int *value)
bool GetUintAttribute(const xml_node &node, const string &name, uint16_t *value)
xml_node AddXmlNodeWithValue(xml_node *parent, const char *name, const string &value)
xml_node AddXmlNodeWithIntValue(xml_node *parent, const char *name, int val)
void LinkXmlNode(xml_node *parent, const string <ype, const string lname, const string &rtype, const string rname)
xml_node AddXmlNodeWithAttr(xml_node *parent, const char *attr)
bool GetStringAttribute(const xml_node &node, const string &name, string *value)
void NovaIntfAdd(bool op_delete, const uuid &id, const Ip4Address &ip, const uuid &vm_uuid, const uuid vn_uuid, const string &name, const string &mac, const string vm_name)
bool GetBoolAttribute(const xml_node &node, const string &name, bool *value)