Alex Jia | 26 Jun 2012 19:28
Picon
Favicon

[autotest][PATCH 00/11] Introducing virt-v2v test

This patchset was also sent as a pull request on github,
so you can comment in there, if you wish so.

https://github.com/autotest/autotest/pull/432

This is a patchset introducing virt-v2v test. We've been working during the last 2 months
to provide this pilot test.

Each patch tries to explain some core concepts behind the work, but pretty much we are using
virt-v2v cmdline tool for automatically converting and importing an existing virtual machines
to libvirt-managed KVM, or an open manageable virtualized environment - oVirt.

For these 2 different input method/target (Libvirt and oVirt), we reuse current libvirt-autotest
as libvirt input target, and implement a new oVirt module as oVirt input target, and using SDK
for the oVirt engine API(as a RESTful API) to manipulate resources in oVirt such as Data Centers,
Clusters, Hosts, Storage Domains, VMs, etc.

At present, we haven't cover everything into our oVirt module, it only includes some necessary
API implementation for virt-v2v requirement. However, it's very easy to extend new functions to
support oVirt autotest in the future.

Alex Jia and Wayne Sun (11):
  virt: Introducing virt_v2v module
  virt: Introducing virt_v2v_utils module
  virt: Introducing ovirt module
  virt: Add new virsh wrapper functions into libvirt_vm
  tests: Add a new pool creation test case
  support ovirt-engine-sdk build
  virt.virt_env_process: Add ovirt vm handling
  virt.virt_env_process: Support remotely run tcpdump
(Continue reading)

Alex Jia | 26 Jun 2012 19:28
Picon
Favicon

[autotest][PATCH 01/11] virt: Introducing virt_v2v module

With this module, we will be able to implement a virt-v2v test.

As of implementation details, we uses virt-v2v command line tool
to convert an existing VM into libvirt-managed KVM, or an open
manageable virtualized environment - oVirt.

Signed-off-by: Alex Jia <ajia <at> redhat.com>
Signed-off-by: Wayne Sun <gsun <at> redhat.com>
---
 client/virt/virt_v2v.py |   59 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 client/virt/virt_v2v.py

diff --git a/client/virt/virt_v2v.py b/client/virt/virt_v2v.py
new file mode 100644
index 0000000..973d8ca
--- /dev/null
+++ b/client/virt/virt_v2v.py
 <at>  <at>  -0,0 +1,59  <at>  <at> 
+"""
+Utility functions to handle Virtual Machine conversion using virt-v2v.
+
+ <at> copyright: 2008-2012 Red Hat Inc.
+"""
+
+import logging
+from autotest.client import os_dep, utils
+from autotest.server.hosts.ssh_host import SSHHost
+import virt_v2v_utils as v2v_utils
+
(Continue reading)

Chris Evich | 2 Jul 2012 22:39
Picon
Favicon
Gravatar

Re: [autotest][PATCH 01/11] virt: Introducing virt_v2v module

On 06/26/2012 01:28 PM, Alex Jia wrote:
> With this module, we will be able to implement a virt-v2v test.
>
> As of implementation details, we uses virt-v2v command line tool
> to convert an existing VM into libvirt-managed KVM, or an open
> manageable virtualized environment - oVirt.
>
> Signed-off-by: Alex Jia<ajia <at> redhat.com>
> Signed-off-by: Wayne Sun<gsun <at> redhat.com>
> ---
>   client/virt/virt_v2v.py |   59 ++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 59 insertions(+)
>   create mode 100644 client/virt/virt_v2v.py
>
> diff --git a/client/virt/virt_v2v.py b/client/virt/virt_v2v.py
> new file mode 100644
> index 0000000..973d8ca
> --- /dev/null
> +++ b/client/virt/virt_v2v.py
>  <at>  <at>  -0,0 +1,59  <at>  <at> 
> +"""
> +Utility functions to handle Virtual Machine conversion using virt-v2v.
> +
> + <at> copyright: 2008-2012 Red Hat Inc.
> +"""
> +
> +import logging
> +from autotest.client import os_dep, utils
> +from autotest.server.hosts.ssh_host import SSHHost
> +import virt_v2v_utils as v2v_utils
(Continue reading)

Alex Jia | 3 Jul 2012 05:04
Picon
Favicon

Re: [autotest][PATCH 01/11] virt: Introducing virt_v2v module

