libvirt/tests
Laine Stump 4af3cbafdd conf: support partially-specified <virtualport> in parser and formatter
Until now, all attributes in a <virtualport> parameter list that were
acceptable for a particular type, were also required. There were no
optional attributes.

One of the aims of supporting <virtualport> in libvirt's virtual
networks and portgroups is to allow specifying the group-wide
parameters in the network's virtualport, and merge that with the
interface's virtualport, which will have the instance-specific info
(i.e. the interfaceid or instanceid).

Additionally, the guest's interface XML shouldn't need to know what
type of network connection will be used prior to runtime - it could be
openvswitch, 802.1Qbh, 802.1Qbg, or none of the above - but should
still be able to specify instance-specific info just in case it turns
out to be applicable.

Finally, up to now, the parser for virtualport has always generated a
random instanceid/interfaceid when appropriate, making it impossible
to leave it blank (which is what's required for virtualports within a
network/portprofile definition).

This patch modifies the parser and formatter of the <virtualport>
element in the following ways:

* because most of the attributes in a virNetDevVPortProfile are fixed
  size binary data with no reserved values, there is no way to embed a
  "this value wasn't specified" sentinel into the existing data. To
  solve this problem, the new *_specified fields in the
  virNetDevVPortProfile object that were added in a previous patch of
  this series are now set when the corresponding attribute is present
  during the parse.

* allow parsing/formatting a <virtualport> that has no type set. In
  this case, all fields are settable, but all are also optional.

* add a GENERATE_MISSING_DEFAULTS flag to the parser - if this flag is
  set and an instanceid/interfaceid is expected but not provided, a
  random one will be generated. This was previously the default
  behavior, but is now done only for virtualports inside an
  <interface> definition, not for those in <network> or <portgroup>.

* add a REQUIRE_ALL_ATTRIBUTES flag to the parser - if this flag is
  set the parser will call the new
  virNetDevVPortProfileCheckComplete() functions at the end of the
  parser to check for any missing attributes (based on type), and
  return failure if anything is missing. This used to be default
  behavior. Now it is only used for the virtualport defined inside an
  interface's <actual> element (by the time you've figured out the
  contents of <actual>, you should have all the necessary data to fill
  in the entire virtualport)

