Re: [PATCH 18/21] tests: vmx: Make paths in test files conform with the XML schema

2020-10-08 Thread Martin Kletzander

On Thu, Oct 08, 2020 at 10:26:43AM +0200, Peter Krempa wrote:

On Thu, Oct 08, 2020 at 10:17:22 +0200, Pino Toscano wrote:

On Thursday, 8 October 2020 09:55:32 CEST Peter Krempa wrote:
> The vmx tests use fake paths for files which in some cases didn't start
> with a /. Since libvirt's schema mandates full paths and the
> representation used in the tests is only internal to the tests we'll add
> a leading / to the paths to conform to the schema.
>
> Signed-off-by: Peter Krempa 
> ---


[...]


> diff --git a/tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml 
b/tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml
> index 7cb6413941..97fa300c18 100644
> --- a/tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml
> +++ b/tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml
> @@ -16,7 +16,7 @@
>destroy
>
>  
> -  
> +  

The real XMLs of VMware guests have disks paths like
'[datastore] path/to/file.vmx'. The proposed change will make these
XMLs unusable as real XMLs, and some of them were actually real XMLs.

Even if these files are just tests, I don't think this is correct to
make them different than real XMLs.

If the schema does not support file='[datastore] path/to/file.vmx',
IMHO that's the schema itself what needs to be fixed, not example/test
XMLs...


Okay that's extremely weird then. I must say I looked into the real
parser since for some reason we have a separate implementation in the
tests (also weird) but didn't notice that this was done also for real
files.

The real question then is. Why didn't anybody complain yet?!? The schema
mandating a leading slash is there amost forever so vmware XMLs must
have been invalid for all that time.



My guess is because CreateXML is not used and for read access it cannot fail
because the XML is generated in libvirt and "sent" to the client/caller.

It could have probably been something like:

  

but it's too late (and worthless IMNSHO) to do that now.


signature.asc
Description: PGP signature


Re: [PATCH 18/21] tests: vmx: Make paths in test files conform with the XML schema

2020-10-08 Thread Peter Krempa
On Thu, Oct 08, 2020 at 10:17:22 +0200, Pino Toscano wrote:
> On Thursday, 8 October 2020 09:55:32 CEST Peter Krempa wrote:
> > The vmx tests use fake paths for files which in some cases didn't start
> > with a /. Since libvirt's schema mandates full paths and the
> > representation used in the tests is only internal to the tests we'll add
> > a leading / to the paths to conform to the schema.
> > 
> > Signed-off-by: Peter Krempa 
> > ---

[...]

> > diff --git a/tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml 
> > b/tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml
> > index 7cb6413941..97fa300c18 100644
> > --- a/tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml
> > +++ b/tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml
> > @@ -16,7 +16,7 @@
> >destroy
> >
> >  
> > -  
> > +  
> 
> The real XMLs of VMware guests have disks paths like
> '[datastore] path/to/file.vmx'. The proposed change will make these
> XMLs unusable as real XMLs, and some of them were actually real XMLs.
> 
> Even if these files are just tests, I don't think this is correct to
> make them different than real XMLs.
> 
> If the schema does not support file='[datastore] path/to/file.vmx',
> IMHO that's the schema itself what needs to be fixed, not example/test
> XMLs...

Okay that's extremely weird then. I must say I looked into the real
parser since for some reason we have a separate implementation in the
tests (also weird) but didn't notice that this was done also for real
files.

The real question then is. Why didn't anybody complain yet?!? The schema
mandating a leading slash is there amost forever so vmware XMLs must
have been invalid for all that time.



Re: [PATCH 18/21] tests: vmx: Make paths in test files conform with the XML schema

