Skip to contentSkip to conversation

app/test: enhance power manager unit tests

PATCH Superseded Reshma Pattan 4 participants 9 messages Apr 6, 2018 – Apr 24, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/test: enhance power manager unit tests

Unit Testcases are added for power_acpi_cpu_freq,
power_kvm_vm_test to improve coverage

---
 test/test/test_power_acpi_cpufreq.c |  2 +-
 test/test/test_power_kvm_vm.c       | 62 +++++++++++++++++++++++++++++++++----
 2 files changed, 57 insertions(+), 7 deletions(-)
test/test/test_power_acpi_cpufreq.c +1 -1
index 3bfd033..8da2dcc 100644
@@ -27,7 +27,7 @@
 #define TEST_POWER_FREQS_NUM_MAX ((unsigned)RTE_MAX_LCORE_FREQS)
 
 #define TEST_POWER_SYSFILE_CUR_FREQ \
-	"/sys/devices/system/cpu/cpu%u/cpufreq/scaling_cur_freq"
+	"/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_cur_freq"
 
 static uint32_t total_freq_num;
 static uint32_t freqs[TEST_POWER_FREQS_NUM_MAX];
test/test/test_power_kvm_vm.c +56 -6

96 lines not on this page · raw message

Signature · 1 line
1.7.12.2
#1 lore raw

PATCH v2 1/1 app/test: enhance power manager unit tests

Unit Testcases are added for power_acpi_cpu_freq,
power_kvm_vm_test to improve coverage

---
V3: removed unnecessary extern funtion prototypes.

---
 test/test/test_power_acpi_cpufreq.c |  2 +-
 test/test/test_power_kvm_vm.c       | 60 +++++++++++++++++++++++++++++++++----
 2 files changed, 55 insertions(+), 7 deletions(-)
test/test/test_power_acpi_cpufreq.c +1 -1
index 3bfd033..8da2dcc 100644
@@ -27,7 +27,7 @@
 #define TEST_POWER_FREQS_NUM_MAX ((unsigned)RTE_MAX_LCORE_FREQS)
 
 #define TEST_POWER_SYSFILE_CUR_FREQ \
-	"/sys/devices/system/cpu/cpu%u/cpufreq/scaling_cur_freq"
+	"/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_cur_freq"
 
 static uint32_t total_freq_num;
 static uint32_t freqs[TEST_POWER_FREQS_NUM_MAX];
test/test/test_power_kvm_vm.c +54 -6

94 lines not on this page · raw message

Signature · 1 line
1.7.12.2
#3 lore raw
Quoted 9 lines · Thomas Monjalon

11/04/2018 16:14, Reshma Pattan:

Quoted 5 lines

Unit Testcases are added for power_acpi_cpu_freq,
power_kvm_vm_test to improve coverage

Applied, thanks

Sadly, this patch seems to break shared library builds. If you try doing "make test-build" with shared libraries on it will fail, or if you do a meson build using shared libraries you will get the same result.

The root cause is that the function guest_channel_host_connect() is a private function and so is not listed in the shared library map file, preventing the test app from linking.

Regards,
/Bruce

#4 lore raw

Hi,

Quoted 21 lines

-----Original Message-----
From: Richardson, Bruce
Sent: Tuesday, April 24, 2018 11:59 AM
To: Thomas Monjalon <[email protected]>
Cc: Parthasarathy, JananeeX M <[email protected]>; [email protected]; Pattan, Reshma <[email protected]>; Hunt, David <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2] app/test: enhance power manager unit tests

Quoted 10 lines · Thomas Monjalon

11/04/2018 16:14, Reshma Pattan:

Quoted 6 lines

Unit Testcases are added for power_acpi_cpu_freq, power_kvm_vm_test to improve coverage

Signed-off-by: Jananee Parthasarathy
<[email protected]>

Applied, thanks

Quoted 8 lines

