* [PATCH v2 0/2] selftests: helpers: handle multi line in test_sysfs_prop_optional_list
@ 2026-06-25 16:05 Boris Shtrasman
2026-06-25 16:05 ` [PATCH v2 1/2] " Boris Shtrasman
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Boris Shtrasman @ 2026-06-25 16:05 UTC (permalink / raw)
To: Sebastian Reichel, Shuah Khan
Cc: linux-pm, linux-kselftest, linux-kernel, Boris Shtrasman
Modify test_sysfs_prop_optional_list to allow multi line parameters, in
order to comply with checkpatch output that limit line by 100 chars.
Allow use cases like:
test_sysfs_prop_optional_list \
usb_type "Unknown","SDP","DCP","CDP","ACA","C","PD"\
,"PD_DRP","PD_PPS","BrickID", "PD_SPR_AVS" \
,"PD_PPS_SPR_AVS"
--
Changes in v2:
- correctped typo IFS vs $IFS.
- Added the patch to treat usb_types
--
Boris Shtrasman (2):
selftests: helpers: handle multi line in test_sysfs_prop_optional_list
selftests: test possible usb type values from documentation
tools/testing/selftests/power_supply/helpers.sh | 8 ++++----
.../power_supply/test_power_supply_properties.sh | 5 ++++-
2 files changed, 8 insertions(+), 5 deletions(-)
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/2] selftests: helpers: handle multi line in test_sysfs_prop_optional_list
2026-06-25 16:05 [PATCH v2 0/2] selftests: helpers: handle multi line in test_sysfs_prop_optional_list Boris Shtrasman
@ 2026-06-25 16:05 ` Boris Shtrasman
2026-06-25 16:05 ` [PATCH v2 2/2] selftests: test possible usb type values from documentation Boris Shtrasman
2026-07-20 21:43 ` [PATCH v2 0/2] selftests: helpers: handle multi line in test_sysfs_prop_optional_list Sebastian Reichel
2 siblings, 0 replies; 5+ messages in thread
From: Boris Shtrasman @ 2026-06-25 16:05 UTC (permalink / raw)
To: Sebastian Reichel, Shuah Khan
Cc: linux-pm, linux-kselftest, linux-kernel, Boris Shtrasman
Modify test_sysfs_prop_optional_list to allow multi line parameters, in
order to comply with checkpatch output that limit line by 100 chars.
Allow use cases like:
test_sysfs_prop_optional_list \
property_name "value1","value2","val3","very_long_option"\
,"extra_long_option" \
,"even_more_data"
Signed-off-by: Boris Shtrasman <borissh1983@gmail.com>
---
tools/testing/selftests/power_supply/helpers.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/power_supply/helpers.sh b/tools/testing/selftests/power_supply/helpers.sh
index 1ec90d7c9108..ff1175aeed72 100644
--- a/tools/testing/selftests/power_supply/helpers.sh
+++ b/tools/testing/selftests/power_supply/helpers.sh
@@ -108,7 +108,7 @@ test_sysfs_prop_optional_range() {
test_sysfs_prop_optional_list() {
PROP=$1
- LIST=$2
+ shift
TEST_NAME="$DEVNAME".sysfs."$PROP"
@@ -118,9 +118,9 @@ test_sysfs_prop_optional_list() {
valid=0
OLDIFS=$IFS
- IFS=","
- for item in $LIST; do
- if [ "$DATA" = "$item" ]; then
+ IFS=",$IFS"
+ for item in $*; do
+ if [ "$item" ] && [ "$DATA" = "$item" ]; then
valid=1
break
fi
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] selftests: test possible usb type values from documentation
2026-06-25 16:05 [PATCH v2 0/2] selftests: helpers: handle multi line in test_sysfs_prop_optional_list Boris Shtrasman
2026-06-25 16:05 ` [PATCH v2 1/2] " Boris Shtrasman
@ 2026-06-25 16:05 ` Boris Shtrasman
2026-07-20 21:48 ` Sebastian Reichel
2026-07-20 21:43 ` [PATCH v2 0/2] selftests: helpers: handle multi line in test_sysfs_prop_optional_list Sebastian Reichel
2 siblings, 1 reply; 5+ messages in thread
From: Boris Shtrasman @ 2026-06-25 16:05 UTC (permalink / raw)
To: Sebastian Reichel, Shuah Khan
Cc: linux-pm, linux-kselftest, linux-kernel, Boris Shtrasman
modify kselftest to check for usb_types values from
Documentation/ABI/testing/sysfs-class-power instead of only checking for
property.
Added the
"Unknown", "SDP", "DCP", "CDP", "ACA", "C", "PD",
"PD_DRP", "PD_PPS", "BrickID", "PD_SPR_AVS",
"PD_PPS_SPR_AVS" values from the
/sys/class/power_supply/<supply_name>/usb_type section.
Signed-off-by: Boris Shtrasman <borissh1983@gmail.com>
---
.../selftests/power_supply/test_power_supply_properties.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/power_supply/test_power_supply_properties.sh b/tools/testing/selftests/power_supply/test_power_supply_properties.sh
index a66b1313ed88..7bf76af4cfd5 100755
--- a/tools/testing/selftests/power_supply/test_power_supply_properties.sh
+++ b/tools/testing/selftests/power_supply/test_power_supply_properties.sh
@@ -58,7 +58,10 @@ for DEVNAME in $supplies; do
# This fails on kernels < 5.8 (needs 2ad3d74e3c69f)
test_uevent_prop TYPE "$SUPPLY_TYPE"
- test_sysfs_prop_optional usb_type
+ test_sysfs_prop_optional_list \
+ usb_type "Unknown","SDP","DCP","CDP","ACA","C","PD"\
+ ,"PD_DRP","PD_PPS","BrickID", "PD_SPR_AVS" \
+ ,"PD_PPS_SPR_AVS"
test_sysfs_prop_optional_range online 0 2
test_sysfs_prop_optional_range present 0 1
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/2] selftests: helpers: handle multi line in test_sysfs_prop_optional_list
2026-06-25 16:05 [PATCH v2 0/2] selftests: helpers: handle multi line in test_sysfs_prop_optional_list Boris Shtrasman
2026-06-25 16:05 ` [PATCH v2 1/2] " Boris Shtrasman
2026-06-25 16:05 ` [PATCH v2 2/2] selftests: test possible usb type values from documentation Boris Shtrasman
@ 2026-07-20 21:43 ` Sebastian Reichel
2 siblings, 0 replies; 5+ messages in thread
From: Sebastian Reichel @ 2026-07-20 21:43 UTC (permalink / raw)
To: Sebastian Reichel, Shuah Khan, Boris Shtrasman
Cc: linux-pm, linux-kselftest, linux-kernel
On Thu, 25 Jun 2026 19:05:53 +0300, Boris Shtrasman wrote:
> Modify test_sysfs_prop_optional_list to allow multi line parameters, in
> order to comply with checkpatch output that limit line by 100 chars.
>
> Allow use cases like:
> test_sysfs_prop_optional_list \
> usb_type "Unknown","SDP","DCP","CDP","ACA","C","PD"\
> ,"PD_DRP","PD_PPS","BrickID", "PD_SPR_AVS" \
> ,"PD_PPS_SPR_AVS"
>
> [...]
Applied, thanks!
[1/2] selftests: helpers: handle multi line in test_sysfs_prop_optional_list
commit: 426decb0c770ec4e0677906e1f51b6d19dc1b788
[2/2] selftests: test possible usb type values from documentation
(no commit info)
Best regards,
--
Sebastian Reichel <sebastian.reichel@collabora.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/2] selftests: test possible usb type values from documentation
2026-06-25 16:05 ` [PATCH v2 2/2] selftests: test possible usb type values from documentation Boris Shtrasman
@ 2026-07-20 21:48 ` Sebastian Reichel
0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Reichel @ 2026-07-20 21:48 UTC (permalink / raw)
To: Boris Shtrasman; +Cc: Shuah Khan, linux-pm, linux-kselftest, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1680 bytes --]
Hi,
On Thu, Jun 25, 2026 at 07:05:55PM +0300, Boris Shtrasman wrote:
> modify kselftest to check for usb_types values from
> Documentation/ABI/testing/sysfs-class-power instead of only checking for
> property.
>
> Added the
> "Unknown", "SDP", "DCP", "CDP", "ACA", "C", "PD",
> "PD_DRP", "PD_PPS", "BrickID", "PD_SPR_AVS",
> "PD_PPS_SPR_AVS" values from the
> /sys/class/power_supply/<supply_name>/usb_type section.
>
> Signed-off-by: Boris Shtrasman <borissh1983@gmail.com>
> ---
> .../selftests/power_supply/test_power_supply_properties.sh | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/power_supply/test_power_supply_properties.sh b/tools/testing/selftests/power_supply/test_power_supply_properties.sh
> index a66b1313ed88..7bf76af4cfd5 100755
> --- a/tools/testing/selftests/power_supply/test_power_supply_properties.sh
> +++ b/tools/testing/selftests/power_supply/test_power_supply_properties.sh
> @@ -58,7 +58,10 @@ for DEVNAME in $supplies; do
> # This fails on kernels < 5.8 (needs 2ad3d74e3c69f)
> test_uevent_prop TYPE "$SUPPLY_TYPE"
>
> - test_sysfs_prop_optional usb_type
> + test_sysfs_prop_optional_list \
> + usb_type "Unknown","SDP","DCP","CDP","ACA","C","PD"\
> + ,"PD_DRP","PD_PPS","BrickID", "PD_SPR_AVS" \
> + ,"PD_PPS_SPR_AVS"
I've picked up the other patch, but skipped this one, because it
does not work. The usb_type property reports back differently from
what the test_sysfs_prop_optional_list function expects:
sre@venus ~ % cat /sys/class/power_supply/ucsi-source-psy-pmic_glink.ucsi.01/usb_type
[C] PD PD_PPS
Greetings,
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-07-20 21:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-25 16:05 [PATCH v2 0/2] selftests: helpers: handle multi line in test_sysfs_prop_optional_list Boris Shtrasman
2026-06-25 16:05 ` [PATCH v2 1/2] " Boris Shtrasman
2026-06-25 16:05 ` [PATCH v2 2/2] selftests: test possible usb type values from documentation Boris Shtrasman
2026-07-20 21:48 ` Sebastian Reichel
2026-07-20 21:43 ` [PATCH v2 0/2] selftests: helpers: handle multi line in test_sysfs_prop_optional_list Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox