selftests/cgroup: Fix string comparison in write_test

Use string comparison (!=) instead of numeric comparison (-ne) for
cpuset values like "0-1".
For example:
$ [[ "0-1" != "2-3" ]] && echo "true" || echo "false"
true
$ [[ "0-1" -ne "2-3" ]] && echo "true" || echo "false"
false

Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
Hongfu Li 2026-05-11 09:39:57 +08:00 committed by Tejun Heo
parent e32e6f0216
commit 2a3d7256fa

View File

@ -18,7 +18,7 @@ write_test() {
echo "testing $interface $value"
echo $value > $dir/$interface
new=$(cat $dir/$interface)
[[ $value -ne $(cat $dir/$interface) ]] && {
[[ "$value" != "$new" ]] && {
echo "$interface write $value failed: new:$new"
exit 1
}