On 07/03/2012 04:39 AM, Chris Evich wrote:
> On 06/26/2012 01:28 PM, Alex Jia wrote:
>> With this module, we will be able to implement a virt-v2v test.
>>
>> As of implementation details, we uses virt-v2v command line tool
>> to convert an existing VM into libvirt-managed KVM, or an open
>> manageable virtualized environment - oVirt.
>>
>> Signed-off-by: Alex Jia<ajia <at> redhat.com>
>> Signed-off-by: Wayne Sun<gsun <at> redhat.com>
>> ---
>>   client/virt/virt_v2v.py |   59 
>> ++++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 59 insertions(+)
>>   create mode 100644 client/virt/virt_v2v.py
>>
>> diff --git a/client/virt/virt_v2v.py b/client/virt/virt_v2v.py
>> new file mode 100644
>> index 0000000..973d8ca
>> --- /dev/null
>> +++ b/client/virt/virt_v2v.py
>>  <at>  <at>  -0,0 +1,59  <at>  <at> 
>> +"""
>> +Utility functions to handle Virtual Machine conversion using virt-v2v.
>> +
>> + <at> copyright: 2008-2012 Red Hat Inc.
>> +"""
>> +
>> +import logging
>> +from autotest.client import os_dep, utils
(Continue reading)

Alex Jia | 26 Jun 2012 19:28
Picon
Favicon

[autotest][PATCH 02/11] virt: Introducing virt_v2v_utils module

It's a common virt-v2v test assistant module, which provides some
necessary class/functions with virt-v2v testing.

Signed-off-by: Alex Jia <ajia <at> redhat.com>
Signed-off-by: Wayne Sun <gsun <at> redhat.com>
---
 client/virt/virt_v2v_utils.py |  278 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 278 insertions(+)
 create mode 100644 client/virt/virt_v2v_utils.py

diff --git a/client/virt/virt_v2v_utils.py b/client/virt/virt_v2v_utils.py
new file mode 100644
index 0000000..f93e417
--- /dev/null
+++ b/client/virt/virt_v2v_utils.py
 <at>  <at>  -0,0 +1,278  <at>  <at> 
