autotest / virt-test

Linux Virtualization Tests
Other
97 stars 140 forks source link

TODO: libvirt: Test virsh cpu-stats command #71

Closed cevich closed 11 years ago

cevich commented 11 years ago
Test the virsh cpu-stats command

(1) Invoke virsh cpu-stats <domain> <options>
(2) Invoke virsh cpu-stats with following possible combination of options
         a. None      e. --start --count
         b. --start   f. --start --total
         c. --count   g. --count --total
         d. --total   h. --start --count --total
(3) Invoke virsh cpu-stats with a numeric argument
(4) Invoke virsh cpu-stats with an invalid string "xyz"
(5) Invoke virsh cpu-stats with above combinations with libvitrd service

stop

Pass Condition:

  1. When option = 'total' a. Displayed Total cpu_time > User cpu_time > System cpu_time b. Displayed Total cpu_time >= User + System cpu_time
  2. When option = 'start' or 'count' a. Displayed CPU's == Expected CPU's b. Cgroup cpu_time* >= sum of cpu_time of each cpu's displayed
  3. When option has a combination of 'start', 'count', 'total' All the above conditions 1 & 2 are checked.
  4. When option is None a. Displayed Total cpu_time >= sum of cpu_time of all cpu's displayed b. Pass condition when option = 'total' (1) is checked.

*Cgroup cpu_time is computed by reading domain specific cpuacct.usage_percpu Delay in reading the percpu file will lead up to cgropu cpu_time being slightly higher (in ns) than the displayed time.

cevich commented 11 years ago

Free to anyone who wants to write it :)

chuanchang commented 11 years ago

@cevich, please assign this task to me, @kyla wants to write it, thanks.

kylazhang commented 11 years ago

Hi @cevich, I have a question about the pass condition, why User cpu_time > System cpu_time? In my test with virsh command seems System cpu_time always larger than User cpu_time

cevich commented 11 years ago

On 01/29/2013 10:48 PM, kylazhang wrote:

Hi @cevich https://github.com/cevich, I have a question about the pass condition, why User cpu_time > System cpu_time? In my test with virsh command seems System cpu_time always larger than User cpu_time

— Reply to this email directly or view it on GitHub https://github.com/autotest/virt-test/issues/71#issuecomment-12872942.

It's probably lack of foresight on my part. Back when we were using Fedora as the default guest OS, this condition was always the case. Now with JeOS, and depending on how quickly after start the check happens, it could be false (as you point out). In light of that, I'd call it a bug, please feel free to remove it :)

Chris Evich, RHCA, RHCE, RHCDS, RHCSS Quality Assurance Engineer e-mail: cevich + `@' + redhat.com o: 1-888-RED-HAT1 x44214

cevich commented 11 years ago

issue assigned to @kylazhang

cevich commented 11 years ago

Adding to tracking issue #64

cevich commented 11 years ago

Very nice test, well written, simple, easy to understand. There were a few EOF whitespace problems I had to fix, and I added a patch to make this test SKIP on RHEL5 (no cpu-stats command). I really like the parameter handling in the new virsh function. I also really appreciate the very clear description/summary of the test in the commit message and comments.

Applied to next as: 400fa33c434431d993e6564dfd5e6561fcf7ca37 871f929adcb5c982ae8e068f665aca7683982a02 commit cfb546ef4af66f7394aaf1f1797f11994fea0c5e 20d47f8e061bbc0cfe044274244392d5456a3331

Thanks!

kylazhang commented 11 years ago

There were a few EOF whitespace problems I had to fix, and I added a patch to make this test SKIP on RHEL5 (no cpu-stats command).

Thanks for your cautiousness, I will aware of them next time :)

cevich commented 11 years ago

No worries, it's not possible to catch everything. As long as it's 90-95%, I don't mind adding little extra bits.