Sadly, this patch seems to break shared library builds. If you try doing "make test-build" with shared libraries on it will fail, or if you do a meson build using shared libraries you will get the same result.

The root cause is that the function guest_channel_host_connect() is a private function and so is not listed in the shared library map file, preventing the test app from linking.

Any action from my side required? Let me know.

Quoted 2 lines

Regards,
/Bruce

#5 lore raw
Quoted 26 lines · Reshma

Hi,

Quoted 24 lines

-----Original Message-----
From: Richardson, Bruce
Sent: Tuesday, April 24, 2018 11:59 AM
To: Thomas Monjalon <[email protected]>
Cc: Parthasarathy, JananeeX M <[email protected]>; [email protected]; Pattan, Reshma <[email protected]>; Hunt, David <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2] app/test: enhance power manager unit tests

Quoted 9 lines · Thomas Monjalon

11/04/2018 16:14, Reshma Pattan:

Quoted 6 lines

Unit Testcases are added for power_acpi_cpu_freq, power_kvm_vm_test to improve coverage

Signed-off-by: Jananee Parthasarathy
<[email protected]>

Applied, thanks

Sadly, this patch seems to break shared library builds. If you try doing "make test-build" with shared libraries on it will fail, or if you do a meson build using shared libraries you will get the same result.

Quoted 5 lines
Quoted 4 lines

The root cause is that the function guest_channel_host_connect() is a private function and so is not listed in the shared library map file, preventing the test app from linking.

Any action from my side required? Let me know.

Reshma,
    Looking at this, I think this particular unit test needs to be removed. The way it is at the moment, it's "faking" the connect, then any commands that are sent to the dummy host are only really to test to see if the API breaks, which is going to be captured by compilation tests anyway. I don't see the value of this unit test unless you have the full host setup underneath is, in which case it's no longer a unit test. Also, we don't want to make these functions public, as they are only of use to the library internally, and there is no use for them publicly (unless a guest wants to fake a connection to a non-existent host).

What do you think?
Dave.

#6 lore raw

Hi,

Quoted 56 lines

-----Original Message-----
From: Hunt, David
Sent: Tuesday, April 24, 2018 1:10 PM
To: Pattan, Reshma <[email protected]>; Richardson, Bruce <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Parthasarathy, JananeeX M <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] app/test: enhance power manager unit tests

Quoted 15 lines · Reshma

Hi,

Quoted 13 lines

-----Original Message-----
From: Richardson, Bruce
Sent: Tuesday, April 24, 2018 11:59 AM
To: Thomas Monjalon <[email protected]>
Cc: Parthasarathy, JananeeX M <[email protected]>; [email protected]; Pattan, Reshma <[email protected]>; Hunt, David <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2] app/test: enhance power manager unit tests

Quoted 2 lines · Thomas Monjalon

11/04/2018 16:14, Reshma Pattan:

Quoted 1 line

Unit Testcases are added for power_acpi_cpu_freq,

power_kvm_vm_test

Quoted 11 lines
Quoted 11 lines
Quoted 7 lines
Quoted 5 lines

to improve coverage

Signed-off-by: Jananee Parthasarathy
<[email protected]>

Applied, thanks

Sadly, this patch seems to break shared library builds. If you try doing "make test-build" with shared libraries on it will fail, or if you do a meson build using shared libraries you will get the same result.

Quoted 5 lines
Quoted 4 lines

The root cause is that the function guest_channel_host_connect() is a private function and so is not listed in the shared library map file, preventing the test app from linking.

Any action from my side required? Let me know.

Reshma,
    Looking at this, I think this particular unit test needs to be removed. The
way it is at the moment, it's "faking" the connect, then any commands that are sent to the dummy host are only really to test to see if the API breaks, which is going to be captured by compilation tests anyway. I don't see the value of this unit test unless you have the full host setup underneath is, in which case it's no longer a unit test.
Also, we don't want to make these functions public, as they are only of use to the library internally, and there is no use for them publicly (unless a guest wants to fake a connection to a non-existent host).

