Lucas Meneghel Rodrigues | 1 Apr 2012 18:21
Picon
Favicon
Gravatar

[PATCH] client/tools/scan_results.py: Make program to run from any directory

We actually forgot to fix this a long time ago, but it's
far more convenient to make scan_results.py to execute from
any diretory. Do this by figuring out the path for the script,
and then deducing the path to the results file by relative
positioning.

Special thanks to Alex Jia <ajia <at> redhat.com> for sending
a preliminary fix for the problem.

Signed-off-by: Lucas Meneghel Rodrigues <lmr <at> redhat.com>
---
 client/tools/scan_results.py |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/client/tools/scan_results.py b/client/tools/scan_results.py
index 71dddde..37efd35 100755
--- a/client/tools/scan_results.py
+++ b/client/tools/scan_results.py
 <at>  <at>  -90,9 +90,11  <at>  <at>  def main(resfiles):

 
 if __name__ == "__main__":
-    import sys, glob
+    import sys, glob, os
+    dirname = os.path.dirname(sys.modules[__name__].__file__)
+    client_dir = os.path.abspath(os.path.join(dirname, ".."))
+    resfiles = glob.glob(os.path.join(client_dir, 'results', 'default', 'status*'))

-    resfiles = glob.glob("../../results/default/status*")
     if len(sys.argv) > 1:
(Continue reading)

Lucas Meneghel Rodrigues | 1 Apr 2012 20:14
Picon
Favicon
Gravatar

[PATCH] logging_config: Print UTC time on timestamps for file logs

This is part of a solution for issue #113.

Due to the fact we work usually on a higly distributed
environment, displaying the messages using UTC is the
best way to help people to debug issues.

Consulting the logging module documentation:

http://docs.python.org/library/logging.html#formatter-objects

The way to make the timestamps to display UTC is to
change the converter function of the Formatter objects
to time.gmtime. So, create a specialized version of
the Formatter object, and set it for the logs stored on
disk. Console log formatting remains unchanged.

Signed-off-by: Lucas Meneghel Rodrigues <lmr <at> redhat.com>
---
 client/common_lib/logging_config.py |   18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/client/common_lib/logging_config.py b/client/common_lib/logging_config.py
index cad5936..e5d7a3c 100644
--- a/client/common_lib/logging_config.py
+++ b/client/common_lib/logging_config.py
 <at>  <at>  -21,19 +21,27  <at>  <at>  class AllowBelowSeverity(logging.Filter):
         return record.levelno < self.level

 
+class AutotestFormatter(logging.Formatter):
(Continue reading)

Chris Evich | 2 Apr 2012 15:14
Picon
Favicon
Gravatar

Re: [libvirt-autotest] New requirement

On 03/30/2012 06:08 AM, Alex Jia wrote:
> On 03/29/2012 11:47 PM, Chris Evich wrote:
>> On 03/29/2012 10:53 AM, Alex Jia wrote:
>>> Any idea about this?
>>>
>>> Thanks,
>>> Alex
>>>
>>> ----- Original Message -----
>>> From: "Alex Jia"<ajia <at> redhat.com>
>>> To: "Chris Evich"<cevich <at> redhat.com>
>>> Cc: autotest <at> test.kernel.org
>>> Sent: Wednesday, March 28, 2012 11:47:53 PM
>>> Subject: Re: [Autotest] [libvirt-autotest] New requirement
>>>
>>> On 03/28/2012 09:14 PM, Chris Evich wrote:
>>>> On 03/28/2012 06:23 AM, Alex Jia wrote:
>>>>>> I guess the best thing here is to remove libvirt_monitor.py
>>>>>> altogether
>>>>>> and introduce a virsh.py file, and call it a day.
>>>>> I haven't seen other feedback by now, if it's a final solution, I will
>>>>> commit patches to
>>>>> change these or others want to do it, also okay for me:
>>>>>
>>>>> 1. remove libvirt_monitor.py
>>>>> 2. introduce a virsh.py then move all of virsh wrapper into it
>>>>> 3. also need to change previous cases to follow these modification
>>>>>
>>>>> Please let me know early if you have a better suggestion.
>>>>>
(Continue reading)

Chris Evich | 2 Apr 2012 15:21
Picon
Favicon
Gravatar

Re: [PATCH] Fix autotest results path

On 03/30/2012 11:48 PM, ajia <at> redhat.com wrote:
> From: Alex Jia<ajia <at> redhat.com>
>
> Running scan_results.py to get test result in autotest root
> directory instead of multi-layers subdirectory, it will be
> more friendly and convenient for users.
>
> Signed-off-by: Alex Jia<ajia <at> redhat.com>
> ---
>   client/tools/scan_results.py |    6 ++++--
>   1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/client/tools/scan_results.py b/client/tools/scan_results.py
> index 71dddde..867c947 100755
> --- a/client/tools/scan_results.py
> +++ b/client/tools/scan_results.py
>  <at>  <at>  -90,9 +90,11  <at>  <at>  def main(resfiles):
>
>
>   if __name__ == "__main__":
> -    import sys, glob
> +    import os, sys, glob
> +
> +    curr_path = os.getcwd()
> +    resfiles = glob.glob("%s/client/results/default/status*" %curr_path)
>
> -    resfiles = glob.glob("../../results/default/status*")
>       if len(sys.argv)>  1:
>           if sys.argv[1] == "-h" or sys.argv[1] == "--help":
>               print "Usage: %s [result files]" % sys.argv[0]
(Continue reading)