+"""
+Virt-v2v test utility functions.
+
+ <at> copyright: 2008-2012 Red Hat Inc.
+"""
+
+import os, re, logging
+
+import ovirt
+import libvirt_vm as lvirt
+
+
+def build_esx_no_verify(params):
+    """
(Continue reading)

Cleber Rosa | 2 Jul 2012 15:32
Picon
Favicon

Re: [autotest][PATCH 02/11] virt: Introducing virt_v2v_utils module

On 06/26/2012 02:28 PM, Alex Jia wrote:
> It's a common virt-v2v test assistant module, which provides some
> necessary class/functions with virt-v2v testing.
>
> Signed-off-by: Alex Jia <ajia <at> redhat.com>
> Signed-off-by: Wayne Sun <gsun <at> redhat.com>
> ---
>   client/virt/virt_v2v_utils.py |  278 +++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 278 insertions(+)
>   create mode 100644 client/virt/virt_v2v_utils.py
>
> diff --git a/client/virt/virt_v2v_utils.py b/client/virt/virt_v2v_utils.py
> new file mode 100644
> index 0000000..f93e417
> --- /dev/null
> +++ b/client/virt/virt_v2v_utils.py
>  <at>  <at>  -0,0 +1,278  <at>  <at> 
> +"""
> +Virt-v2v test utility functions.
> +
> + <at> copyright: 2008-2012 Red Hat Inc.
> +"""
> +
> +import os, re, logging
> +
> +import ovirt
> +import libvirt_vm as lvirt
> +
> +
> +def build_esx_no_verify(params):
(Continue reading)

Alex Jia | 3 Jul 2012 07:34
Picon
Favicon

Re: [autotest][PATCH 02/11] virt: Introducing virt_v2v_utils module

On 07/02/2012 09:32 PM, Cleber Rosa wrote:
> On 06/26/2012 02:28 PM, Alex Jia wrote:
>> It's a common virt-v2v test assistant module, which provides some
>> necessary class/functions with virt-v2v testing.
>>
>> Signed-off-by: Alex Jia <ajia <at> redhat.com>
>> Signed-off-by: Wayne Sun <gsun <at> redhat.com>
>> ---
>>   client/virt/virt_v2v_utils.py |  278 
>> +++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 278 insertions(+)
>>   create mode 100644 client/virt/virt_v2v_utils.py
>>
>> diff --git a/client/virt/virt_v2v_utils.py 
>> b/client/virt/virt_v2v_utils.py
>> new file mode 100644
>> index 0000000..f93e417
>> --- /dev/null
>> +++ b/client/virt/virt_v2v_utils.py
>>  <at>  <at>  -0,0 +1,278  <at>  <at> 
>> +"""
>> +Virt-v2v test utility functions.
>> +
>> + <at> copyright: 2008-2012 Red Hat Inc.
>> +"""
>> +
>> +import os, re, logging
>> +
>> +import ovirt
>> +import libvirt_vm as lvirt
(Continue reading)

Qingtang Zhou | 3 Jul 2012 08:00
Picon
Favicon
Gravatar

Re: [autotest][PATCH 02/11] virt: Introducing virt_v2v_utils module

* On 2012-07-03 13:34:06 +0800, Alex Jia (ajia <at> redhat.com) wrote:
> On 07/02/2012 09:32 PM, Cleber Rosa wrote:
> > On 06/26/2012 02:28 PM, Alex Jia wrote:
> >> It's a common virt-v2v test assistant module, which provides some
> >> necessary class/functions with virt-v2v testing.
> >>
> >> Signed-off-by: Alex Jia <ajia <at> redhat.com>
> >> Signed-off-by: Wayne Sun <gsun <at> redhat.com>
> >> ---
> >>   client/virt/virt_v2v_utils.py |  278 
> >> +++++++++++++++++++++++++++++++++++++++++
> >>   1 file changed, 278 insertions(+)
> >>   create mode 100644 client/virt/virt_v2v_utils.py
> >>
> >> diff --git a/client/virt/virt_v2v_utils.py 
> >> b/client/virt/virt_v2v_utils.py
> >> new file mode 100644
> >> index 0000000..f93e417
> >> --- /dev/null
> >> +++ b/client/virt/virt_v2v_utils.py
> >>  <at>  <at>  -0,0 +1,278  <at>  <at> 
> >> +"""
> >> +Virt-v2v test utility functions.
> >> +
> >> + <at> copyright: 2008-2012 Red Hat Inc.
> >> +"""
> >> +
> >> +import os, re, logging
> >> +
> >> +import ovirt
(Continue reading)

Chris Evich | 2 Jul 2012 22:26
Picon
Favicon
Gravatar

Re: [autotest][PATCH 02/11] virt: Introducing virt_v2v_utils module

On 06/26/2012 01:28 PM, Alex Jia wrote:
> It's a common virt-v2v test assistant module, which provides some
> necessary class/functions with virt-v2v testing.
>
> Signed-off-by: Alex Jia<ajia <at> redhat.com>
> Signed-off-by: Wayne Sun<gsun <at> redhat.com>
> ---
>   client/virt/virt_v2v_utils.py |  278 +++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 278 insertions(+)
>   create mode 100644 client/virt/virt_v2v_utils.py
>
> diff --git a/client/virt/virt_v2v_utils.py b/client/virt/virt_v2v_utils.py
> new file mode 100644
> index 0000000..f93e417
> --- /dev/null
> +++ b/client/virt/virt_v2v_utils.py
>  <at>  <at>  -0,0 +1,278  <at>  <at> 
> +"""
> +Virt-v2v test utility functions.
> +
> + <at> copyright: 2008-2012 Red Hat Inc.
> +"""
> +
> +import os, re, logging
> +
> +import ovirt
> +import libvirt_vm as lvirt
> +
> +
> +def build_esx_no_verify(params):
(Continue reading)

Alex Jia | 3 Jul 2012 04:57
Picon
Favicon

Re: [autotest][PATCH 02/11] virt: Introducing virt_v2v_utils module

On 07/03/2012 04:26 AM, Chris Evich wrote:
> On 06/26/2012 01:28 PM, Alex Jia wrote:
>> It's a common virt-v2v test assistant module, which provides some
>> necessary class/functions with virt-v2v testing.
>>
>> Signed-off-by: Alex Jia<ajia <at> redhat.com>
>> Signed-off-by: Wayne Sun<gsun <at> redhat.com>
>> ---
>>    client/virt/virt_v2v_utils.py |  278 +++++++++++++++++++++++++++++++++++++++++
>>    1 file changed, 278 insertions(+)
>>    create mode 100644 client/virt/virt_v2v_utils.py
>>
>> diff --git a/client/virt/virt_v2v_utils.py b/client/virt/virt_v2v_utils.py
>> new file mode 100644
>> index 0000000..f93e417
>> --- /dev/null
>> +++ b/client/virt/virt_v2v_utils.py
>>  <at>  <at>  -0,0 +1,278  <at>  <at> 
>> +"""
>> +Virt-v2v test utility functions.
>> +
>> + <at> copyright: 2008-2012 Red Hat Inc.
>> +"""
>> +
>> +import os, re, logging
>> +
>> +import ovirt
>> +import libvirt_vm as lvirt
>> +
>> +
(Continue reading)

Chris Evich | 2 Jul 2012 23:00
Picon
Favicon
Gravatar

Re: [autotest][PATCH 02/11] virt: Introducing virt_v2v_utils module

On 06/26/2012 01:28 PM, Alex Jia wrote:
> It's a common virt-v2v test assistant module, which provides some
> necessary class/functions with virt-v2v testing.
>
> Signed-off-by: Alex Jia<ajia <at> redhat.com>
> Signed-off-by: Wayne Sun<gsun <at> redhat.com>
> ---
>   client/virt/virt_v2v_utils.py |  278 +++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 278 insertions(+)
>   create mode 100644 client/virt/virt_v2v_utils.py
>
> diff --git a/client/virt/virt_v2v_utils.py b/client/virt/virt_v2v_utils.py
> new file mode 100644
> index 0000000..f93e417
> --- /dev/null
> +++ b/client/virt/virt_v2v_utils.py
>  <at>  <at>  -0,0 +1,278  <at>  <at> 
> +"""
> +Virt-v2v test utility functions.
> +
> + <at> copyright: 2008-2012 Red Hat Inc.
> +"""
> +
> +import os, re, logging
> +
> +import ovirt
> +import libvirt_vm as lvirt
> +
> +
> +def build_esx_no_verify(params):
(Continue reading)

Alex Jia | 3 Jul 2012 05:48
Picon
Favicon

Re: [autotest][PATCH 02/11] virt: Introducing virt_v2v_utils module

On 07/03/2012 05:00 AM, Chris Evich wrote:
> On 06/26/2012 01:28 PM, Alex Jia wrote:
>> It's a common virt-v2v test assistant module, which provides some
>> necessary class/functions with virt-v2v testing.
>>
>> Signed-off-by: Alex Jia<ajia <at> redhat.com>
>> Signed-off-by: Wayne Sun<gsun <at> redhat.com>
>> ---
>>    client/virt/virt_v2v_utils.py |  278 +++++++++++++++++++++++++++++++++++++++++
>>    1 file changed, 278 insertions(+)
>>    create mode 100644 client/virt/virt_v2v_utils.py
>>
>> diff --git a/client/virt/virt_v2v_utils.py b/client/virt/virt_v2v_utils.py
>> new file mode 100644
>> index 0000000..f93e417
>> --- /dev/null
>> +++ b/client/virt/virt_v2v_utils.py
>>  <at>  <at>  -0,0 +1,278  <at>  <at> 
>> +"""
>> +Virt-v2v test utility functions.
>> +
>> + <at> copyright: 2008-2012 Red Hat Inc.
>> +"""
>> +
>> +import os, re, logging
>> +
>> +import ovirt
>> +import libvirt_vm as lvirt
>> +
>> +
(Continue reading)

Alex Jia | 26 Jun 2012 19:28
Picon
Favicon

[autotest][PATCH 05/11] tests: Add a new pool creation test case

With this test cases, we can create and verity a libvirt pool, and virt-v2v
also may reuse the test case to build a pool for converting later.

Signed-off-by: Alex Jia <ajia <at> redhat.com>
---
 client/tests/libvirt/tests/virsh_pool_create_as.py |   52 ++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 client/tests/libvirt/tests/virsh_pool_create_as.py

diff --git a/client/tests/libvirt/tests/virsh_pool_create_as.py b/client/tests/libvirt/tests/virsh_pool_create_as.py
new file mode 100644
index 0000000..cf2660b
--- /dev/null
+++ b/client/tests/libvirt/tests/virsh_pool_create_as.py
 <at>  <at>  -0,0 +1,52  <at>  <at> 
+import os, logging
+from autotest.client.shared import error
+from autotest.client.virt import libvirt_vm as virt
+
+
+def run_virsh_pool_create_as(test, params, env):
+    '''
+    Test the command virsh pool-create-as
+
+    (1) Call virsh pool-create-as
+    (2) Call virsh -c remote_uri pool-create-as
+    (3) Call virsh pool-create-as with an unexpected option
+    '''
+
+    # Run test case
(Continue reading)

Alex Jia | 26 Jun 2012 19:28
Picon
Favicon

[autotest][PATCH 04/11] virt: Add new virsh wrapper functions into libvirt_vm

Reuse previous libvirt_vm module and add new virsh pool functions, and then
we can create/check a libvirt pool via these functions and use virt-v2v to
convert an existing VM into the pool later.

Signed-off-by: Alex Jia <ajia <at> redhat.com>
---
 client/virt/libvirt_vm.py |   61 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/client/virt/libvirt_vm.py b/client/virt/libvirt_vm.py
index 8d2cd1e..6491d50 100644
--- a/client/virt/libvirt_vm.py
+++ b/client/virt/libvirt_vm.py
 <at>  <at>  -484,6 +484,67  <at>  <at>  def virsh_detach_device(name, xml_file, extra="", uri=""):
         return False

 
+def virsh_pool_info(name, uri = ""):
+    """
+    Returns basic information about the storage pool.
+    """
+    cmd = "pool-info %s" % name
+    try:
+        virsh_cmd(cmd, uri)
+        return True
+    except error.CmdError, detail:
+        logging.error("Pool %s doesn't exist:\n%s", name, detail)
+        return False
+
+def virsh_pool_destroy(name, uri = ""):
(Continue reading)

Alex Jia | 26 Jun 2012 19:28
Picon
Favicon

[autotest][PATCH 07/11] virt.virt_env_process: Add ovirt vm handling

With this patch, we make ovirt vm handling integrating to pre/postprocessing code,
making it possible the execution of a virt-v2v/ovirt test. And introduce a new
virtualization type 'virt_v2v'.

Note that, it's different with kvm/libvirt-autotest, the vm exists on other host
and don't need to start/install, so you need to set 'start_vm = no' in base.cfg.

Signed-off-by: Alex Jia <ajia <at> redhat.com>
---
 client/virt/virt_env_process.py |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/client/virt/virt_env_process.py b/client/virt/virt_env_process.py
index 306be76..f9f5fe3 100644
--- a/client/virt/virt_env_process.py
+++ b/client/virt/virt_env_process.py
 <at>  <at>  -3,7 +3,7  <at>  <at>  from autotest.client import utils
 from autotest.client.shared import error
 import aexpect, kvm_monitor, ppm_utils, virt_test_setup, virt_vm, kvm_vm
 import libvirt_vm, virt_video_maker, virt_utils, virt_storage, kvm_storage
-import virt_remote
+import virt_remote, virt_v2v, ovirt

 try:
     import PIL.Image
 <at>  <at>  -55,12 +55,18  <at>  <at>  def preprocess_vm(test, params, env, name):
     logging.debug("Preprocessing VM '%s'", name)
     vm = env.get_vm(name)
     vm_type = params.get('vm_type')
+    target = params.get('target')
(Continue reading)

Alex Jia | 26 Jun 2012 19:28
Picon
Favicon

[autotest][PATCH 06/11] Support ovirt-engine-sdk build

client/tests/virt_v2v/tests/install.py: add install module to support ovirt-engine-sdk build.
client/virt/base_installer.py: add some flags to allow caller ignore some unnecessary steps
                               for building ovirt-engine-sdk.

Signed-off-by: Alex Jia <ajia <at> redhat.com>
---
 client/tests/virt_v2v/tests/install.py |   67 ++++++++++++++++++++++++++++++++
 client/virt/base_installer.py          |   33 +++++++++-------
 2 files changed, 87 insertions(+), 13 deletions(-)
 create mode 100644 client/tests/virt_v2v/tests/install.py

diff --git a/client/tests/virt_v2v/tests/install.py b/client/tests/virt_v2v/tests/install.py
new file mode 100644
index 0000000..1cbb767
--- /dev/null
+++ b/client/tests/virt_v2v/tests/install.py
 <at>  <at>  -0,0 +1,67  <at>  <at> 
+import os, time
+
+from autotest.client.shared import error
+from autotest.client.virt import installer
+from autotest.client.virt import base_installer
+from autotest.client import utils
+from autotest.client.shared import software_manager
+
+
+def run_install(test, params, env):
+    """
+    Installs virtualization software using the selected installers
+
(Continue reading)

