OpenSDN source code
test_xml.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
3  * Copyright Contributors to the OpenSDN project
4  */
5 #include "base/os.h"
6 #include <iostream>
7 #include <fstream>
8 #include <pugixml/pugixml.hpp>
9 #include <boost/filesystem.hpp>
10 #include <boost/uuid/uuid.hpp>
11 
12 #include <test/test_cmn_util.h>
13 #include <pkt/test/test_pkt_util.h>
14 #include <pkt/flow_mgmt.h>
15 #include <oper/global_vrouter.h>
16 #include "test_xml.h"
17 #include "test_xml_validate.h"
18 #include "test_xml_packet.h"
19 
20 using namespace std;
21 using namespace pugi;
22 using namespace boost::uuids;
23 using namespace AgentUtXmlUtils;
24 
25 namespace AgentUtXmlUtils {
26 bool GetStringAttribute(const xml_node &node, const string &name,
27  string *value) {
28  xml_attribute attr = node.attribute(name.c_str());
29  if (!attr) {
30  return false;;
31  }
32 
33  *value = attr.as_string();
34 
35  return true;
36 }
37 
38 bool GetUintAttribute(const xml_node &node, const string &name,
39  uint16_t *value) {
40  xml_attribute attr = node.attribute(name.c_str());
41  if (!attr) {
42  return false;;
43  }
44 
45  *value = attr.as_uint();
46 
47  return true;
48 }
49 
50 bool GetIntAttribute(const xml_node &node, const string &name, int *value) {
51  xml_attribute attr = node.attribute(name.c_str());
52  if (!attr) {
53  return false;;
54  }
55 
56  *value = attr.as_int();
57 
58  return true;
59 }
60 
61 bool GetBoolAttribute(const xml_node &node, const string &name,
62  bool *value) {
63  xml_attribute attr = node.attribute(name.c_str());
64  if (!attr) {
65  return false;;
66  }
67 
68  string str = attr.as_string();
69  if (str == "true" || str == "yes")
70  *value = true;
71  else
72  *value = false;
73  return true;
74 }
75 
76 void NovaIntfAdd(bool op_delete, const uuid &id, const Ip4Address &ip,
77  const uuid &vm_uuid, const uuid vn_uuid, const string &name,
78  const string &mac, const string vm_name) {
79  if (op_delete) {
80  PortUnSubscribe(id);
81  cout << "Nova Del Interface Message " << endl;
82  return;
83  }
84 
85  PortSubscribe(name, id, vm_uuid, vm_name, vn_uuid, MakeUuid(1), ip,
86  Ip6Address::v4_compatible(ip), mac);
87  cout << "Nova Add Interface Message " << endl;
88  return;
89 }
90 
91 void LinkXmlNode(xml_node *parent, const string &ltype, const string lname,
92  const string &rtype, const string rname) {
93  xml_node n = parent->append_child("link");
94 
95  xml_node n1 = n.append_child("node");
96  n1.append_attribute("type") = ltype.c_str();
97 
98  xml_node n2 = n1.append_child("name");
99  n2.append_child(pugi::node_pcdata).set_value(lname.c_str());
100 
101  n1 = n.append_child("node");
102  n1.append_attribute("type") = rtype.c_str();
103 
104  n2 = n1.append_child("name");
105  n2.append_child(pugi::node_pcdata).set_value(rname.c_str());
106 
107  string mdata = GetMetadata(ltype.c_str(), rtype.c_str());
108  xml_node n3 = n.append_child("metadata");
109  n3.append_attribute("type") = mdata.c_str();
110  return;
111 }
112 
113 xml_node AddXmlNodeWithAttr(xml_node *parent, const char *attr) {
114  xml_node n = parent->append_child("node");
115  n.append_attribute("type") = attr;
116  return n;
117 }
118 
119 xml_node AddXmlNodeWithValue(xml_node *parent, const char *name,
120  const string &value) {
121  xml_node n = parent->append_child(name);
122  n.append_child(pugi::node_pcdata).set_value(value.c_str());
123  return n;
124 }
125 
126 xml_node AddXmlNodeWithIntValue(xml_node *parent, const char *name,
127  int val) {
128  stringstream s;
129  s << val;
130  xml_node n = parent->append_child(name);
131  n.append_child(pugi::node_pcdata).set_value(s.str().c_str());
132  return n;
133 }
134 }
135 
137 // AgentUtXmlTest routines
139 AgentUtXmlTest::AgentUtXmlTest(const std::string &name) : file_name_(name) {
140 }
141 
143 
144  for (AgentUtXmlTestList::iterator i = test_list_.begin();
145  i != test_list_.end(); i++) {
146  delete *i;
147  }
148 }
149 
150 void AgentUtXmlTest::AddConfigEntry(const std::string &name,
152  config_factory_[name] = fn;
153 }
154 
155 void AgentUtXmlTest::AddValidateEntry(const std::string &name,
157  validate_factory_[name] = fn;
158 }
159 
161 AgentUtXmlTest::GetConfigCreateFn(const std::string &name) {
162  AgentUtXmlTestConfigFactory::iterator iter = config_factory_.find(name);
163  if (iter == config_factory_.end()) {
165  }
166 
167  return iter->second;
168 }
169 
171 AgentUtXmlTest::GetValidateCreateFn(const std::string &name) {
172  AgentUtXmlTestValidateFactory::iterator iter = validate_factory_.find(name);
173  if (iter == validate_factory_.end()) {
174  assert(0);
175  }
176  return iter->second;
177 }
178 
180  xml_node list = doc_.child("test_suite");
181  GetStringAttribute(list, "name", &name_);
182 
183  for (xml_node node = list.first_child(); node; node = node.next_sibling()) {
184  if (strcmp(node.name(), "test") == 0) {
185  xml_attribute attr = node.attribute("name");
186  if (!attr) {
187  cout << "Missing attribute \"name\". Skipping" << endl;
188  continue;
189  }
190  AgentUtXmlTestCase *test = new AgentUtXmlTestCase(attr.value(),
191  node, this);
192  attr = node.attribute("verbose");
193  bool verbose = false;
194  if (!attr) {
195  verbose = false;
196  } else {
197  if (atoi(attr.value()))
198  verbose = true;
199  }
200  test->set_verbose(verbose);
201  test_list_.push_back(test);
202  test->ReadXml();
203  }
204  }
205 
206  return true;
207 }
208 
210  boost::system::error_code ec;
211  boost::filesystem::path file_path(file_name_);
212  uintmax_t file_size = boost::filesystem::file_size(file_path, ec);
213  if (ec) {
214  cout << "Error <" << ec << "> opening file" << file_name_ << endl;
215  return false;
216  }
217 
218  std::fstream file(file_name_.c_str(), std::ios::binary | std::ios_base::in);
219  if (!file) {
220  cout << "Error <fstream error> opening file" << file_name_ << endl;
221  return false;
222  }
223 
224  std::vector<char> data(file_size + 1, 0);
225  file.read(data.data(), file_size);
226  if (!file || file.gcount() < static_cast<std::streamsize>(file_size)) {
227  cout << "Error <fstream::read> reading file" << file_name_ << endl;
228  return false;
229  }
230 
231  xml_parse_result result = doc_.load_string(data.data());
232  if (result) {
233  cout << "Loaded data file successfully" << endl;
234  } else {
235  cout << "Error in XML string at offset <: " << result.offset
236  << "> (error at [..." << (data.data() + result.offset) << "])" << endl;
237  return false;
238  }
239 
240  return true;
241 }
242 
243 void AgentUtXmlTest::ToString(string *str) {
244  stringstream s;
245 
246  s << "Test Suite : " << name_ << endl;
247  *str += s.str();
248  for (AgentUtXmlTestList::iterator it = test_list_.begin();
249  it != test_list_.end(); it++) {
250  (*it)->ToString(str);
251  }
252  return;
253 }
254 
256  for (AgentUtXmlTestList::iterator it = test_list_.begin();
257  it != test_list_.end(); it++) {
258  (*it)->Run();
259  }
260 
261  return true;
262 }
263 
264 bool AgentUtXmlTest::Run(std::string test_case) {
265  for (AgentUtXmlTestList::iterator it = test_list_.begin();
266  it != test_list_.end(); it++) {
267  if ((*it)->name().compare(test_case) == 0) {
268  (*it)->Run();
269  return true;
270  }
271  }
272 
273  return false;
274 }
275 
277 // AgentUtXmlTestCase routines
279 static bool CheckConfigNode(const string &node_name, const xml_node &node,
280  uuid *id, string *name) {
281  if (strcmp(node.name(), node_name.c_str()) != 0) {
282  return false;
283  }
284 
285  xml_attribute attr = node.attribute("name");
286  if (!attr) {
287  cout << "Attribute \"name\" not found for " << node_name
288  << ". Skipping..." << endl;
289  return false;
290  }
291 
292  *name = attr.as_string();
293  if (*name == "") {
294  cout << "Invalid \"name\" for " << node_name << " Skipping" << endl;
295  return false;
296  }
297 
298  if (node_name == "validate")
299  return false;
300 
301  attr = node.attribute("uuid");
302  if (!attr) {
303  cout << "Attribute \"uuid\" not found for " << node_name
304  << ". Skipping..." << endl;
305  return false;;
306  }
307 
308  int x = attr.as_uint();
309  if (x == 0) {
310  cout << "Invalid \"uuid\" (0) for " << node_name << " Skipping" << endl;
311  return false;
312  }
313 
314  *id = MakeUuid(x);
315 
316  return true;
317 }
318 
320  const xml_node &node,
321  AgentUtXmlTest *test)
322  : name_(name), xml_node_(node), test_(test), verbose_(false) {
323  cout << "Creating test-case <" << name_ << ">" << endl;
324 }
325 
327  for (AgentUtXmlNodeList::iterator i = node_list_.begin();
328  i != node_list_.end(); i++) {
329  delete *i;
330  }
331 }
332 
334  for (xml_node node = xml_node_.first_child(); node;
335  node = node.next_sibling()) {
336 
337  string str;
338  bool op_delete = false;
339  if (GetStringAttribute(node, "delete", &str) == true ||
340  GetStringAttribute(node, "del", &str) == true) {
341  if (str != "false" && str != "0")
342  op_delete = true;
343  }
344 
345  uuid id;
346  string name;
347  AgentUtXmlNode *cfg = NULL;
348 
350  test_->GetConfigCreateFn(node.name());
351  if (CheckConfigNode(node.name(), node, &id, &name) == true) {
352  if (fn.empty() == false)
353  cfg = fn(node.name(), name, id, node, this);
354  }
355 
356  if (strcmp(node.name(), "link") == 0) {
357  cfg = new AgentUtXmlLink(node, this);
358  }
359 
360  if (strcmp(node.name(), "packet") == 0) {
361  if (GetStringAttribute(node, "name", &name) == false) {
362  cout << "Attribute \"name\" not specified for Packet. Skipping"
363  << endl;
364  continue;
365  }
366  cfg = new AgentUtXmlPacket(name, node, this);
367  }
368 
369  if (strcmp(node.name(), "task") == 0) {
370  cfg = new AgentUtXmlTask(node, this);
371  }
372 
373  if (strcmp(node.name(), "validate") == 0) {
374  if (GetStringAttribute(node, "name", &name) == false) {
375  cout << "Attribute \"name\" not specified for validate."
376  " Skipping" << endl;
377  continue;
378  }
379  cfg = new AgentUtXmlValidate(name, node, this);
380  }
381 
382  if (cfg) {
383  cfg->set_op_delete(op_delete);
384  } else {
385  cout << "Unknown node name <" << node.name() << ">. Ignoring"
386  << endl;
387  }
388  if (cfg) {
389  bool ret = cfg->ReadXml();
390  if (op_delete == false && ret == false) {
391  delete cfg;
392  cfg = NULL;
393  }
394  }
395 
396  if (cfg) {
397  node_list_.push_back(cfg);
398  }
399  }
400 
401  return true;
402 }
403 
405  for (AgentUtXmlNodeList::iterator it = node_list_.begin();
406  it != node_list_.end(); it++) {
407  if ((*it)->gen_xml() == false) {
408  (*it)->Run();
410  continue;
411  }
412 
413  xml_document doc;
414 
415  xml_node decl = doc.prepend_child(pugi::node_declaration);
416  decl.append_attribute("version") = "1.0";
417 
418  xml_node n = doc.append_child("config");
419  xml_node n1;
420  if ((*it)->op_delete()) {
421  n1 = n.append_child("delete");
422  } else {
423  n1 = n.append_child("update");
424  }
425  (*it)->ToXml(&n1);
426  if (verbose_) {
427  doc.print(std::cout);
428  }
429  Agent *agent = Agent::GetInstance();
430  agent->ifmap_parser()->ConfigParse(n, 0);
432  }
433 
434  return true;
435 }
436 
437 void AgentUtXmlTestCase::ToString(string *str) {
438  stringstream s;
439 
440  s << "Test Case : " << name_ << endl;
441  *str += s.str();
442  for (AgentUtXmlNodeList::iterator it = node_list_.begin();
443  it != node_list_.end(); it++) {
444  (*it)->ToString(str);
445  }
446  return;
447 }
448 
450 // AgentUtXmlNode routines
452 AgentUtXmlNode::AgentUtXmlNode(const string &name, const xml_node &node,
453  AgentUtXmlTestCase *test_case) :
454  node_(node), name_(name), op_delete_(false), gen_xml_(true),
455  test_case_(test_case) {
456 }
457 
458 AgentUtXmlNode::AgentUtXmlNode(const string &name, const xml_node &node,
459  bool gen_xml, AgentUtXmlTestCase *test_case) :
460  node_(node), name_(name), op_delete_(false), gen_xml_(gen_xml),
461  test_case_(test_case) {
462 }
463 
465 }
466 
468  string str;
469  op_delete_ = false;
470  if (GetStringAttribute(node_, "delete", &str) == true ||
471  GetStringAttribute(node_, "del", &str) == true) {
472  if (str != "false" && str != "0")
473  op_delete_ = true;
474  }
475 
476  return true;
477 }
478 
479 void AgentUtXmlNode::ToString(string *str) {
480  stringstream s;
481 
482  if (op_delete_)
483  s << "Delete ";
484  else
485  s << "Add ";
486 
487  s << NodeType() << " : " << name_ << " ";
488 
489  *str += s.str();
490  return;
491 }
492 
494 // AgentUtXmlTask routines
496 AgentUtXmlTask::AgentUtXmlTask(const xml_node &node,
497  AgentUtXmlTestCase *test_case) :
498  AgentUtXmlNode("task", node, false, test_case) {
499 }
500 
502 }
503 
505  GetStringAttribute(node(), "stop", &stop_);
506  return true;
507 }
508 
509 bool AgentUtXmlTask::ToXml(xml_node *parent) {
510  return true;
511 }
512 
513 void AgentUtXmlTask::ToString(string *str) {
515  stringstream s;
516 
517  s << "Stop : " << stop_ << endl;
518  *str += s.str();
519  return;
520 }
521 
523  return "Task";
524 }
525 
527  if (boost::iequals(stop_, "1") || boost::iequals(stop_, "yes")) {
530  } else {
533  }
534  return true;
535 }
536 
538 // AgentUtXmlLink routines
540 AgentUtXmlLink::AgentUtXmlLink(const xml_node &node,
541  AgentUtXmlTestCase *test_case) :
542  AgentUtXmlNode("link", node, test_case) {
543 }
544 
546 }
547 
549  if (GetStringAttribute(node(), "left", &l_node_) == false) {
550  cout << "Left node-type not specified for link. Skipping" << endl;
551  return false;
552  }
553 
554  if (GetStringAttribute(node(), "left-name", &l_name_) == false) {
555  cout << "Right node-name not specified for link. Skipping" << endl;
556  return false;
557  }
558 
559  if (GetStringAttribute(node(), "right", &r_node_) == false) {
560  cout << "Right node-type not specified for link. Skipping" << endl;
561  return false;
562  }
563 
564  if (GetStringAttribute(node(), "right-name", &r_name_) == false) {
565  cout << "Right node-name not specified for link. Skipping" << endl;
566  return false;
567  }
568 
569  return true;
570 }
571 
572 bool AgentUtXmlLink::ToXml(xml_node *parent) {
574  return true;
575 }
576 
577 void AgentUtXmlLink::ToString(string *str) {
579  stringstream s;
580 
581  s << "<" << l_node_ << " : " << l_name_ << "> <" << " right-node "
582  << r_node_ << " : " << r_name_ << ">" << endl;
583 
584  *str += s.str();
585  return;
586 }
587 
589  return "Link";
590 }
591 
593 // AgentUtXmlConfig routines
595 AgentUtXmlConfig::AgentUtXmlConfig(const string &name, const uuid &id,
596  const xml_node &node,
597  AgentUtXmlTestCase *test_case) :
598  AgentUtXmlNode(name, node, test_case), id_(id) {
599 }
600 
601 AgentUtXmlConfig::AgentUtXmlConfig(const string &name, const uuid &id,
602  const xml_node &node, bool gen_xml,
603  AgentUtXmlTestCase *test_case) :
604  AgentUtXmlNode(name, node, gen_xml, test_case), id_(id) {
605 }
606 
608 }
609 
611  return AgentUtXmlNode::ReadXml();
612 }
613 
614 void AgentUtXmlConfig::ToString(std::string *str) {
616  stringstream s;
617  s << " UUID : " << id_;
618  *str += s.str();
619 }
620 
621 static void AddPermissions(xml_node *parent) {
622  xml_node n = parent->append_child("permissions");
623 
624  AddXmlNodeWithValue(&n, "owner", "cloud-admin");
625  AddXmlNodeWithValue(&n, "owner-access", "7");
626  AddXmlNodeWithValue(&n, "group", "cloud-admin-group");
627  AddXmlNodeWithValue(&n, "group-access", "7");
628  AddXmlNodeWithValue(&n, "other-access", "7");
629 }
630 
631 static void AddUuid(xml_node *parent, const uuid &id) {
632  xml_node n = parent->append_child("uuid");
633 
634  std::vector<uint8_t> v1(id.size());
635  std::vector<uint64_t> v(id.size());
636  std::copy(id.begin(), id.end(), v.begin());
637 
638  uint64_t ms_val = v[7] + (v[6] << 8) + (v[5] << 16) + (v[4] << 24) +
639  (v[3] << 32) + (v[2] << 40) + (v[1] << 48) + (v[0] << 56);
640  uint64_t ls_val = v[15] + (v[14] << 8) + (v[13] << 16) + (v[12] << 24) +
641  (v[11] << 32) + (v[10] << 40) + (v[9] << 48) + (v[8] << 56);
642  stringstream s;
643  s << ms_val;
644  AddXmlNodeWithValue(&n, "uuid-mslong", s.str());
645 
646  stringstream s1;
647  s1 << ls_val;
648  AddXmlNodeWithValue(&n, "uuid-lslong", s1.str());
649 }
650 
651 void AgentUtXmlConfig::AddIdPerms(xml_node *parent) {
652 
653  if (op_delete())
654  return;
655 
656  xml_node n = parent->append_child("id-perms");
657  AddPermissions(&n);
658  AddUuid(&n, id());
659  AddXmlNodeWithValue(&n, "enable", "true");
660 }
boost::asio::ip::address_v4 Ip4Address
Definition: address.h:15
boost::uuids::uuid id_
Definition: test_xml.h:205
virtual ~AgentUtXmlConfig()
Definition: test_xml.cc:607
virtual bool ReadXml()
Definition: test_xml.cc:610
AgentUtXmlConfig(const std::string &name, const boost::uuids::uuid &uuid, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
virtual void ToString(std::string *str)
Definition: test_xml.cc:614
void AddIdPerms(pugi::xml_node *parent)
Definition: test_xml.cc:651
bool op_delete_
Definition: test_xml.h:139
void set_op_delete(bool val)
Definition: test_xml.h:130
const pugi::xml_node & node() const
Definition: test_xml.h:132
bool op_delete() const
Definition: test_xml.h:129
virtual bool ReadXml()=0
Definition: test_xml.cc:467
virtual void ToString(std::string *str)
Definition: test_xml.cc:479
AgentUtXmlNode(const std::string &name, const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
virtual ~AgentUtXmlNode()
Definition: test_xml.cc:464
std::string name_
Definition: test_xml.h:138
virtual std::string NodeType()=0
pugi::xml_node node_
Definition: test_xml.h:137
virtual bool ToXml(pugi::xml_node *parent)
Definition: test_xml.cc:509
virtual bool ReadXml()
Definition: test_xml.cc:504
virtual bool Run()
Definition: test_xml.cc:526
AgentUtXmlTask(const pugi::xml_node &node, AgentUtXmlTestCase *test_case)
Definition: test_xml.cc:496
virtual std::string NodeType()
Definition: test_xml.cc:522
virtual ~AgentUtXmlTask()
Definition: test_xml.cc:501
virtual void ToString(std::string *str)
Definition: test_xml.cc:513
std::string stop_
Definition: test_xml.h:161
virtual void ToString(std::string *str)
Definition: test_xml.cc:437
void set_verbose(bool val)
Definition: test_xml.h:100
AgentUtXmlTest * test_
Definition: test_xml.h:108
virtual bool Run()
Definition: test_xml.cc:404
virtual bool ReadXml()
Definition: test_xml.cc:333
pugi::xml_node xml_node_
Definition: test_xml.h:105
AgentUtXmlTestCase(const std::string &name, const pugi::xml_node &node, AgentUtXmlTest *test)
Definition: test_xml.cc:319
std::string name_
Definition: test_xml.h:104
AgentUtXmlNodeList node_list_
Definition: test_xml.h:106
const std::string & name() const
Definition: test_xml.h:102
virtual ~AgentUtXmlTestCase()
Definition: test_xml.cc:326
AgentUtXmlTestList test_list_
Definition: test_xml.h:82
pugi::xml_document doc_
Definition: test_xml.h:81
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
Definition: test_xml.h:52
std::string file_name_
Definition: test_xml.h:79
AgentUtXmlTestConfigFactory config_factory_
Definition: test_xml.h:83
boost::function< AgentUtXmlValidationNode *(const std::string &type, const std::string &name, const boost::uuids::uuid &id, const pugi::xml_node &node)> AgentUtXmlTestValidateCreateFn
Definition: test_xml.h:57
AgentUtXmlTest(const std::string &file_name)
Definition: test_xml.cc:139
void AddValidateEntry(const std::string &name, AgentUtXmlTestValidateCreateFn fn)
Definition: test_xml.cc:155
virtual ~AgentUtXmlTest()
Definition: test_xml.cc:142
AgentUtXmlTestConfigCreateFn GetConfigCreateFn(const std::string &name)
Definition: test_xml.cc:161
bool ReadXml()
Definition: test_xml.cc:179
AgentUtXmlTestValidateFactory validate_factory_
Definition: test_xml.h:84
std::string name_
Definition: test_xml.h:80
void ToString(std::string *str)
Definition: test_xml.cc:243
AgentUtXmlTestValidateCreateFn GetValidateCreateFn(const std::string &name)
Definition: test_xml.cc:171
void AddConfigEntry(const std::string &name, AgentUtXmlTestConfigCreateFn fn)
Definition: test_xml.cc:150
Definition: agent.h:361
IFMapAgentParser * ifmap_parser() const
Definition: agent.h:1175
static Agent * GetInstance()
Definition: agent.h:439
void ConfigParse(const pugi::xml_node config, uint64_t seq)
void Stop()
Stops scheduling of all tasks.
Definition: task.cc:820
static TaskScheduler * GetInstance()
Definition: task.cc:574
void Start()
Starts scheduling of all tasks.
Definition: task.cc:826
static void WaitForIdle()
bool GetIntAttribute(const xml_node &node, const string &name, int *value)
Definition: test_xml.cc:50
bool GetUintAttribute(const xml_node &node, const string &name, uint16_t *value)
Definition: test_xml.cc:38
xml_node AddXmlNodeWithValue(xml_node *parent, const char *name, const string &value)
Definition: test_xml.cc:119
xml_node AddXmlNodeWithIntValue(xml_node *parent, const char *name, int val)
Definition: test_xml.cc:126
void LinkXmlNode(xml_node *parent, const string &ltype, const string lname, const string &rtype, const string rname)
Definition: test_xml.cc:91
xml_node AddXmlNodeWithAttr(xml_node *parent, const char *attr)
Definition: test_xml.cc:113
bool GetStringAttribute(const xml_node &node, const string &name, string *value)
Definition: test_xml.cc:26
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)
Definition: test_xml.cc:76
bool GetBoolAttribute(const xml_node &node, const string &name, bool *value)
Definition: test_xml.cc:61
static void AddPermissions(xml_node *parent)
Definition: test_xml.cc:621
static void AddUuid(xml_node *parent, const uuid &id)
Definition: test_xml.cc:631
static bool CheckConfigNode(const string &node_name, const xml_node &node, uuid *id, string *name)
Definition: test_xml.cc:279
boost::uuids::uuid uuid