Lucas Meneghel Rodrigues | 2 Apr 2012 15:24
Picon
Gravatar

Re: [PATCH] Fix autotest results path

On Mon, Apr 2, 2012 at 10:21 AM, Chris Evich <cevich <at> redhat.com> wrote:
> On 03/30/2012 11:48 PM, ajia <at> redhat.com wrote:
>> From: Alex Jia<ajia <at> redhat.com>
>>
>> Running scan_results.py to get test result in autotest root
>> directory instead of multi-layers subdirectory, it will be
>> more friendly and convenient for users.
>>
>> Signed-off-by: Alex Jia<ajia <at> redhat.com>
>> ---
>>   client/tools/scan_results.py |    6 ++++--
>>   1 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/client/tools/scan_results.py b/client/tools/scan_results.py
>> index 71dddde..867c947 100755
>> --- a/client/tools/scan_results.py
>> +++ b/client/tools/scan_results.py
>>  <at>  <at>  -90,9 +90,11  <at>  <at>  def main(resfiles):
>>
>>
>>   if __name__ == "__main__":
>> -    import sys, glob
>> +    import os, sys, glob
>> +
>> +    curr_path = os.getcwd()
>> +    resfiles = glob.glob("%s/client/results/default/status*" %curr_path)
>>
>> -    resfiles = glob.glob("../../results/default/status*")
>>       if len(sys.argv)>  1:
>>           if sys.argv[1] == "-h" or sys.argv[1] == "--help":
(Continue reading)

Lucas Meneghel Rodrigues | 2 Apr 2012 16:31
Picon
Gravatar

Re: [PATCH] Fix autotest results path

On Mon, Apr 2, 2012 at 10:24 AM, Lucas Meneghel Rodrigues
<lookkas <at> gmail.com> wrote:
> On Mon, Apr 2, 2012 at 10:21 AM, Chris Evich <cevich <at> redhat.com> wrote:
>> On 03/30/2012 11:48 PM, ajia <at> redhat.com wrote:
>>> From: Alex Jia<ajia <at> redhat.com>
>>>
>>> Running scan_results.py to get test result in autotest root
>>> directory instead of multi-layers subdirectory, it will be
>>> more friendly and convenient for users.
>>>
>>> Signed-off-by: Alex Jia<ajia <at> redhat.com>
>>> ---
>>>   client/tools/scan_results.py |    6 ++++--
>>>   1 files changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/client/tools/scan_results.py b/client/tools/scan_results.py
>>> index 71dddde..867c947 100755
>>> --- a/client/tools/scan_results.py
>>> +++ b/client/tools/scan_results.py
>>>  <at>  <at>  -90,9 +90,11  <at>  <at>  def main(resfiles):
>>>
>>>
>>>   if __name__ == "__main__":
>>> -    import sys, glob
>>> +    import os, sys, glob
>>> +
>>> +    curr_path = os.getcwd()
>>> +    resfiles = glob.glob("%s/client/results/default/status*" %curr_path)
>>>
>>> -    resfiles = glob.glob("../../results/default/status*")
(Continue reading)

Jiří Župka | 3 Apr 2012 14:08
Picon
Favicon

[PATCH] virt: Repairs aexpect expect.read_nonblocking infinite read.

Signed-off-by: Jiří Župka <jzupka <at> redhat.com>
---
 client/tests/kvm/tests/ksm_overcommit.py |    2 +-
 client/tests/kvm/tests/virtio_console.py |    2 +-
 client/virt/aexpect.py                   |   28 ++++++++++++++++++----------
 client/virt/deps/test_cpu_flags/stress.c |    2 +-
 4 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/client/tests/kvm/tests/ksm_overcommit.py b/client/tests/kvm/tests/ksm_overcommit.py
index 3614aea..8511818 100644
--- a/client/tests/kvm/tests/ksm_overcommit.py
+++ b/client/tests/kvm/tests/ksm_overcommit.py
 <at>  <at>  -200,7 +200,7  <at>  <at>  def run_ksm_overcommit(test, params, env):
                                       free_mem, (i - 1))
                         last_vm = i
                         break
-                    out = session.read_nonblocking(0.1)
+                    out = session.read_nonblocking(0.1, 1)
                     time.sleep(2)
             except OSError:
                 logging.debug("Only %s host free memory, killing %d guests",
diff --git a/client/tests/kvm/tests/virtio_console.py b/client/tests/kvm/tests/virtio_console.py
index a52b9e1..c3395e8 100644
--- a/client/tests/kvm/tests/virtio_console.py
+++ b/client/tests/kvm/tests/virtio_console.py
 <at>  <at>  -598,7 +598,7  <at>  <at>  def run_virtio_console(test, params, env):

          <at> return: Kernel crash log or None.
         """
-        data = vm_port.read_nonblocking()
(Continue reading)

Lucas Meneghel Rodrigues | 3 Apr 2012 23:08
Picon
Favicon
Gravatar

[PATCH] subtests.cfg.sample: Add missing test dependency info

Signed-off-by: Lucas Meneghel Rodrigues <lmr <at> redhat.com>
---
 client/virt/subtests.cfg.sample |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/client/virt/subtests.cfg.sample b/client/virt/subtests.cfg.sample
index fc8f594..2192840 100644
--- a/client/virt/subtests.cfg.sample
+++ b/client/virt/subtests.cfg.sample
 <at>  <at>  -1661,7 +1661,7  <at>  <at>  variants:
                 dd_timeout = 900
                 check_cmd_timeout = 900

-    - cpuflags:
+    - cpuflags: install setup image_copy unattended_install.cdrom
         type = cpuflags
         extra_params += " -snapshot"
         #Disable all unnecessary vms.
 <at>  <at>  -1715,7 +1715,7  <at>  <at>  variants:
         comm_port = 13234
         regain_ip_cmd = killall dhclient; sleep 10; dhclient;

-    - cpu_hotplug_test:
+    - cpu_hotplug_test: install setup image_copy unattended_install.cdrom
         type = cpu_hotplug
         cpu_hotplug_timeout = 600
         n_cpus_add = 1
 <at>  <at>  -1723,7 +1723,7  <at>  <at>  variants:
         iterations = 5
         onoff_iterations = 100
(Continue reading)

Chris Evich | 3 Apr 2012 23:14
Picon
Favicon
Gravatar

Re: [PATCH] virt: Repairs aexpect expect.read_nonblocking infinite read.

On 04/03/2012 08:08 AM, Jiří Župka wrote:
> Signed-off-by: Jiří Župka<jzupka <at> redhat.com>
> ---
>   client/tests/kvm/tests/ksm_overcommit.py |    2 +-
>   client/tests/kvm/tests/virtio_console.py |    2 +-
>   client/virt/aexpect.py                   |   28 ++++++++++++++++++----------
>   client/virt/deps/test_cpu_flags/stress.c |    2 +-
>   4 files changed, 21 insertions(+), 13 deletions(-)
>
> diff --git a/client/tests/kvm/tests/ksm_overcommit.py b/client/tests/kvm/tests/ksm_overcommit.py
> index 3614aea..8511818 100644
> --- a/client/tests/kvm/tests/ksm_overcommit.py
> +++ b/client/tests/kvm/tests/ksm_overcommit.py
>  <at>  <at>  -200,7 +200,7  <at>  <at>  def run_ksm_overcommit(test, params, env):
>                                         free_mem, (i - 1))
>                           last_vm = i
>                           break
> -                    out = session.read_nonblocking(0.1)
> +                    out = session.read_nonblocking(0.1, 1)
>                       time.sleep(2)
>               except OSError:
>                   logging.debug("Only %s host free memory, killing %d guests",
> diff --git a/client/tests/kvm/tests/virtio_console.py b/client/tests/kvm/tests/virtio_console.py
> index a52b9e1..c3395e8 100644
> --- a/client/tests/kvm/tests/virtio_console.py
> +++ b/client/tests/kvm/tests/virtio_console.py
>  <at>  <at>  -598,7 +598,7  <at>  <at>  def run_virtio_console(test, params, env):
>
>            <at> return: Kernel crash log or None.
>           """
(Continue reading)

Alex Jia | 4 Apr 2012 11:21
Picon
Favicon

Re: [PATCH] Fix autotest results path

Yeah, Chris gave a better fixing.

----- Original Message -----
From: "Lucas Meneghel Rodrigues" <lookkas <at> gmail.com>
To: "Chris Evich" <cevich <at> redhat.com>
Cc: autotest <at> test.kernel.org
Sent: Monday, April 2, 2012 10:31:27 PM
Subject: Re: [Autotest] [PATCH] Fix autotest results path

On Mon, Apr 2, 2012 at 10:24 AM, Lucas Meneghel Rodrigues
<lookkas <at> gmail.com> wrote:
> On Mon, Apr 2, 2012 at 10:21 AM, Chris Evich <cevich <at> redhat.com> wrote:
>> On 03/30/2012 11:48 PM, ajia <at> redhat.com wrote:
>>> From: Alex Jia<ajia <at> redhat.com>
>>>
>>> Running scan_results.py to get test result in autotest root
>>> directory instead of multi-layers subdirectory, it will be
>>> more friendly and convenient for users.
>>>
>>> Signed-off-by: Alex Jia<ajia <at> redhat.com>
>>> ---
>>>   client/tools/scan_results.py |    6 ++++--
>>>   1 files changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/client/tools/scan_results.py b/client/tools/scan_results.py
>>> index 71dddde..867c947 100755
>>> --- a/client/tools/scan_results.py
>>> +++ b/client/tools/scan_results.py
>>>  <at>  <at>  -90,9 +90,11  <at>  <at>  def main(resfiles):
>>>
(Continue reading)


Gmane