Alex Jia | 26 Jun 2012 19:28
Picon
Favicon

[autotest][PATCH 03/11] virt: Introducing ovirt module

With this module, we able to use SDK for the oVirt engine API to
manipulate resources in oVirt such as Data Centers, Clusters,
Hosts, Storage Domains, VMs, etc.

At present, we haven't cover everything into our oVirt module, which
only includes some necessary API implementation for virt-v2v requirement.

However, it's very easy to extend new functions to support oVirt autotest
in the future.

Signed-off-by: Alex Jia <ajia <at> redhat.com>
Signed-off-by: Wayne Sun <gsun <at> redhat.com>
---
 client/virt/ovirt.py |  646 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 646 insertions(+)
 create mode 100644 client/virt/ovirt.py

diff --git a/client/virt/ovirt.py b/client/virt/ovirt.py
new file mode 100644
index 0000000..bffb3a6
--- /dev/null
+++ b/client/virt/ovirt.py
 <at>  <at>  -0,0 +1,646  <at>  <at> 
+"""
+oVirt SDK wrapper module.
+
+ <at> copyright: 2008-2012 Red Hat Inc.
+"""
+
+
(Continue reading)

Chris Evich | 31 Jul 2012 22:36
Picon
Favicon
Gravatar

Re: [Autotest] [autotest][PATCH 03/11] virt: Introducing ovirt module

