aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Bolte <matthias.bolte@googlemail.com>2010-01-02 23:58:24 +0100
committerMatthias Bolte <matthias.bolte@googlemail.com>2010-01-07 01:38:19 +0100
commit96ceb124439ed8ba0fe549d71c64eff8c2c8cddc (patch)
treebfaf302acf9334c545e5ed02ee45c16cf06d35f2 /tests
parentesx: Fix deserialization for VI API calls CancelTask and UnregisterVM (diff)
downloadlibvirt-96ceb124439ed8ba0fe549d71c64eff8c2c8cddc.tar.gz
libvirt-96ceb124439ed8ba0fe549d71c64eff8c2c8cddc.tar.bz2
libvirt-96ceb124439ed8ba0fe549d71c64eff8c2c8cddc.zip
esx: Fix 'vpx' MAC address range and allow arbitrary MAC addresses
The MAC addresses with 00:50:56 prefix are split into several ranges: 00:50:56:00:00:00 - 00:50:56:3f:ff:ff 'static' range (manually assigned) 00:50:56:80:00:00 - 00:50:56:bf:ff:ff 'vpx' range (assigned by a VI Client) Erroneously the 'vpx' range was assumed to be larger and to occupy the remaining addresses of the 00:50:56 prefix that are not part of the 'static' range. 00:50:56 was used as prefix for generated MAC addresses, this is not possible anymore, because there are gaps in the allowed ranges. Therefore, change the prefix to 00:0c:29 which is the prefix for auto generated MAC addresses anyway. Allow arbitrary MAC addresses to be used and set the checkMACAddress VMX option to false in case the MAC address doesn't fall into any predefined range. * docs/drvesx.html.in: update website accordingly * src/esx/esx_driver.c: set the auto generation prefix to 00:0c:29 * src/esx/esx_vmx.c: fix MAC address range handling and allow arbitrary MAC addresses * tests/vmx2xml*, tests/xml2vmx*: add some basic MAC address range tests
Diffstat (limited to 'tests')
-rw-r--r--tests/vmx2xmldata/vmx2xml-ethernet-generated.vmx8
-rw-r--r--tests/vmx2xmldata/vmx2xml-ethernet-generated.xml19
-rw-r--r--tests/vmx2xmldata/vmx2xml-ethernet-other.vmx8
-rw-r--r--tests/vmx2xmldata/vmx2xml-ethernet-other.xml19
-rw-r--r--tests/vmx2xmldata/vmx2xml-ethernet-static.vmx7
-rw-r--r--tests/vmx2xmldata/vmx2xml-ethernet-static.xml19
-rw-r--r--tests/vmx2xmldata/vmx2xml-ethernet-vpx.vmx7
-rw-r--r--tests/vmx2xmldata/vmx2xml-ethernet-vpx.xml19
-rw-r--r--tests/vmx2xmltest.c5
-rw-r--r--tests/xml2vmxdata/xml2vmx-ethernet-generated.vmx13
-rw-r--r--tests/xml2vmxdata/xml2vmx-ethernet-generated.xml14
-rw-r--r--tests/xml2vmxdata/xml2vmx-ethernet-other.vmx13
-rw-r--r--tests/xml2vmxdata/xml2vmx-ethernet-other.xml14
-rw-r--r--tests/xml2vmxdata/xml2vmx-ethernet-static.vmx12
-rw-r--r--tests/xml2vmxdata/xml2vmx-ethernet-static.xml14
-rw-r--r--tests/xml2vmxdata/xml2vmx-ethernet-vpx.vmx12
-rw-r--r--tests/xml2vmxdata/xml2vmx-ethernet-vpx.xml14
-rw-r--r--tests/xml2vmxtest.c5
18 files changed, 222 insertions, 0 deletions
diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-generated.vmx b/tests/vmx2xmldata/vmx2xml-ethernet-generated.vmx
new file mode 100644
index 000000000..f27e0a008
--- /dev/null
+++ b/tests/vmx2xmldata/vmx2xml-ethernet-generated.vmx
@@ -0,0 +1,8 @@
+config.version = "8"
+virtualHW.version = "4"
+ethernet0.present = "true"
+ethernet0.networkName = "VM Network"
+ethernet0.connectionType = "bridged"
+ethernet0.addressType = "generated"
+ethernet0.generatedAddress = "00:0C:29:11:22:33"
+ethernet0.generatedAddressOffset = "0"
diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-generated.xml b/tests/vmx2xmldata/vmx2xml-ethernet-generated.xml
new file mode 100644
index 000000000..ffb203b74
--- /dev/null
+++ b/tests/vmx2xmldata/vmx2xml-ethernet-generated.xml
@@ -0,0 +1,19 @@
+<domain type='vmware'>
+ <uuid>00000000-0000-0000-0000-000000000000</uuid>
+ <memory>32768</memory>
+ <currentMemory>32768</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <interface type='bridge'>
+ <mac address='00:0c:29:11:22:33'/>
+ <source bridge='VM Network'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-other.vmx b/tests/vmx2xmldata/vmx2xml-ethernet-other.vmx
new file mode 100644
index 000000000..da46a70d4
--- /dev/null
+++ b/tests/vmx2xmldata/vmx2xml-ethernet-other.vmx
@@ -0,0 +1,8 @@
+config.version = "8"
+virtualHW.version = "4"
+ethernet0.present = "true"
+ethernet0.networkName = "VM Network"
+ethernet0.connectionType = "bridged"
+ethernet0.checkMACAddress = "false"
+ethernet0.addressType = "static"
+ethernet0.address = "00:12:34:56:78:90"
diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-other.xml b/tests/vmx2xmldata/vmx2xml-ethernet-other.xml
new file mode 100644
index 000000000..4c44fbc6b
--- /dev/null
+++ b/tests/vmx2xmldata/vmx2xml-ethernet-other.xml
@@ -0,0 +1,19 @@
+<domain type='vmware'>
+ <uuid>00000000-0000-0000-0000-000000000000</uuid>
+ <memory>32768</memory>
+ <currentMemory>32768</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <interface type='bridge'>
+ <mac address='00:12:34:56:78:90'/>
+ <source bridge='VM Network'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-static.vmx b/tests/vmx2xmldata/vmx2xml-ethernet-static.vmx
new file mode 100644
index 000000000..8b7a5b3bf
--- /dev/null
+++ b/tests/vmx2xmldata/vmx2xml-ethernet-static.vmx
@@ -0,0 +1,7 @@
+config.version = "8"
+virtualHW.version = "4"
+ethernet0.present = "true"
+ethernet0.networkName = "VM Network"
+ethernet0.connectionType = "bridged"
+ethernet0.addressType = "static"
+ethernet0.address = "00:50:56:11:22:33"
diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-static.xml b/tests/vmx2xmldata/vmx2xml-ethernet-static.xml
new file mode 100644
index 000000000..7ef2d3ded
--- /dev/null
+++ b/tests/vmx2xmldata/vmx2xml-ethernet-static.xml
@@ -0,0 +1,19 @@
+<domain type='vmware'>
+ <uuid>00000000-0000-0000-0000-000000000000</uuid>
+ <memory>32768</memory>
+ <currentMemory>32768</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <interface type='bridge'>
+ <mac address='00:50:56:11:22:33'/>
+ <source bridge='VM Network'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-vpx.vmx b/tests/vmx2xmldata/vmx2xml-ethernet-vpx.vmx
new file mode 100644
index 000000000..b4d917276
--- /dev/null
+++ b/tests/vmx2xmldata/vmx2xml-ethernet-vpx.vmx
@@ -0,0 +1,7 @@
+config.version = "8"
+virtualHW.version = "4"
+ethernet0.present = "true"
+ethernet0.networkName = "VM Network"
+ethernet0.connectionType = "bridged"
+ethernet0.addressType = "vpx"
+ethernet0.generatedAddress = "00:50:56:87:65:43"
diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-vpx.xml b/tests/vmx2xmldata/vmx2xml-ethernet-vpx.xml
new file mode 100644
index 000000000..1d90f3182
--- /dev/null
+++ b/tests/vmx2xmldata/vmx2xml-ethernet-vpx.xml
@@ -0,0 +1,19 @@
+<domain type='vmware'>
+ <uuid>00000000-0000-0000-0000-000000000000</uuid>
+ <memory>32768</memory>
+ <currentMemory>32768</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <interface type='bridge'>
+ <mac address='00:50:56:87:65:43'/>
+ <source bridge='VM Network'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c
index 150a58d17..0cb387b2c 100644
--- a/tests/vmx2xmltest.c
+++ b/tests/vmx2xmltest.c
@@ -139,6 +139,11 @@ mymain(int argc, char **argv)
DO_TEST("ethernet-custom", "ethernet-custom", esxVI_APIVersion_25);
DO_TEST("ethernet-bridged", "ethernet-bridged", esxVI_APIVersion_25);
+ DO_TEST("ethernet-generated", "ethernet-generated", esxVI_APIVersion_25);
+ DO_TEST("ethernet-static", "ethernet-static", esxVI_APIVersion_25);
+ DO_TEST("ethernet-vpx", "ethernet-vpx", esxVI_APIVersion_25);
+ DO_TEST("ethernet-other", "ethernet-other", esxVI_APIVersion_25);
+
DO_TEST("serial-file", "serial-file", esxVI_APIVersion_25);
DO_TEST("serial-device", "serial-device", esxVI_APIVersion_25);
DO_TEST("serial-pipe-client-app", "serial-pipe", esxVI_APIVersion_25);
diff --git a/tests/xml2vmxdata/xml2vmx-ethernet-generated.vmx b/tests/xml2vmxdata/xml2vmx-ethernet-generated.vmx
new file mode 100644
index 000000000..ae825a54f
--- /dev/null
+++ b/tests/xml2vmxdata/xml2vmx-ethernet-generated.vmx
@@ -0,0 +1,13 @@
+config.version = "8"
+virtualHW.version = "4"
+guestOS = "other"
+uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15"
+displayName = "ethernet-generated"
+memsize = "4"
+numvcpus = "1"
+ethernet0.present = "true"
+ethernet0.networkName = "VM Network"
+ethernet0.connectionType = "bridged"
+ethernet0.addressType = "generated"
+ethernet0.generatedAddress = "00:0C:29:11:22:33"
+ethernet0.generatedAddressOffset = "0"
diff --git a/tests/xml2vmxdata/xml2vmx-ethernet-generated.xml b/tests/xml2vmxdata/xml2vmx-ethernet-generated.xml
new file mode 100644
index 000000000..aac8a74fb
--- /dev/null
+++ b/tests/xml2vmxdata/xml2vmx-ethernet-generated.xml
@@ -0,0 +1,14 @@
+<domain type='vmware'>
+ <name>ethernet-generated</name>
+ <uuid>564d9bef-acd9-b4e0-c8f0-aea8b9103515</uuid>
+ <memory>4096</memory>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <interface type='bridge'>
+ <mac address='00:0c:29:11:22:33'/>
+ <source bridge='VM Network'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/xml2vmxdata/xml2vmx-ethernet-other.vmx b/tests/xml2vmxdata/xml2vmx-ethernet-other.vmx
new file mode 100644
index 000000000..452076ad9
--- /dev/null
+++ b/tests/xml2vmxdata/xml2vmx-ethernet-other.vmx
@@ -0,0 +1,13 @@
+config.version = "8"
+virtualHW.version = "4"
+guestOS = "other"
+uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15"
+displayName = "ethernet-static"
+memsize = "4"
+numvcpus = "1"
+ethernet0.present = "true"
+ethernet0.networkName = "VM Network"
+ethernet0.connectionType = "bridged"
+ethernet0.addressType = "static"
+ethernet0.address = "00:12:34:56:78:90"
+ethernet0.checkMACAddress = "false"
diff --git a/tests/xml2vmxdata/xml2vmx-ethernet-other.xml b/tests/xml2vmxdata/xml2vmx-ethernet-other.xml
new file mode 100644
index 000000000..cf1ce7c9c
--- /dev/null
+++ b/tests/xml2vmxdata/xml2vmx-ethernet-other.xml
@@ -0,0 +1,14 @@
+<domain type='vmware'>
+ <name>ethernet-static</name>
+ <uuid>564d9bef-acd9-b4e0-c8f0-aea8b9103515</uuid>
+ <memory>4096</memory>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <interface type='bridge'>
+ <mac address='00:12:34:56:78:90'/>
+ <source bridge='VM Network'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/xml2vmxdata/xml2vmx-ethernet-static.vmx b/tests/xml2vmxdata/xml2vmx-ethernet-static.vmx
new file mode 100644
index 000000000..154a28bfa
--- /dev/null
+++ b/tests/xml2vmxdata/xml2vmx-ethernet-static.vmx
@@ -0,0 +1,12 @@
+config.version = "8"
+virtualHW.version = "4"
+guestOS = "other"
+uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15"
+displayName = "ethernet-static"
+memsize = "4"
+numvcpus = "1"
+ethernet0.present = "true"
+ethernet0.networkName = "VM Network"
+ethernet0.connectionType = "bridged"
+ethernet0.addressType = "static"
+ethernet0.address = "00:50:56:11:22:33"
diff --git a/tests/xml2vmxdata/xml2vmx-ethernet-static.xml b/tests/xml2vmxdata/xml2vmx-ethernet-static.xml
new file mode 100644
index 000000000..b803de422
--- /dev/null
+++ b/tests/xml2vmxdata/xml2vmx-ethernet-static.xml
@@ -0,0 +1,14 @@
+<domain type='vmware'>
+ <name>ethernet-static</name>
+ <uuid>564d9bef-acd9-b4e0-c8f0-aea8b9103515</uuid>
+ <memory>4096</memory>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <interface type='bridge'>
+ <mac address='00:50:56:11:22:33'/>
+ <source bridge='VM Network'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/xml2vmxdata/xml2vmx-ethernet-vpx.vmx b/tests/xml2vmxdata/xml2vmx-ethernet-vpx.vmx
new file mode 100644
index 000000000..31283f6d5
--- /dev/null
+++ b/tests/xml2vmxdata/xml2vmx-ethernet-vpx.vmx
@@ -0,0 +1,12 @@
+config.version = "8"
+virtualHW.version = "4"
+guestOS = "other"
+uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15"
+displayName = "ethernet-vpx"
+memsize = "4"
+numvcpus = "1"
+ethernet0.present = "true"
+ethernet0.networkName = "VM Network"
+ethernet0.connectionType = "bridged"
+ethernet0.addressType = "vpx"
+ethernet0.generatedAddress = "00:50:56:87:65:43"
diff --git a/tests/xml2vmxdata/xml2vmx-ethernet-vpx.xml b/tests/xml2vmxdata/xml2vmx-ethernet-vpx.xml
new file mode 100644
index 000000000..1490238ec
--- /dev/null
+++ b/tests/xml2vmxdata/xml2vmx-ethernet-vpx.xml
@@ -0,0 +1,14 @@
+<domain type='vmware'>
+ <name>ethernet-vpx</name>
+ <uuid>564d9bef-acd9-b4e0-c8f0-aea8b9103515</uuid>
+ <memory>4096</memory>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <interface type='bridge'>
+ <mac address='00:50:56:87:65:43'/>
+ <source bridge='VM Network'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c
index abf1f32bb..b5b7cc814 100644
--- a/tests/xml2vmxtest.c
+++ b/tests/xml2vmxtest.c
@@ -192,6 +192,11 @@ mymain(int argc, char **argv)
DO_TEST("ethernet-custom", "ethernet-custom", esxVI_APIVersion_25);
DO_TEST("ethernet-bridged", "ethernet-bridged", esxVI_APIVersion_25);
+ DO_TEST("ethernet-generated", "ethernet-generated", esxVI_APIVersion_25);
+ DO_TEST("ethernet-static", "ethernet-static", esxVI_APIVersion_25);
+ DO_TEST("ethernet-vpx", "ethernet-vpx", esxVI_APIVersion_25);
+ DO_TEST("ethernet-other", "ethernet-other", esxVI_APIVersion_25);
+
DO_TEST("serial-file", "serial-file", esxVI_APIVersion_25);
DO_TEST("serial-device", "serial-device", esxVI_APIVersion_25);
DO_TEST("serial-pipe", "serial-pipe", esxVI_APIVersion_25);