* add a REQUIRE_TYPE flag to the parser - if this flag is set, the
  parser will return an error if the virtualport has no type
  attribute. This also was previously the default behavior, but isn't
  needed in the case of the virtualport for a type='network' interface
  (i.e. the exact type isn't yet known), or the virtualport of a
  portgroup (i.e. the portgroup just has modifiers for the network's
  virtualport, which *does* require a type) - in those cases, the
  check will be done at domain startup, once the final virtualport is
  assembled (this is handled in the next patch).
2012-08-14 15:47:50 -04:00
..
capabilityschemadata Update xml schemas according to libvirt source 2012-08-02 14:36:23 -06:00
commanddata command: avoid deadlock on EPIPE situation 2012-06-04 13:06:07 -06:00
confdata Change the default of mdns_adv to false 2012-03-27 09:54:49 -06:00
cputestdata Removed more AMD-specific features from cpu64-rhel* models 2012-03-09 14:36:31 +01:00
domainschemadata openvz: support file system quota reporting 2012-05-24 11:35:02 +02:00
domainsnapshotxml2xmlin snapshot: also support disks by path 2011-09-05 07:03:04 -06:00
domainsnapshotxml2xmlout qemu: Support numad 2012-03-15 12:24:56 +08:00
interfaceschemadata Update interface.rng and xml test files to match netcf 0.1.5 2010-01-19 21:13:03 +01:00
lxcxml2xmldata numad: Always output 'placement' of <vcpu> 2012-05-08 16:57:37 -06:00
networkxml2argvdata tests: dynamically replace dnsmasq path 2012-02-01 17:02:45 -07:00
networkxml2xmlin conf: support partially-specified <virtualport> in parser and formatter 2012-08-14 15:47:50 -04:00
networkxml2xmlout conf: support partially-specified <virtualport> in parser and formatter 2012-08-14 15:47:50 -04:00
nodedevschemadata Update xml schemas according to libvirt source 2012-08-02 14:36:23 -06:00
nodeinfodata tests: reduce length of nodeinfodata test names 2012-07-20 15:36:11 -06:00
nwfilterxml2xmlin nwfilter: Add support for ipset 2012-05-21 06:26:34 -04:00
nwfilterxml2xmlout nwfilter: Add support for ipset 2012-05-21 06:26:34 -04:00
qemuhelpdata tests: Refresh qemu-1.1.0 data 2012-06-05 15:44:40 +02:00
qemuxml2argvdata conf: support partially-specified <virtualport> in parser and formatter 2012-08-14 15:47:50 -04:00
qemuxml2xmloutdata Fix logic for assigning PCI addresses to USB2 companion controllers 2012-05-15 17:07:34 +01:00
qemuxmlnsdata xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
sexpr2xmldata numad: Always output 'placement' of <vcpu> 2012-05-08 16:57:37 -06:00
storagepoolxml2xmlin Update xml schemas according to libvirt source 2012-08-02 14:36:23 -06:00
storagepoolxml2xmlout Update xml schemas according to libvirt source 2012-08-02 14:36:23 -06:00
storagevolxml2xmlin Added timestamps to storage volumes 2012-08-02 17:14:17 -06:00
storagevolxml2xmlout Add a sheepdog backend for the storage driver 2012-07-18 20:08:27 +01:00
vmx2xmldata vmx: handle shared folders parsing 2012-07-21 20:15:02 +02:00
xencapsdata Add suspend info to Xen, LXC and UML hypervisor capabilities 2011-11-30 10:12:30 +00:00
xmconfigdata numad: Always output 'placement' of <vcpu> 2012-05-08 16:57:37 -06:00
xml2sexprdata Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2vmxdata vmx: handle shared folders formatting 2012-07-21 19:45:02 +02:00
.valgrind.supp tests: suppress more valgrind situations 2011-05-03 08:03:39 -06:00
capabilityschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
commandhelper.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
commandtest.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
conftest.c tests: Lower stack usage below 4096 bytes 2011-04-30 19:59:52 +02:00
cpuset maint: avoid regression on copyright listings 2012-07-27 07:42:34 -06:00
cputest.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
define-dev-segfault numad: Always output 'placement' of <vcpu> 2012-05-08 16:57:37 -06:00
domainschematest Add LXC XML files to schema test & fix problems this uncovers 2012-03-27 15:52:25 +01:00
domainsnapshotschematest Domain snapshot RNG and tests. 2010-05-20 13:50:03 -04:00
domainsnapshotxml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
esxutilstest.c build: properly skip tests 2011-12-01 13:49:20 -07:00
eventtest.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
int-overflow tests: Don't use bash if we don't have to 2011-07-29 17:17:21 +02:00
interfaceschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
interfacexml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
jsontest.c Add test case for parsing JSON docs 2011-06-30 18:04:02 +01:00
libvirtd-fail Fix up "make check" 2009-10-07 12:18:13 +02:00
libvirtd-pool Fix up "make check" 2009-10-07 12:18:13 +02:00
libvirtdconftest.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
lxcxml2xmltest.c build: silence recent syntax check violations 2012-03-29 21:23:59 -06:00
Makefile.am Set LIBVIRT_AUTOSTART=0 when running test suites 2012-08-07 14:58:17 +01:00
networkschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
networkxml2argvtest.c test: fix segfault in networkxml2argvtest 2012-04-05 07:04:43 -04:00
networkxml2xmltest.c conf: support partially-specified <virtualport> in parser and formatter 2012-08-14 15:47:50 -04:00
nodedevschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
nodedevxml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
nodeinfotest.c tests: reduce length of nodeinfodata test names 2012-07-20 15:36:11 -06:00
nwfilterschematest nwfilter: Add filter schema for nwfilter XML, extend domain XML schema 2010-04-06 11:09:46 -04:00
nwfilterxml2xmltest.c nwfilter: Add support for ipset 2012-05-21 06:26:34 -04:00
object-locking.ml maint: avoid regression on copyright listings 2012-07-27 07:42:34 -06:00
oomtrace.pl Remove tabs from all perl files & enforce this 2012-07-30 13:09:57 +01:00
openvzutilstest.c numad: Always output 'placement' of <vcpu> 2012-05-08 16:57:37 -06:00
openvzutilstest.conf openvz: Add simple test for openvzReadNetworkConf 2011-06-01 11:58:15 +02:00
pkix_asn1_tab.c Add a test case for certificate validation 2011-07-22 15:18:32 +01:00
qemuargv2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
qemuhelptest.c qemu: add capabilities flags related to scsi controller 2012-08-08 14:25:24 +08:00
qemumonitortest.c qemu: unescape HMP commands before converting them to json 2012-02-27 16:06:02 -07:00
qemuxml2argvtest.c qemu: add two qemu caps for lsi and virtio-scsi SCSI controllers 2012-08-08 15:06:33 +08:00
qemuxml2xmltest.c tests: add ich6 codec type test to qemuxml2argv-sound-device 2012-05-17 11:43:35 -06:00
qemuxmlnstest.c Convert public datatypes to inherit from virObject 2012-08-07 11:47:41 +01:00
read-bufsiz maint: avoid regression on copyright listings 2012-07-27 07:42:34 -06:00
read-non-seekable maint: avoid regression on copyright listings 2012-07-27 07:42:34 -06:00
reconnect.c tests: avoid xend ABRT crash report 2011-11-18 15:00:18 -07:00
schematestutils.sh tests: fix schema checks sorting 2011-12-22 13:01:09 -07:00
seclabeltest.c virrandom: make virRandomInitialize an automatic one-shot 2012-08-06 08:15:13 -06:00
sexpr2xmltest.c Convert public datatypes to inherit from virObject 2012-08-07 11:47:41 +01:00
shunloadhelper.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
shunloadtest.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
sockettest.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
ssh.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
start maint: avoid regression on copyright listings 2012-07-27 07:42:34 -06:00
statstest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
storagebackendsheepdogtest.c build: fix PROBE() usage of intptr_t 2012-08-09 15:40:42 -06:00
storagepoolschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
storagepoolxml2xmltest.c Add a sheepdog backend for the storage driver 2012-07-18 20:08:27 +01:00
storagevolschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
storagevolxml2xmltest.c Add a sheepdog backend for the storage driver 2012-07-18 20:08:27 +01:00
test_conf.sh Make test suite output less verbose 2010-01-15 16:28:05 +00:00
test-lib.sh tests: simplify formatting 2011-07-11 09:21:37 -06:00
testutils.c virrandom: make virRandomInitialize an automatic one-shot 2012-08-06 08:15:13 -06:00
testutils.h maint: Use consistent copyright. 2012-07-27 18:27:21 +08:00
testutilslxc.c Add support for setting init argv for LXC 2012-03-27 15:52:25 +01:00
testutilslxc.h Add support for setting init argv for LXC 2012-03-27 15:52:25 +01:00
testutilsqemu.c S390: Adding testcases for s390 2012-07-11 11:19:05 +02:00
testutilsqemu.h remove all trailing blank lines 2009-07-16 15:06:42 +02:00
testutilsxen.c Fix default console type setting 2011-11-03 12:01:48 +00:00
testutilsxen.h remove all trailing blank lines 2009-07-16 15:06:42 +02:00
undefine maint: avoid regression on copyright listings 2012-07-27 07:42:34 -06:00
utiltest.c build: avoid 'make syntax-check' failure 2011-07-01 16:46:20 -06:00
vcpupin maint: avoid regression on copyright listings 2012-07-27 07:42:34 -06:00
viratomictest.c maint: drop a leftover comment line 2012-08-14 11:39:56 -06:00
virauthconfigtest.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
virbuftest.c buf: support peeking at string contents 2012-06-11 09:21:27 -06:00
virdrivermoduletest.c daemon: Fix the wrong macro name 2012-07-24 15:45:20 -06:00
virhashdata.h Rename hash.h and hash.c to virhash.h and virhash.c 2012-01-26 14:11:13 +00:00
virhashtest.c Fix format specifiers in test cases on Win32 2012-04-04 14:33:27 +01:00
virkeyfiletest.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
virnetmessagetest.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
virnetsockettest.c Turn virSocket into a virObject 2012-08-07 11:47:41 +01:00
virnettlscontexttest.c Turn virNetTLSContext and virNetTLSSession into virObject instances 2012-08-07 11:47:41 +01:00
virsh-all Don't check the 'connect' command in virsh-all test 2012-08-07 11:59:08 +01:00
virsh-optparse maint: avoid regression on copyright listings 2012-07-27 07:42:34 -06:00
virsh-schedinfo maint: avoid regression on copyright listings 2012-07-27 07:42:34 -06:00
virsh-synopsis maint: avoid regression on copyright listings 2012-07-27 07:42:34 -06:00
virshtest.c virsh: output scaled values with correct units 2012-05-01 14:58:14 -06:00
virt-aa-helper-test fix AppArmor driver for pipe character devices 2011-09-28 15:43:39 +08:00
virtimetest.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
viruritest.c Desert the FSF address in copyright 2012-07-23 10:50:50 +08:00
vmx2xmltest.c vmx: handle shared folders parsing 2012-07-21 20:15:02 +02:00
xencapstest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
xmconfigtest.c Convert public datatypes to inherit from virObject 2012-08-07 11:47:41 +01:00
xml2sexprtest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
xml2vmxtest.c vmx: handle shared folders formatting 2012-07-21 19:45:02 +02:00