On 06/26/2012 01:28 PM, Alex Jia wrote:
> With this module, we able to use SDK for the oVirt engine API to
> manipulate resources in oVirt such as Data Centers, Clusters,
> Hosts, Storage Domains, VMs, etc.
>
> At present, we haven't cover everything into our oVirt module, which
> only includes some necessary API implementation for virt-v2v requirement.
>
> However, it's very easy to extend new functions to support oVirt autotest
> in the future.
>
> Signed-off-by: Alex Jia<ajia <at> redhat.com>
> Signed-off-by: Wayne Sun<gsun <at> redhat.com>
...cut...
> +    try:
> +        # Try to connect oVirt API if connection doesn't exist,
> +        # otherwise, directly return existing API connection.
> +        if not _connected:
> +            _api = API(url, username, password)
> +            _connected = True
> +            return (_api, version)
> +        else:
> +            return (_api, version)
> +    except Exception as e:
> +        logging.error('Failed to connect: %s\n' % str(e))
> +    else:
> +        logging.info('Succeed to connect oVirt/Rhevm manager\n')

I got my autotest working again on RHEL 5.8, and just noticed commit 
commit 76f30ac34aabb8c38a3810c7ecee1f42c9716cc8 adds the above "except 
(Continue reading)

Lucas Meneghel Rodrigues | 1 Aug 2012 01:46
Picon
Gravatar

