test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Liu, Yong" <yong.liu@intel.com>
To: "Wei, FangfangX" <fangfangx.wei@intel.com>,
	"dts@dpdk.org" <dts@dpdk.org>
Cc: "Wei, FangfangX" <fangfangx.wei@intel.com>
Subject: Re: [dts] [PATCH V1] tests/vm_power: add sleep time
Date: Thu, 19 Oct 2017 02:24:31 +0000	[thread overview]
Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62EF9BDD@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1508319235-13454-1-git-send-email-fangfangx.wei@intel.com>

Fangfang,
Please try your best to not use killall command. That's for two reasons. 
1: user may run other qemu process on the host. 
2: killall may not existed on every host.

For the sleep command, I think cpu frequency tuning should be rapidly. 
There may be one issue that if need to wait one second for frequency changed.

Thanks,
Marvin

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Fangfang Wei
> Sent: Wednesday, October 18, 2017 5:34 PM
> To: dts@dpdk.org
> Cc: Wei, FangfangX <fangfangx.wei@intel.com>
> Subject: [dts] [PATCH V1] tests/vm_power: add sleep time
> 
> From: Fangfangx Wei <fangfangx.wei@intel.com>
> 
> After running power command on vm, it should add sleeping timg to get cpu
> frequence on host.
> Add "killall qemu-system-x86_64" in teardown_all to clear vm environment.
> 
> Signed-off-by: Fangfangx Wei <fangfangx.wei@intel.com>
> ---
>  tests/TestSuite_vm_power_manager.py | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tests/TestSuite_vm_power_manager.py
> b/tests/TestSuite_vm_power_manager.py
> index 5e273f4..c2b2759 100644
> --- a/tests/TestSuite_vm_power_manager.py
> +++ b/tests/TestSuite_vm_power_manager.py
> @@ -35,6 +35,7 @@ VM power manager test suite.
>  """
> 
>  import re
> +import time
>  import utils
>  from test_case import TestCase
>  from etgen import IxiaPacketGenerator
> @@ -141,6 +142,7 @@ class TestVmPowerManager(TestCase,
> IxiaPacketGenerator):
>              self.vm_dut.send_expect(
>                  "set_cpu_freq %d max" % vcpu, "vmpower\(guest\)>")
> 
> +        time.sleep(1)
>          for vcpu in range(self.core_num):
>              # map between host cpu and guest cpu
>              ori_freq = self.get_cpu_frequency(self.vcpu_map[vcpu])
> @@ -151,6 +153,7 @@ class TestVmPowerManager(TestCase,
> IxiaPacketGenerator):
>                  # connect vm power host and guest
>                  self.vm_dut.send_expect(
>                      "set_cpu_freq %d down" % vcpu, "vmpower\(guest\)>")
> +                time.sleep(1)
>                  cur_freq = self.get_cpu_frequency(self.vcpu_map[vcpu])
>                  print utils.GREEN("After freqency down, freq is %d\n" %
> cur_freq)
>                  self.verify(
> @@ -171,6 +174,7 @@ class TestVmPowerManager(TestCase,
> IxiaPacketGenerator):
>              self.vm_dut.send_expect(
>                  "set_cpu_freq %d min" % vcpu, "vmpower\(guest\)>")
> 
> +        time.sleep(1)
>          for vcpu in range(self.core_num):
>              ori_freq = self.get_cpu_frequency(self.vcpu_map[vcpu])
>              # get cpu frequencies range
> @@ -178,6 +182,7 @@ class TestVmPowerManager(TestCase,
> IxiaPacketGenerator):
>              for loop in range(len(freqs)-1):
>                  self.vm_dut.send_expect(
>                      "set_cpu_freq %d up" % vcpu, "vmpower\(guest\)>")
> +                time.sleep(1)
>                  cur_freq = self.get_cpu_frequency(self.vcpu_map[vcpu])
>                  print utils.GREEN("After freqency up, freq is %d\n" %
> cur_freq)
>                  self.verify(
> @@ -199,6 +204,7 @@ class TestVmPowerManager(TestCase,
> IxiaPacketGenerator):
>          for vcpu in range(self.core_num):
>              self.vm_dut.send_expect(
>                  "set_cpu_freq %d max" % vcpu, "vmpower\(guest\)>")
> +            time.sleep(1)
>              freq = self.get_cpu_frequency(self.vcpu_map[vcpu])
> 
>              out = self.dut.alt_session.send_expect(
> @@ -222,6 +228,7 @@ class TestVmPowerManager(TestCase,
> IxiaPacketGenerator):
>          for vcpu in range(self.core_num):
>              self.vm_dut.send_expect(
>                  "set_cpu_freq %d min" % vcpu, "vmpower\(guest\)>")
> +            time.sleep(1)
>              freq = self.get_cpu_frequency(self.vcpu_map[vcpu])
> 
>              out = self.dut.alt_session.send_expect(
> @@ -432,4 +439,5 @@ class TestVmPowerManager(TestCase,
> IxiaPacketGenerator):
>          self.dut.send_expect("quit", "# ")
>          self.vm.stop()
>          self.dut.virt_exit()
> +        self.dut.send_expect("killall qemu-system-x86_64", "# ")
>          pass
> --
> 2.7.5

      reply	other threads:[~2017-10-19  2:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18  9:33 Fangfang Wei
2017-10-19  2:24 ` Liu, Yong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86228AFD5BCD8E4EBFD2B90117B5E81E62EF9BDD@SHSMSX103.ccr.corp.intel.com \
    --to=yong.liu@intel.com \
    --cc=dts@dpdk.org \
    --cc=fangfangx.wei@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).