guyanhua | 1 Mar 07:17 2012

[PATCH 0/2]Add test cases for virsh uri command


Add test cases for virsh uri command.

Gu Yanhua (2):
  This patch adds four test cases for "virsh uri" command.
  This adds configuration for "virsh uri" test.

 client/tests/libvirt/tests/virsh_uri.py |   55 +++++++++++++++++++++++++++++++
 client/virt/subtests.cfg.sample         |   23 +++++++++++++
 2 files changed, 78 insertions(+), 0 deletions(-)
 create mode 100644 client/tests/libvirt/tests/virsh_uri.py
guyanhua | 1 Mar 07:19 2012

[PATCH 1/2] Add four test cases for "virsh uri" command


This patch adds four test cases for "virsh uri" command.

Use four cases:(1) Call virsh uri
               (2) Call virsh -c remote_uri uri
               (3) Call virsh uri with an unexpected option
               (4) Call virsh uri with libvirtd service stop

Signed-off-by: Gu Yanhua <guyanhua-fnst <at> cn.fujitsu.com>
---
 client/tests/libvirt/tests/virsh_uri.py |   55 +++++++++++++++++++++++++++++++
 1 files changed, 55 insertions(+), 0 deletions(-)
 create mode 100644 client/tests/libvirt/tests/virsh_uri.py

diff --git a/client/tests/libvirt/tests/virsh_uri.py b/client/tests/libvirt/tests/virsh_uri.py
new file mode 100644
index 0000000..a239cd4
--- /dev/null
+++ b/client/tests/libvirt/tests/virsh_uri.py
 <at>  <at>  -0,0 +1,55  <at>  <at> 
+import logging
+from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.virt import libvirt_vm
+
+def run_virsh_uri(test, params, env):
+    """
+    Test the command virsh uri
+
+    (1) Call virsh uri
+    (2) Call virsh -c remote_uri uri
(Continue reading)

guyanhua | 1 Mar 07:19 2012

[PATCH 2/2] Add configuration for "virsh uri" test


This adds configuration for "virsh uri" test.

Signed-off-by: Gu Yanhua <guyanhua-fnst <at> cn.fujitsu.com>
---
 client/virt/subtests.cfg.sample |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/client/virt/subtests.cfg.sample b/client/virt/subtests.cfg.sample
index e5a0327..316b74d 100644
--- a/client/virt/subtests.cfg.sample
+++ b/client/virt/subtests.cfg.sample
 <at>  <at>  -161,6 +161,29  <at>  <at>  variants:
         restart_vm = yes
         pxe_timeout = 60

+    - virsh_uri: install setup image_copy unattended_install.cdrom
+        type = virsh_uri
+        vms = ''
+        variants:
+            - no_option:
+                options = ""
+                status_error = "no"
+                libvirtd = "on"
+                #premise: connect with none-password
+                variants:
+                    - connect_to_local:
+                        target_uri = "qemu+ssh:///system"
+                    - connect_to_remote:
+                        target_uri = "qemu+ssh://SOURCE_HOSTNAME.EXAMPLE.COM/system"
(Continue reading)

Alex Jia | 1 Mar 09:32 2012
Picon

Re: [PATCH 1/2] Add four test cases for "virsh uri" command

On 03/01/2012 02:19 PM, guyanhua wrote:
> This patch adds four test cases for "virsh uri" command.
>
> Use four cases:(1) Call virsh uri
>                 (2) Call virsh -c remote_uri uri
>                 (3) Call virsh uri with an unexpected option
>                 (4) Call virsh uri with libvirtd service stop
>
> Signed-off-by: Gu Yanhua<guyanhua-fnst <at> cn.fujitsu.com>
> ---
>   client/tests/libvirt/tests/virsh_uri.py |   55 +++++++++++++++++++++++++++++++
>   1 files changed, 55 insertions(+), 0 deletions(-)
>   create mode 100644 client/tests/libvirt/tests/virsh_uri.py
>
> diff --git a/client/tests/libvirt/tests/virsh_uri.py b/client/tests/libvirt/tests/virsh_uri.py
> new file mode 100644
> index 0000000..a239cd4
> --- /dev/null
> +++ b/client/tests/libvirt/tests/virsh_uri.py
>  <at>  <at>  -0,0 +1,55  <at>  <at> 
> +import logging
> +from autotest_lib.client.common_lib import utils, error
> +from autotest_lib.client.virt import libvirt_vm
> +
> +def run_virsh_uri(test, params, env):
> +    """
> +    Test the command virsh uri
> +
> +    (1) Call virsh uri
> +    (2) Call virsh -c remote_uri uri
(Continue reading)