Re: [Autotest] [autotest][PATCH 03/11] virt: Introducing ovirt module

On Tue, Jul 31, 2012 at 5:36 PM, Chris Evich <cevich <at> redhat.com> wrote:
> On 06/26/2012 01:28 PM, Alex Jia wrote:
>>
>> With this module, we able to use SDK for the oVirt engine API to
>> manipulate resources in oVirt such as Data Centers, Clusters,
>> Hosts, Storage Domains, VMs, etc.
>>
>> At present, we haven't cover everything into our oVirt module, which
>> only includes some necessary API implementation for virt-v2v requirement.
>>
>> However, it's very easy to extend new functions to support oVirt autotest
>> in the future.
>>
>> Signed-off-by: Alex Jia<ajia <at> redhat.com>
>> Signed-off-by: Wayne Sun<gsun <at> redhat.com>
>
> ...cut...
>
>> +    try:
>> +        # Try to connect oVirt API if connection doesn't exist,
>> +        # otherwise, directly return existing API connection.
>> +        if not _connected:
>> +            _api = API(url, username, password)
>> +            _connected = True
>> +            return (_api, version)
>> +        else:
>> +            return (_api, version)
>> +    except Exception as e:
>> +        logging.error('Failed to connect: %s\n' % str(e))
>> +    else:
(Continue reading)

Alex Jia | 1 Aug 2012 05:18
Picon
Favicon

Re: [Autotest] [autotest][PATCH 03/11] virt: Introducing ovirt module

