OpenSDN source code
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
test_xml_oper.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef vnsw_agent_test_xml_test_xml_oper_h
6 #define vnsw_agent_test_xml_test_xml_oper_h
7 
8 #include <test-xml/test_xml.h>
10 
12 
14 public:
15  AgentUtXmlGlobalVrouter(const std::string &name,
16  const boost::uuids::uuid &uuid,
17  const pugi::xml_node &node,
20 
21  virtual bool ReadXml();
22  virtual bool ToXml(pugi::xml_node *parent);
23  virtual std::string NodeType();
24  virtual void ToString(std::string *str);
25 
26  std::string &vxlan_mode() { return vxlan_mode_;}
27  int flow_export_rate() const { return flow_export_rate_; }
28 
29 private:
30  std::string vxlan_mode_;
32 };
33 
35 public:
36  AgentUtXmlVn(const std::string &name, const boost::uuids::uuid &uuid,
37  const pugi::xml_node &node, AgentUtXmlTestCase *test_case);
38  ~AgentUtXmlVn();
39 
40  virtual bool ReadXml();
41  virtual bool ToXml(pugi::xml_node *parent);
42  virtual std::string NodeType();
43  virtual void ToString(std::string *str);
44 
45  std::string &vxlan_id() { return vxlan_id_;}
46  std::string &network_id() { return network_id_;}
47  std::string &flood_unknown_unicast() {
49  }
50 
51 private:
52  std::string vxlan_id_;
53  std::string network_id_;
55 };
56 
58 public:
59  AgentUtXmlVm(const std::string &name, const boost::uuids::uuid &uuid,
60  const pugi::xml_node &node, AgentUtXmlTestCase *test_case);
61  ~AgentUtXmlVm();
62 
63  virtual bool ReadXml();
64  virtual bool ToXml(pugi::xml_node *parent);
65  virtual std::string NodeType();
66  virtual void ToString(std::string *str);
67 
68 private:
69 };
70 
72 public:
73  AgentUtXmlVmInterface(const std::string &name,
74  const boost::uuids::uuid &uuid,
75  const pugi::xml_node &node,
78 
79  virtual bool ReadXml();
80  virtual bool ToXml(pugi::xml_node *parent);
81  virtual std::string NodeType();
82  virtual void ToString(std::string *str);
83 
84 private:
85  std::string mac_;
87  std::string vn_name_;
89  std::string vm_name_;
90  std::string vrf_;
91  std::string ip_;
92  bool add_nova_;
93  uint16_t vlan_tag_;
94  std::vector<uint16_t> fat_flow_port_;
95  std::string parent_vmi_;
96 };
97 
99 public:
100  AgentUtXmlEthInterface(const std::string &name,
101  const boost::uuids::uuid &uuid,
102  const pugi::xml_node &node,
105 
106  virtual bool ReadXml();
107  virtual bool ToXml(pugi::xml_node *parent);
108  virtual std::string NodeType();
109  virtual void ToString(std::string *str);
110  virtual bool Run();
111 
112 private:
113 };
114 
116 public:
117  AgentUtXmlVrf(const std::string &name, const boost::uuids::uuid &uuid,
118  const pugi::xml_node &node, AgentUtXmlTestCase *test_case);
119  ~AgentUtXmlVrf();
120 
121  virtual bool ReadXml();
122  virtual bool ToXml(pugi::xml_node *parent);
123  virtual std::string NodeType();
124  virtual void ToString(std::string *str);
125 
126 private:
127  std::string vn_name_;
128 };
129 
131 public:
132  AgentUtXmlVmiVrf(const std::string &name, const boost::uuids::uuid &uuid,
133  const pugi::xml_node &node, AgentUtXmlTestCase *test_case);
135 
136  virtual bool ReadXml();
137  virtual bool ToXml(pugi::xml_node *parent);
138  virtual std::string NodeType();
139  virtual void ToString(std::string *str);
140 
141 private:
142 };
143 
145 public:
146  struct Ace {
147  Ace() :
148  src_sg_(0), dst_sg_(0), src_vn_(""), dst_vn_(""), src_ip_(""),
149  src_ip_plen_(0), dst_ip_(""), dst_ip_plen_(0), proto_(0),
150  sport_begin_(-1), sport_end_(-1), dport_begin_(-1), dport_end_(-1) {
151  }
152 
153  uint16_t src_sg_;
154  uint16_t dst_sg_;
155  std::string src_vn_;
156  std::string dst_vn_;
157  std::string src_ip_;
158  uint16_t src_ip_plen_;
159  std::string dst_ip_;
160  uint16_t dst_ip_plen_;
161  uint8_t proto_;
166  std::string action_;
167  std::string direction_;
168  };
169  typedef std::vector<Ace> AceList;
170 
171  AgentUtXmlAcl(const std::string &name, const boost::uuids::uuid &uuid,
172  const pugi::xml_node &node, AgentUtXmlTestCase *test_case);
173  ~AgentUtXmlAcl();
174 
175  virtual bool ReadXml();
176  virtual bool ToXml(pugi::xml_node *parent);
177  virtual std::string NodeType();
178  virtual void ToString(std::string *str);
179 
180 private:
182 };
183 
185 public:
186  AgentUtXmlSg(const std::string &name, const boost::uuids::uuid &uuid,
187  const pugi::xml_node &node, AgentUtXmlTestCase *test_case);
188  ~AgentUtXmlSg();
189 
190  virtual bool ReadXml();
191  virtual bool ToXml(pugi::xml_node *parent);
192  virtual std::string NodeType();
193  virtual void ToString(std::string *str);
194 
195 private:
196  std::string ingress_;
197  std::string egress_;
198  std::string sg_id_;
199 };
200 
202 public:
203  AgentUtXmlTag(const std::string &name, const boost::uuids::uuid &uuid,
204  const pugi::xml_node &node, AgentUtXmlTestCase *test_case);
205  ~AgentUtXmlTag();
206 
207  virtual bool ReadXml();
208  virtual bool ToXml(pugi::xml_node *parent);
209  virtual std::string NodeType();
210  virtual void ToString(std::string *str);
211 
212 private:
213  std::string tag_id_;
214 };
215 
217 public:
218  AgentUtXmlInstanceIp(const std::string &name, const boost::uuids::uuid &uuid,
219  const pugi::xml_node &node, AgentUtXmlTestCase *test_case);
221 
222  virtual bool ReadXml();
223  virtual bool ToXml(pugi::xml_node *parent);
224  virtual std::string NodeType();
225  virtual void ToString(std::string *str);
226 
227 private:
228  std::string ip_;
229  std::string vmi_;
230  bool ecmp_;
231 };
232 
234 // Nova messages
237 public:
238  AgentUtXmlNova(const std::string &name, const boost::uuids::uuid &uuid,
239  const pugi::xml_node &node, AgentUtXmlTestCase *test_case);
240  ~AgentUtXmlNova();
241 
242  virtual bool ReadXml();
243  virtual bool ToXml(pugi::xml_node *parent);
244  virtual std::string NodeType();
245  virtual void ToString(std::string *str);
246  virtual bool Run();
247 
248 private:
249  std::string mac_;
250  std::string vm_name_;
253  std::string ip_;
254 };
255 
257 public:
258  AgentUtXmlGlobalVrouterValidate(const std::string &name,
259  const boost::uuids::uuid &id,
260  const pugi::xml_node &node);
262 
263  virtual bool ReadXml();
264  virtual bool Validate();
265  virtual const std::string ToString();
266 private:
269 };
270 
272 public:
273  AgentUtXmlVnValidate(const std::string &name,
274  const boost::uuids::uuid &id,
275  const pugi::xml_node &node);
276  virtual ~AgentUtXmlVnValidate();
277 
278  virtual bool ReadXml();
279  virtual bool Validate();
280  virtual const std::string ToString();
281 private:
283  uint16_t vxlan_id_;
285  uint16_t vxlan_id_ref_;
286 };
287 
289 public:
290  AgentUtXmlVmValidate(const std::string &name,
291  const boost::uuids::uuid &id,
292  const pugi::xml_node &node);
293  virtual ~AgentUtXmlVmValidate();
294 
295  virtual bool ReadXml();
296  virtual bool Validate();
297  virtual const std::string ToString();
298 private:
300 };
301 
303 public:
304  AgentUtXmlVxlanValidate(const std::string &name,
305  const boost::uuids::uuid &id,
306  const pugi::xml_node &node);
307  virtual ~AgentUtXmlVxlanValidate();
308 
309  virtual bool ReadXml();
310  virtual bool Validate();
311  virtual const std::string ToString();
312 private:
314  uint16_t vxlan_id_;
315  std::string vrf_;
317 };
318 
320 public:
321  AgentUtXmlVmInterfaceValidate(const std::string &name,
322  const boost::uuids::uuid &id,
323  const pugi::xml_node &node);
325 
326  virtual bool ReadXml();
327  virtual bool Validate();
328  virtual const std::string ToString();
329 private:
331  std::string active_;
332  std::string device_type_;
333  std::string vmi_type_;
334  uint16_t vlan_tag_;
335  std::vector<uint16_t> fat_flow_port_;
336 
338 };
339 
341 public:
342  AgentUtXmlEthInterfaceValidate(const std::string &name,
343  const boost::uuids::uuid &id,
344  const pugi::xml_node &node);
346 
347  virtual bool ReadXml();
348  virtual bool Validate();
349  virtual const std::string ToString();
350 private:
352 };
353 
355 public:
356  AgentUtXmlVrfValidate(const std::string &name,
357  const pugi::xml_node &node);
358  virtual ~AgentUtXmlVrfValidate();
359 
360  virtual bool ReadXml();
361  virtual bool Validate();
362  virtual const std::string ToString();
363 private:
364  std::string vn_name_;
365 };
366 
368 public:
369  AgentUtXmlAclValidate(const std::string &name,
370  const pugi::xml_node &node);
371  virtual ~AgentUtXmlAclValidate();
372 
373  virtual bool ReadXml();
374  virtual bool Validate();
375  virtual const std::string ToString();
376 private:
377 };
378 
380 public:
381  AgentUtXmlFlowValidate(const std::string &name,
382  const pugi::xml_node &node);
383  virtual ~AgentUtXmlFlowValidate();
384 
385  virtual bool ReadXml();
386  virtual bool Validate();
387  virtual const std::string ToString();
388  virtual uint32_t wait_count() const;
389 private:
390  uint16_t nh_id_;
391  std::string sip_;
392  std::string dip_;
393  std::string proto_;
394  uint16_t sport_;
395  uint16_t dport_;
396  uint16_t proto_id_;
397  std::string svn_;
398  std::string dvn_;
399  std::string action_;
400  uint16_t rpf_nh_;
401  std::string deleted_;
402  std::string vrf_;
403 };
404 
406 public:
407  AgentUtXmlL2Route(const std::string &name, const boost::uuids::uuid &uuid,
408  const pugi::xml_node &node,
411 
412  virtual bool ReadXml();
413  virtual bool ToXml(pugi::xml_node *parent);
414  virtual std::string NodeType();
415  virtual void ToString(std::string *str);
416  virtual bool Run();
417 
418 private:
419  std::string mac_;
420  std::string vrf_;
421  std::string vn_name_;
422  std::string ip_;
423  uint16_t vxlan_id_;
424  std::string vn_;
425  std::string tunnel_dest_;
426  std::string tunnel_type_;
427  uint16_t sg_id_;
428  uint16_t tag_id_;
429  uint16_t label_;
430 };
431 
433 public:
434  AgentUtXmlL2RouteValidate(const std::string &name,
435  const pugi::xml_node &node);
436  virtual ~AgentUtXmlL2RouteValidate();
437 
438  virtual bool ReadXml();
439  virtual bool Validate();
440  virtual const std::string ToString();
441 private:
442  std::string mac_;
443  std::string vrf_;
444  uint16_t vxlan_id_;
446  std::string vn_;
447  std::string nh_type_;
448  std::string tunnel_dest_;
449  std::string tunnel_type_;
450  uint16_t intf_uuid_;
451 };
452 
454 public:
455  AgentUtXmlL3Route(const std::string &name, const boost::uuids::uuid &uuid,
456  const pugi::xml_node &node,
459 
460  virtual bool ReadXml();
461  virtual bool ToXml(pugi::xml_node *parent);
462  virtual std::string NodeType();
463  virtual void ToString(std::string *str);
464  virtual bool Run();
465 
466 private:
467  std::string src_ip_;
468  std::string vrf_;
469  std::string vn_name_;
470  std::string ip_;
471  uint16_t vxlan_id_;
472  std::string vn_;
473  std::string tunnel_dest_;
474  std::string tunnel_type_;
475  uint16_t sg_id_;
476  uint16_t tag_id_;
477  uint16_t label_;
478  uint16_t plen_;
479 };
480 
481 
483 public:
484  AgentUtXmlL3RouteValidate(const std::string &name,
485  const pugi::xml_node &node);
486  virtual ~AgentUtXmlL3RouteValidate();
487 
488  virtual bool ReadXml();
489  virtual bool Validate();
490  virtual const std::string ToString();
491 private:
492  std::string src_ip_;
493  std::string vrf_;
494  uint16_t vxlan_id_;
496  std::string vn_;
497  std::string nh_type_;
498  std::string tunnel_dest_;
499  std::string tunnel_type_;
500  uint16_t intf_uuid_;
501 };
502 #endif //vnsw_agent_test_xml_test_xml_oper_h
virtual const std::string ToString()
virtual const std::string ToString()
virtual void ToString(std::string *str)
virtual bool ToXml(pugi::xml_node *parent)
virtual bool ReadXml()
virtual void ToString(std::string *str)
virtual const std::string ToString()
virtual bool ToXml(pugi::xml_node *parent)
virtual bool ReadXml()
virtual bool Run()
std::string egress_
AgentUtXmlVn(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
std::string & network_id()
Definition: test_xml_oper.h:46
virtual void ToString(std::string *str)
virtual void ToString(std::string *str)
virtual ~AgentUtXmlVnValidate()
boost::uuids::uuid vn_uuid_
virtual bool Validate()
std::string vm_name_
const boost::uuids::uuid id_
std::string tunnel_dest_
virtual bool Validate()
std::string dst_vn_
virtual ~AgentUtXmlVmValidate()
AgentUtXmlEthInterface(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
AgentUtXmlGlobalVrouterValidate(const std::string &name, const boost::uuids::uuid &id, const pugi::xml_node &node)
AgentUtXmlEthInterfaceValidate(const std::string &name, const boost::uuids::uuid &id, const pugi::xml_node &node)
AgentUtXmlVmInterface(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
std::string vrf_
std::string tunnel_type_
boost::asio::ip::address IpAddress
Definition: address.h:13
AceList ace_list_
virtual ~AgentUtXmlVrfValidate()
AgentUtXmlVmInterfaceValidate(const std::string &name, const boost::uuids::uuid &id, const pugi::xml_node &node)
virtual bool ReadXml()
const boost::uuids::uuid id_
std::string sg_id_
std::string vxlan_id_
Definition: test_xml_oper.h:52
std::string tunnel_type_
virtual bool ToXml(pugi::xml_node *parent)
virtual const std::string ToString()
virtual bool ToXml(pugi::xml_node *parent)
std::string dst_ip_
virtual void ToString(std::string *str)
virtual std::string NodeType()
std::string action_
std::vector< uint16_t > fat_flow_port_
std::string vrf_
AgentUtXmlVmiVrf(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
virtual std::string NodeType()
boost::uuids::uuid uuid
virtual void ToString(std::string *str)
virtual bool ReadXml()
virtual void ToString(std::string *str)
virtual const std::string ToString()
boost::uuids::uuid vn_uuid_
boost::uuids::uuid vn_uuid_
Definition: test_xml_oper.h:86
std::string src_ip_
AgentUtXmlVmValidate(const std::string &name, const boost::uuids::uuid &id, const pugi::xml_node &node)
void AgentUtXmlOperInit(AgentUtXmlTest *test)
virtual bool ToXml(pugi::xml_node *parent)
std::string src_vn_
AgentUtXmlAclValidate(const std::string &name, const pugi::xml_node &node)
const boost::uuids::uuid id_
virtual void ToString(std::string *str)
AgentUtXmlVxlanValidate(const std::string &name, const boost::uuids::uuid &id, const pugi::xml_node &node)
virtual bool ReadXml()
virtual const std::string ToString()
AgentUtXmlVrfValidate(const std::string &name, const pugi::xml_node &node)
const boost::uuids::uuid id_
virtual const std::string ToString()
std::string direction_
virtual void ToString(std::string *str)
boost::uuids::uuid vm_uuid_
std::string src_ip_
virtual ~AgentUtXmlAclValidate()
AgentUtXmlAcl(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
boost::uuids::uuid vm_uuid_
Definition: test_xml_oper.h:88
std::string vn_name_
virtual std::string NodeType()
virtual const std::string ToString()
std::vector< Ace > AceList
virtual bool ReadXml()
std::string parent_vmi_
Definition: test_xml_oper.h:95
const std::string & name() const
std::string ingress_
virtual std::string NodeType()
std::string mac_
virtual const std::string ToString()
std::string network_id_
Definition: test_xml_oper.h:53
virtual bool ToXml(pugi::xml_node *parent)
virtual void ToString(std::string *str)
int flow_export_rate() const
Definition: test_xml_oper.h:27
AgentUtXmlVnValidate(const std::string &name, const boost::uuids::uuid &id, const pugi::xml_node &node)
AgentUtXmlL2Route(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
virtual bool ReadXml()
AgentUtXmlInstanceIp(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
virtual bool Validate()
virtual bool ToXml(pugi::xml_node *parent)
virtual std::string NodeType()
virtual bool Validate()
std::vector< uint16_t > fat_flow_port_
Definition: test_xml_oper.h:94
AgentUtXmlGlobalVrouter(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
AgentUtXmlL3Route(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
std::string tag_id_
AgentUtXmlL3RouteValidate(const std::string &name, const pugi::xml_node &node)
AgentUtXmlL2RouteValidate(const std::string &name, const pugi::xml_node &node)
virtual std::string NodeType()
virtual bool ReadXml()
virtual bool ReadXml()
virtual bool ReadXml()
virtual bool ToXml(pugi::xml_node *parent)
virtual std::string NodeType()
virtual bool ToXml(pugi::xml_node *parent)
std::string flood_unknown_unicast_
Definition: test_xml_oper.h:54
std::string tunnel_dest_
virtual void ToString(std::string *str)
virtual bool ToXml(pugi::xml_node *parent)
virtual std::string NodeType()
std::string & vxlan_id()
Definition: test_xml_oper.h:45
virtual bool ToXml(pugi::xml_node *parent)
std::string & flood_unknown_unicast()
Definition: test_xml_oper.h:47
const pugi::xml_node & node() const
virtual bool ReadXml()
virtual const std::string ToString()
virtual bool ToXml(pugi::xml_node *parent)
virtual bool Run()
virtual bool ReadXml()
virtual bool ReadXml()
virtual std::string NodeType()
virtual bool ReadXml()
virtual bool ToXml(pugi::xml_node *parent)
std::string mac_
AgentUtXmlVm(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
std::string & vxlan_mode()
Definition: test_xml_oper.h:26
std::string flood_unknown_unicast_
AgentUtXmlTag(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
std::string vn_name_
const boost::uuids::uuid id_
virtual void ToString(std::string *str)
virtual std::string NodeType()
AgentUtXmlNova(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
virtual const std::string ToString()
virtual std::string NodeType()
virtual uint32_t wait_count() const
const boost::uuids::uuid id_
std::string vn_name_
AgentUtXmlTestCase * test_case()
Definition: test_xml.h:132
virtual bool ReadXml()
virtual void ToString(std::string *str)
virtual bool Run()
virtual std::string NodeType()
virtual bool ReadXml()
virtual std::string NodeType()
virtual void ToString(std::string *str)
const pugi::xml_node & node() const
Definition: test_xml.h:131
AgentUtXmlFlowValidate(const std::string &name, const pugi::xml_node &node)
const std::string & name() const
Definition: test_xml.h:130
virtual bool ToXml(pugi::xml_node *parent)
virtual bool ReadXml()
AgentUtXmlSg(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
std::string ip_
AgentUtXmlVrf(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
virtual std::string NodeType()