2020-10-08 Thread Pino Toscano
On Thursday, 8 October 2020 09:55:32 CEST Peter Krempa wrote:
> The vmx tests use fake paths for files which in some cases didn't start
> with a /. Since libvirt's schema mandates full paths and the
> representation used in the tests is only internal to the tests we'll add
> a leading / to the paths to conform to the schema.
> 
> Signed-off-by: Peter Krempa 
> ---
>  tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml   | 2 +-
>  tests/vmx2xmldata/vmx2xml-case-insensitive-2.xml   | 2 +-
>  tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml   | 2 +-
>  tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml  | 2 +-
>  tests/vmx2xmldata/vmx2xml-esx-in-the-wild-1.xml| 2 +-
>  tests/vmx2xmldata/vmx2xml-esx-in-the-wild-2.xml| 6 +++---
>  tests/vmx2xmldata/vmx2xml-esx-in-the-wild-3.xml| 6 +++---
>  tests/vmx2xmldata/vmx2xml-esx-in-the-wild-4.xml| 8 
>  tests/vmx2xmldata/vmx2xml-esx-in-the-wild-5.xml| 4 ++--
>  tests/vmx2xmldata/vmx2xml-esx-in-the-wild-6.xml| 2 +-
>  tests/vmx2xmldata/vmx2xml-esx-in-the-wild-7.xml| 2 +-
>  tests/vmx2xmldata/vmx2xml-esx-in-the-wild-8.xml| 6 +++---
>  tests/vmx2xmldata/vmx2xml-esx-in-the-wild-9.xml| 2 +-
>  tests/vmx2xmldata/vmx2xml-floppy-file.xml  | 4 ++--
>  tests/vmx2xmldata/vmx2xml-fusion-in-the-wild-1.xml | 2 +-
>  tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-1.xml| 2 +-
>  tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-2.xml| 2 +-
>  tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-3.xml| 2 +-
>  tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-4.xml| 2 +-
>  tests/vmx2xmldata/vmx2xml-harddisk-ide-file.xml| 2 +-
>  tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.xml   | 2 +-
>  tests/vmx2xmldata/vmx2xml-harddisk-transient.xml   | 2 +-
>  tests/vmx2xmldata/vmx2xml-parallel-file.xml| 2 +-
>  tests/vmx2xmldata/vmx2xml-scsi-driver.xml  | 8 
>  tests/vmx2xmldata/vmx2xml-scsi-writethrough.xml| 2 +-
>  tests/vmx2xmldata/vmx2xml-serial-file.xml  | 4 ++--
>  tests/vmx2xmltest.c| 4 ++--
>  tests/xml2vmxdata/xml2vmx-cdrom-ide-file.xml   | 2 +-
>  tests/xml2vmxdata/xml2vmx-cdrom-scsi-file.xml  | 2 +-
>  tests/xml2vmxdata/xml2vmx-esx-in-the-wild-1.xml| 2 +-
>  tests/xml2vmxdata/xml2vmx-esx-in-the-wild-2.xml| 6 +++---
>  tests/xml2vmxdata/xml2vmx-esx-in-the-wild-3.xml| 6 +++---
>  tests/xml2vmxdata/xml2vmx-esx-in-the-wild-4.xml| 8 
>  tests/xml2vmxdata/xml2vmx-esx-in-the-wild-5.xml| 4 ++--
>  tests/xml2vmxdata/xml2vmx-esx-in-the-wild-6.xml| 2 +-
>  tests/xml2vmxdata/xml2vmx-esx-in-the-wild-7.xml| 2 +-
>  tests/xml2vmxdata/xml2vmx-esx-in-the-wild-9.xml| 2 +-
>  tests/xml2vmxdata/xml2vmx-floppy-file.xml  | 4 ++--
>  tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-1.xml | 2 +-
>  tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-1.xml| 2 +-
>  tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-2.xml| 2 +-
>  tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-3.xml| 2 +-
>  tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-4.xml| 2 +-
>  tests/xml2vmxdata/xml2vmx-harddisk-ide-file.xml| 2 +-
>  tests/xml2vmxdata/xml2vmx-harddisk-scsi-file.xml   | 2 +-
>  tests/xml2vmxdata/xml2vmx-parallel-file.xml| 2 +-
>  tests/xml2vmxdata/xml2vmx-scsi-driver.xml  | 8 
>  tests/xml2vmxdata/xml2vmx-scsi-writethrough.xml| 2 +-
>  tests/xml2vmxdata/xml2vmx-serial-file.xml  | 2 +-
>  tests/xml2vmxtest.c| 4 ++--
>  50 files changed, 79 insertions(+), 79 deletions(-)
> 
> diff --git a/tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml 
> b/tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml
> index 7cb6413941..97fa300c18 100644
> --- a/tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml
> +++ b/tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml
> @@ -16,7 +16,7 @@
>destroy
>
>  
> -  
> +  

The real XMLs of VMware guests have disks paths like
'[datastore] path/to/file.vmx'. The proposed change will make these
XMLs unusable as real XMLs, and some of them were actually real XMLs.

Even if these files are just tests, I don't think this is correct to
make them different than real XMLs.

If the schema does not support file='[datastore] path/to/file.vmx',
IMHO that's the schema itself what needs to be fixed, not example/test
XMLs...

-- 
Pino Toscano

signature.asc
Description: This is a digitally signed message part.


[PATCH 18/21] tests: vmx: Make paths in test files conform with the XML schema