On 08/01/2012 07:46 AM, Lucas Meneghel Rodrigues wrote:
> On Tue, Jul 31, 2012 at 5:36 PM, Chris Evich<cevich <at> redhat.com>  wrote:
>> On 06/26/2012 01:28 PM, Alex Jia wrote:
>>> With this module, we able to use SDK for the oVirt engine API to
>>> manipulate resources in oVirt such as Data Centers, Clusters,
>>> Hosts, Storage Domains, VMs, etc.
>>>
>>> At present, we haven't cover everything into our oVirt module, which
>>> only includes some necessary API implementation for virt-v2v requirement.
>>>
>>> However, it's very easy to extend new functions to support oVirt autotest
>>> in the future.
>>>
>>> Signed-off-by: Alex Jia<ajia <at> redhat.com>
>>> Signed-off-by: Wayne Sun<gsun <at> redhat.com>
>> ...cut...
>>
>>> +    try:
>>> +        # Try to connect oVirt API if connection doesn't exist,
>>> +        # otherwise, directly return existing API connection.
>>> +        if not _connected:
>>> +            _api = API(url, username, password)
>>> +            _connected = True
>>> +            return (_api, version)
>>> +        else:
>>> +            return (_api, version)
>>> +    except Exception as e:
>>> +        logging.error('Failed to connect: %s\n' % str(e))
>>> +    else:
>>> +        logging.info('Succeed to connect oVirt/Rhevm manager\n')
(Continue reading)

Alex Jia | 26 Jun 2012 19:28
Picon
Favicon

[autotest][PATCH 08/11] virt.virt_env_process: Support remotely run tcpdump

With the patch, we can get VM IP via tcpdump on a remote host.

As usual, virt-v2v will convert/import an existing VM into ovirt-node
then we need to get VM IP on the ovirt-node, so it's necessary to
remotely run tcpdump to get VM IP.

Signed-off-by: Wayne Sun <gsun <at> redhat.com>
---
 client/virt/virt_env_process.py |   28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/client/virt/virt_env_process.py b/client/virt/virt_env_process.py