Quoted 1 line

What do you think?

Fine, we are reverting the changes and will send the patch soon.

Thanks,
Reshma

#7 lore raw

24/04/2018 14:51, Pattan, Reshma:

Quoted 35 lines

From: Hunt, David

Quoted 34 lines · Reshma
Quoted 4 lines

From: Richardson, Bruce

Quoted 3 lines · Thomas Monjalon
Quoted 2 lines

11/04/2018 16:14, Reshma Pattan:

Quoted 1 line

Unit Testcases are added for power_acpi_cpu_freq,

power_kvm_vm_test

Quoted 11 lines
Quoted 11 lines
Quoted 7 lines
Quoted 5 lines

to improve coverage

Signed-off-by: Jananee Parthasarathy
<[email protected]>

Applied, thanks

Sadly, this patch seems to break shared library builds. If you try doing "make test-build" with shared libraries on it will fail, or if you do a meson build using shared libraries you will get the same result.

Quoted 5 lines
Quoted 4 lines

The root cause is that the function guest_channel_host_connect() is a private function and so is not listed in the shared library map file, preventing the test app from linking.

Any action from my side required? Let me know.

Reshma,
Looking at this, I think this particular unit test needs to be removed. The
way it is at the moment, it's "faking" the connect, then any commands that are sent to the dummy host are only really to test to see if the API breaks, which is going to be captured by compilation tests anyway. I don't see the value of this unit test unless you have the full host setup underneath is, in which case it's no longer a unit test.
Also, we don't want to make these functions public, as they are only of use to the library internally, and there is no use for them publicly (unless a guest wants to fake a connection to a non-existent host).

Quoted 3 lines
Quoted 1 line

What do you think?

Fine, we are reverting the changes and will send the patch soon.

Where is the patch?
I will revert it myself.

#8 lore raw

Hi Thomas,

I sent it few mins back. Can you check and apply

Thanks,
Reshma

Quoted 55 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Tuesday, April 24, 2018 11:34 PM
To: Pattan, Reshma <[email protected]>
Cc: [email protected]; Hunt, David <[email protected]>; Richardson, Bruce <[email protected]>; Parthasarathy, JananeeX M <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2] app/test: enhance power manager unit tests

24/04/2018 14:51, Pattan, Reshma:

Quoted 17 lines

From: Hunt, David

Quoted 16 lines · Reshma
Quoted 4 lines

From: Richardson, Bruce

Quoted 3 lines · Thomas Monjalon
Quoted 2 lines

11/04/2018 16:14, Reshma Pattan:

Quoted 1 line

Unit Testcases are added for power_acpi_cpu_freq,

power_kvm_vm_test

Quoted 10 lines
Quoted 10 lines
Quoted 7 lines
Quoted 5 lines

to improve coverage

Signed-off-by: Jananee Parthasarathy
<[email protected]>

Applied, thanks

Sadly, this patch seems to break shared library builds. If you try doing "make test-build" with shared libraries on it will fail, or if you do a meson build using shared libraries you will get the

same result.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 5 lines

The root cause is that the function guest_channel_host_connect() is a private function and so is not listed in the shared library map file, preventing the test app from linking.

Any action from my side required? Let me know.

Quoted 7 lines
Quoted 7 lines

Reshma,
Looking at this, I think this particular unit test needs to be
removed. The way it is at the moment, it's "faking" the connect, then any commands that are sent to the dummy host are only really to test to see if the API breaks, which is going to be captured by compilation tests anyway. I don't see the value of this unit test unless you have the full host setup underneath is, in which case it's no

longer a unit test.

Quoted 7 lines
Quoted 5 lines

Also, we don't want to make these functions public, as they are only of use to the library internally, and there is no use for them publicly (unless a guest wants to fake a connection to a non-existent host).

What do you think?

Fine, we are reverting the changes and will send the patch soon.

Where is the patch?
I will revert it myself.