[PATCH v2 2/2] selftests: test possible usb type values from documentation

From: Boris Shtrasman

Date: Thu Jun 25 2026 - 12:08:05 EST


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@xxxxxxxxx>
---
.../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