index f9f5fe3..05e3722 100644
--- a/client/virt/virt_env_process.py
+++ b/client/virt/virt_env_process.py
 <at>  <at>  -265,6 +265,11  <at>  <at>  def preprocess(test, params, env):
      <at> param env: The environment (a dict-like object).
     """
     error.context("preprocessing")
+    port = params.get('shell_port')
+    prompt = params.get('shell_prompt')
+    address = params.get('address')
+    username = 'root'
+    password = params.get('root_password')

     # Start tcpdump if it isn't already running
     if "address_cache" not in env:
 <at>  <at>  -274,11 +279,24  <at>  <at>  def preprocess(test, params, env):
         del env["tcpdump"]
     if "tcpdump" not in env and params.get("run_tcpdump", "yes") == "yes":
(Continue reading)

Alex Jia | 26 Jun 2012 19:28
Picon
Favicon

[autotest][PATCH 11/11] gitignore: Update ignores for virt-v2v tests


Signed-off-by: Alex Jia <ajia <at> redhat.com>
---
 .gitignore |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/.gitignore b/.gitignore
index d434901..7333842 100644
--- a/.gitignore
+++ b/.gitignore
 <at>  <at>  -19,6 +19,9  <at>  <at>  client/tests/kvm/env
 client/tests/kvm/*.cfg
 client/tests/libvirt/env
 client/tests/libvirt/*.cfg
+client/tests/virt_v2v/env
+client/tests/virt_v2v/*.cfg
+client/tests/virt_v2v/src
 client/tmp
 logs/*
 server/tmp
--

-- 
1.7.10.2
Alex Jia | 26 Jun 2012 19:28
Picon
Favicon

[autotest][PATCH 10/11] client.tests: add test cases for automatically converting vm

These cases are quite simple, but they will assist users to understand
how does virt-v2v-autotest work and how to write a simple case for
virt-v2v or ovirt.

Signed-off-by: Alex Jia <ajia <at> redhat.com>
Signed-off-by: Wayne Sun <gsun <at> redhat.com>
---
 client/tests/virt_v2v/tests/convert_libvirt.py |   28 +++++++
 client/tests/virt_v2v/tests/convert_ovirt.py   |   28 +++++++
 client/tests/virt_v2v/tests/linux_vm_check.py  |  103 ++++++++++++++++++++++++
 client/tests/virt_v2v/tests/ovirt.py           |   62 ++++++++++++++
 4 files changed, 221 insertions(+)
 create mode 100644 client/tests/virt_v2v/tests/convert_libvirt.py
 create mode 100644 client/tests/virt_v2v/tests/convert_ovirt.py
 create mode 100644 client/tests/virt_v2v/tests/linux_vm_check.py
 create mode 100644 client/tests/virt_v2v/tests/ovirt.py

diff --git a/client/tests/virt_v2v/tests/convert_libvirt.py b/client/tests/virt_v2v/tests/convert_libvirt.py
new file mode 100644
index 0000000..96dc11e
--- /dev/null
+++ b/client/tests/virt_v2v/tests/convert_libvirt.py
 <at>  <at>  -0,0 +1,28  <at>  <at> 
+import os, logging
+from autotest.client.virt import virt_v2v as v2v
+
+def get_args_dict(params):
+    args_dict = {}
+    keys_list = [ 'target', 'vms', 'hypervisor',
+                  'hostname', 'storage', 'network',
(Continue reading)

Alex Jia | 26 Jun 2012 19:28
Picon
Favicon

[autotest][PATCH 09/11] client.tests: Introducing virt-v2v test

Introduce virt-v2v test. The small amount of actual code on this test is made
possible by code reuse, made possible by the kvm/libvirt refactor patchset + the
previous patches on this set.

The obvious difference is that some new parameters had to be introduced to
accomplish virt-v2v testing. A more complete description of such parameters will
be present on our online documentation (wiki) later.

Signed-off-by: Alex Jia <ajia <at> redhat.com>
---
 client/tests/virt_v2v/build.cfg.sample        |  110 +++++++++++++++++++++++++
 client/tests/virt_v2v/common.py               |   13 +++
 client/tests/virt_v2v/control                 |   41 +++++++++
 client/tests/virt_v2v/subtests.cfg.sample     |   94 +++++++++++++++++++++
 client/tests/virt_v2v/tests-shared.cfg.sample |   46 +++++++++++
 client/tests/virt_v2v/tests.cfg.sample        |   26 ++++++
 client/tests/virt_v2v/virt_v2v.py             |   12 +++
 7 files changed, 342 insertions(+)
 create mode 100644 client/tests/virt_v2v/build.cfg.sample
 create mode 100644 client/tests/virt_v2v/common.py
 create mode 100644 client/tests/virt_v2v/control
 create mode 100644 client/tests/virt_v2v/subtests.cfg.sample
 create mode 100644 client/tests/virt_v2v/tests-shared.cfg.sample
 create mode 100644 client/tests/virt_v2v/tests.cfg.sample
 create mode 100644 client/tests/virt_v2v/virt_v2v.py

diff --git a/client/tests/virt_v2v/build.cfg.sample b/client/tests/virt_v2v/build.cfg.sample
new file mode 100644
index 0000000..f3edd8a
--- /dev/null
(Continue reading)

Alex Jia | 9 Jul 2012 20:00
Picon
Favicon

Re: [autotest][PATCH 00/11] Introducing virt-v2v test

The v2 patchset is coming on github, I have committed a new pull request:

https://github.com/autotest/autotest/pull/442

Please review and give some advise.

Thanks in advance,
Alex

----- Original Message -----
From: "Alex Jia" <ajia <at> redhat.com>
To: autotest <at> test.kernel.org
Cc: "Alex Jia" <ajia <at> redhat.com>
Sent: Wednesday, June 27, 2012 1:28:26 AM
Subject: [autotest][PATCH 00/11] Introducing virt-v2v test

This patchset was also sent as a pull request on github,
so you can comment in there, if you wish so.

https://github.com/autotest/autotest/pull/432

This is a patchset introducing virt-v2v test. We've been working during the last 2 months
to provide this pilot test.

Each patch tries to explain some core concepts behind the work, but pretty much we are using
virt-v2v cmdline tool for automatically converting and importing an existing virtual machines
to libvirt-managed KVM, or an open manageable virtualized environment - oVirt.

For these 2 different input method/target (Libvirt and oVirt), we reuse current libvirt-autotest
as libvirt input target, and implement a new oVirt module as oVirt input target, and using SDK
(Continue reading)

Lucas Meneghel Rodrigues | 9 Jul 2012 21:18
Picon
Favicon
Gravatar

Re: [autotest][PATCH 00/11] Introducing virt-v2v test

On Mon, 2012-07-09 at 14:00 -0400, Alex Jia wrote:
> The v2 patchset is coming on github, I have committed a new pull request:
> 
> https://github.com/autotest/autotest/pull/442
> 
> Please review and give some advise.

Will do soon, thanks Alex!

Lucas

Gmane