cpuhotplug_hotplug.sh: dash's 'local' only accepts the first token
PATCH 1/1 cpuhotplug_hotplug.sh: dash's 'local' only accepts the first token
dash's 'local' only accepts the first token, the line:
Quoted 1 line
local present_cpus=$(get_present_cpus)
causes a world of problems on systems where /bin/sh is dash:
Quoted 6 lines
root@juno-r1:~# /bin/sh # get_hotplug_cpus /bin/sh: 1: get_hotplug_cpus: not found # . /opt/ltp/testcases/bin/cpuhotplug_hotplug.sh # get_hotplug_cpus cpu0
when compared with bash:
Quoted 5 lines
root@juno-r1:~# get_hotplug_cpus get_hotplug_cpus: command not found root@juno-r1:~# . /opt/ltp/testcases/bin/cpuhotplug_hotplug.sh root@juno-r1:~# get_hotplug_cpus cpu0 cpu1 cpu2 cpu3 cpu4 cpu5
This causes the cpuhotplug tests to behave really strangely....
Quoting the assignment fixes the issue:
root@juno-r1:~# /bin/sh
Quoted 5 lines
# get_hotplug_cpus /bin/sh: 1: get_hotplug_cpus: not found # . /opt/ltp/testcases/bin/cpuhotplug_hotplug.sh # get_hotplug_cpus cpu0 cpu1 cpu2 cpu3 cpu4 cpu5
Signed-off-by James Morse <[email protected]>
--- testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh +1 -1
@@ -214,7 +214,7 @@ get_present_cpus_num() # get_hotplug_cpus() { - local present_cpus=$(get_present_cpus) + local present_cpus="$(get_present_cpus)" local hotplug_cpus="" for cpu in $present_cpus; do
Signature · 1 line
2.8.0.rc3
PATCH 1/1 cpuhotplug_hotplug.sh: dash's 'local' only accepts the first token
Hi!
Pushed, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]