Alex Jia | 1 Mar 09:34 2012
Picon

Re: [PATCH 2/2] Add configuration for "virsh uri" test

On 03/01/2012 02:19 PM, guyanhua wrote:
>
> This adds configuration for "virsh uri" test.
>
> Signed-off-by: Gu Yanhua<guyanhua-fnst <at> cn.fujitsu.com>
> ---
>   client/virt/subtests.cfg.sample |   23 +++++++++++++++++++++++
>   1 files changed, 23 insertions(+), 0 deletions(-)
>
> diff --git a/client/virt/subtests.cfg.sample b/client/virt/subtests.cfg.sample
> index e5a0327..316b74d 100644
> --- a/client/virt/subtests.cfg.sample
> +++ b/client/virt/subtests.cfg.sample
>  <at>  <at>  -161,6 +161,29  <at>  <at>  variants:
>           restart_vm = yes
>           pxe_timeout = 60
>
> +    - virsh_uri: install setup image_copy unattended_install.cdrom
> +        type = virsh_uri
> +        vms = ''
> +        variants:
> +            - no_option:
> +                options = ""
> +                status_error = "no"
> +                libvirtd = "on"
> +                #premise: connect with none-password
> +                variants:
> +                    - connect_to_local:
> +                        target_uri = "qemu+ssh:///system"
> +                    - connect_to_remote:
(Continue reading)

Yogesh Kulkarni | 1 Mar 15:46 2012
Picon

Re: about multiple instances/sessions on the client machine !

Hi Chris, Lucas


Thanks for your assistance.
class AsyncJob() is doing fine.

Applied patch from : 

The small problem I am getting is, the slave thread in the test which is waiting for master is not showing any results.
Master thread logs are reflected in the results directory.
Both are dumping logs in the stdout/stderr descriptors, so using get_stdout(), get_stderr() methods.
One thing is confirmed that test is getting executed as expected.

Still debugging on this issue, surely will update you about the same.


-thanks
yogesh


On Wed, Feb 29, 2012 at 6:55 PM, Chris Evich <cevich <at> redhat.com> wrote:
On 02/29/2012 06:09 AM, Yogesh Kulkarni wrote:
> Does autotest provide any interfaces to launch multiple processes/sessions
> on the client machine so that I can execute slave and master as different
> processes and collect result of both of them back to the server ?

Hey,

While you asked for processes, I did find a possible threading solution:
 common_lib/utils.py which pulls in base_utils.py class AsyncJob(). I
didn't look too deeply at any synchronization aspects or other helpers,
but on the surface it appears it may work for you.  Let us know if you
can't figure it out, or can't find anything that would work.  Thanks!

--
Chris Evich, RHCA, RHCE, RHCDS, RHCSS
Quality Assurance Engineer
e-mail: cevich + ` <at> ' + redhat.com o: 1-888-RED-HAT1 x44214
_______________________________________________
Autotest mailing list
Autotest <at> test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

_______________________________________________
Autotest mailing list
Autotest <at> test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
Chris Evich | 1 Mar 17:54 2012
Picon

Re: about multiple instances/sessions on the client machine !

Hey,

Thanks for the update, we're glad to help.  I'm happy to know it's 
partially working for you.  I'm not aware of many other use-cases such 
as this, so I fully expect there are bugs.  Though this is functionality 
that "should" work, so please feel free to report problems to us.

Have you tried or had any luck with the logging.* functions (i.e. 
logging.debug(), logging.info(), etc.)?  I'd expect those should work 
fine.

I'm assuming the child threads all inherit the file descriptors of the 
parent, but that's a total guess.  I'm not experienced with 
stdout/stderr within autotest threading, best rely on others here for an 
answer/suggestions in that area (Lucas/Cleber?)

On 03/01/2012 09:46 AM, Yogesh Kulkarni wrote:
> Hi Chris, Lucas
>
> Thanks for your assistance.
> class AsyncJob() is doing fine.
>
> Applied patch from :
> https://github.com/autotest/autotest/commit/4296a0fd36ed5b7c10bfb4fcad4fc18ad79cb7fa#diff-4
>
> The small problem I am getting is, the slave thread in the test which is
> waiting for master is not showing any results.
> Master thread logs are reflected in the results directory.
> Both are dumping logs in the stdout/stderr descriptors, so using
> get_stdout(), get_stderr() methods.
> One thing is confirmed that test is getting executed as expected.
>
> Still debugging on this issue, surely will update you about the same.
>
>
> -thanks
> yogesh
>
>
> On Wed, Feb 29, 2012 at 6:55 PM, Chris Evich<cevich <at> redhat.com>  wrote:
>
>> On 02/29/2012 06:09 AM, Yogesh Kulkarni wrote:
>>> Does autotest provide any interfaces to launch multiple
>> processes/sessions
>>> on the client machine so that I can execute slave and master as different
>>> processes and collect result of both of them back to the server ?
>>
>> Hey,
>>
>> While you asked for processes, I did find a possible threading solution:
>>   common_lib/utils.py which pulls in base_utils.py class AsyncJob(). I
>> didn't look too deeply at any synchronization aspects or other helpers,
>> but on the surface it appears it may work for you.  Let us know if you
>> can't figure it out, or can't find anything that would work.  Thanks!
>>
>> --
>> Chris Evich, RHCA, RHCE, RHCDS, RHCSS
>> Quality Assurance Engineer
>> e-mail: cevich + ` <at> ' + redhat.com o: 1-888-RED-HAT1 x44214
>> _______________________________________________
>> Autotest mailing list
>> Autotest <at> test.kernel.org
>> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>>
>