2020-10-08 Thread Peter Krempa
The vmx tests use fake paths for files which in some cases didn't start
with a /. Since libvirt's schema mandates full paths and the
representation used in the tests is only internal to the tests we'll add
a leading / to the paths to conform to the schema.

Signed-off-by: Peter Krempa 
---
 tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml   | 2 +-
 tests/vmx2xmldata/vmx2xml-case-insensitive-2.xml   | 2 +-
 tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml   | 2 +-
 tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml  | 2 +-
 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-1.xml| 2 +-
 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-2.xml| 6 +++---
 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-3.xml| 6 +++---
 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-4.xml| 8 
 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-5.xml| 4 ++--
 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-6.xml| 2 +-
 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-7.xml| 2 +-
 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-8.xml| 6 +++---
 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-9.xml| 2 +-
 tests/vmx2xmldata/vmx2xml-floppy-file.xml  | 4 ++--
 tests/vmx2xmldata/vmx2xml-fusion-in-the-wild-1.xml | 2 +-
 tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-1.xml| 2 +-
 tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-2.xml| 2 +-
 tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-3.xml| 2 +-
 tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-4.xml| 2 +-
 tests/vmx2xmldata/vmx2xml-harddisk-ide-file.xml| 2 +-
 tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.xml   | 2 +-
 tests/vmx2xmldata/vmx2xml-harddisk-transient.xml   | 2 +-
 tests/vmx2xmldata/vmx2xml-parallel-file.xml| 2 +-
 tests/vmx2xmldata/vmx2xml-scsi-driver.xml  | 8 
 tests/vmx2xmldata/vmx2xml-scsi-writethrough.xml| 2 +-
 tests/vmx2xmldata/vmx2xml-serial-file.xml  | 4 ++--
 tests/vmx2xmltest.c| 4 ++--
 tests/xml2vmxdata/xml2vmx-cdrom-ide-file.xml   | 2 +-
 tests/xml2vmxdata/xml2vmx-cdrom-scsi-file.xml  | 2 +-
 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-1.xml| 2 +-
 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-2.xml| 6 +++---
 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-3.xml| 6 +++---
 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-4.xml| 8 
 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-5.xml| 4 ++--
 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-6.xml| 2 +-
 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-7.xml| 2 +-
 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-9.xml| 2 +-
 tests/xml2vmxdata/xml2vmx-floppy-file.xml  | 4 ++--
 tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-1.xml | 2 +-
 tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-1.xml| 2 +-
 tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-2.xml| 2 +-
 tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-3.xml| 2 +-
 tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-4.xml| 2 +-
 tests/xml2vmxdata/xml2vmx-harddisk-ide-file.xml| 2 +-
 tests/xml2vmxdata/xml2vmx-harddisk-scsi-file.xml   | 2 +-
 tests/xml2vmxdata/xml2vmx-parallel-file.xml| 2 +-
 tests/xml2vmxdata/xml2vmx-scsi-driver.xml  | 8 
 tests/xml2vmxdata/xml2vmx-scsi-writethrough.xml| 2 +-
 tests/xml2vmxdata/xml2vmx-serial-file.xml  | 2 +-
 tests/xml2vmxtest.c| 4 ++--
 50 files changed, 79 insertions(+), 79 deletions(-)

diff --git a/tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml 
b/tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml
index 7cb6413941..97fa300c18 100644
--- a/tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml
+++ b/tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml
@@ -16,7 +16,7 @@
   destroy
   
 
-  
+  
   
   
 
diff --git a/tests/vmx2xmldata/vmx2xml-case-insensitive-2.xml 
b/tests/vmx2xmldata/vmx2xml-case-insensitive-2.xml
index 188c3f3cd5..499eb1ec38 100644
--- a/tests/vmx2xmldata/vmx2xml-case-insensitive-2.xml
+++ b/tests/vmx2xmldata/vmx2xml-case-insensitive-2.xml
@@ -16,7 +16,7 @@
   destroy
   
 
-  
+  
   
   
 
diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml 
b/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml
index 7ca8ff729a..a85cb42dce 100644
--- a/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml
+++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml
@@ -12,7 +12,7 @@
   destroy
   
 
-  
+  
   
   
 
diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml 
b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml
index 5765232bc1..29111fb7b6 100644
--- a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml
+++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml
@@ -12,7 +12,7 @@
   destroy
   
 
-  
+  
   
   
 
diff --git a/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-1.xml 
b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-1.xml
index c15275ccb9..9970cb6e8a 100644
--- a/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-1.xml
+++ b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-1.xml
@@ -16,7 +16,7 @@
   destroy
   
 
-  
+