--

-- 
Chris Evich, RHCA, RHCE, RHCDS, RHCSS
Quality Assurance Engineer
e-mail: cevich + ` <at> ' + redhat.com o: 1-888-RED-HAT1 x44214
Vinson Lee | 1 Mar 20:46 2012

[PATCH] Used named constant for O_NONBLOCK.

Signed-off-by: Vinson Lee <vlee <at> twitter.com>
---
 server/hosts/monitors/monitors_util_unittest.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/server/hosts/monitors/monitors_util_unittest.py b/server/hosts/monitors/monitors_util_unittest.py
index b7a19d7..8de4dba 100755
--- a/server/hosts/monitors/monitors_util_unittest.py
+++ b/server/hosts/monitors/monitors_util_unittest.py
 <at>  <at>  -142,7 +142,7  <at>  <at>  class FollowFilesTestCase(unittest.TestCase):
         self.assertEquals(flags, 0)
         monitors_util.nonblocking(po.stdout)
         flags = fcntl.fcntl(po.stdout, fcntl.F_GETFL)
-        self.assertEquals(flags, 2048)
+        self.assertEquals(flags, os.O_NONBLOCK)
         po.wait()

 
--

-- 
1.7.5.4
Lucas Meneghel Rodrigues | 1 Mar 22:45 2012
Picon

Re: [PATCH] Used named constant for O_NONBLOCK.

On 03/01/2012 04:46 PM, Vinson Lee wrote:
> Signed-off-by: Vinson Lee<vlee <at> twitter.com>

Applied, thanks!

> ---
>   server/hosts/monitors/monitors_util_unittest.py |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/server/hosts/monitors/monitors_util_unittest.py b/server/hosts/monitors/monitors_util_unittest.py
> index b7a19d7..8de4dba 100755
> --- a/server/hosts/monitors/monitors_util_unittest.py
> +++ b/server/hosts/monitors/monitors_util_unittest.py
>  <at>  <at>  -142,7 +142,7  <at>  <at>  class FollowFilesTestCase(unittest.TestCase):
>           self.assertEquals(flags, 0)
>           monitors_util.nonblocking(po.stdout)
>           flags = fcntl.fcntl(po.stdout, fcntl.F_GETFL)
> -        self.assertEquals(flags, 2048)
> +        self.assertEquals(flags, os.O_NONBLOCK)
>           po.wait()
>
>
Lucas Meneghel Rodrigues | 1 Mar 22:47 2012
Picon

Re: [PATCH 0/2]Add test cases for virsh uri command

On 03/01/2012 03:17 AM, guyanhua wrote:
> 
> Add test cases for virsh uri command.

Applied, thanks!

> Gu Yanhua (2):
>    This patch adds four test cases for "virsh uri" command.
>    This adds configuration for "virsh uri" test.
> 
>   client/tests/libvirt/tests/virsh_uri.py |   55 +++++++++++++++++++++++++++++++
>   client/virt/subtests.cfg.sample         |   23 +++++++++++++
>   2 files changed, 78 insertions(+), 0 deletions(-)
>   create mode 100644 client/tests/libvirt/tests/virsh_uri.py

Gmane