====== Checking before the patch ====== ====== Checking the tree with the patch ====== tools/testing/selftests/bpf/test_bpftool_map.sh is a new file, but not shellcheck compliant New errors added --- /tmp/tmp.pIpBGEx1Wz 2025-06-20 09:59:43.602922304 -0700 +++ /tmp/tmp.Qv0mfUYu2O 2025-06-20 09:59:44.462917710 -0700 @@ -0,0 +1,320 @@ + +In test_bpftool_map.sh line 18: +SCRIPT_DIR=$(dirname $(realpath "$0")) + ^--------------^ SC2046 (warning): Quote this to prevent word splitting. + + +In test_bpftool_map.sh line 23: +KDIR_ROOT_DIR=$(realpath "$SCRIPT_DIR"/../../../../) +^-----------^ SC2034 (warning): KDIR_ROOT_DIR appears unused. Verify use (or export if used externally). + + +In test_bpftool_map.sh line 40: + while mountpoint -q "$BPF_DIR" && [ $attempt -lt $max_attempts ]; do + ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. + ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. + +Did you mean: + while mountpoint -q "$BPF_DIR" && [ "$attempt" -lt "$max_attempts" ]; do + + +In test_bpftool_map.sh line 55: + exit $ksft_skip + ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. + +Did you mean: + exit "$ksft_skip" + + +In test_bpftool_map.sh line 69: + if [ $(id -u) -ne 0 ]; then + ^------^ SC2046 (warning): Quote this to prevent word splitting. + + +In test_bpftool_map.sh line 79: + local bpftool_path="$1" + ^----------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 100: + local map_name="$1" + ^------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 101: + local bpftool_path="$2" + ^----------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 115: + local name_cmd="$1" + ^------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 116: + local map_name="$2" + ^------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 117: + local bpftool_path="$3" + ^----------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 118: + local key="$4" + ^-------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 121: + if ! "$bpftool_path" map lookup "$name_cmd" "$map_name" key $key 1>/dev/null; then + ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. + +Did you mean: + if ! "$bpftool_path" map lookup "$name_cmd" "$map_name" key "$key" 1>/dev/null; then + + +In test_bpftool_map.sh line 141: + local name_cmd="$1" + ^------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 142: + local map_name="$2" + ^------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 143: + local bpftool_path="$3" + ^----------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 144: + local key="$4" + ^-------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 145: + local write_should_succeed="$5" + ^------------------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 146: + local value="1 1 1 1" + ^---------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 148: + if "$bpftool_path" map update "$name_cmd" "$map_name" key $key value \ + ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. + +Did you mean: + if "$bpftool_path" map update "$name_cmd" "$map_name" key "$key" value \ + + +In test_bpftool_map.sh line 149: + $value 2>/dev/null; then + ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. + +Did you mean: + "$value" 2>/dev/null; then + + +In test_bpftool_map.sh line 170: + local name_cmd="$1" + ^------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 171: + local map_name="$2" + ^------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 172: + local bpftool_path="$3" + ^----------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 173: + local key="$4" + ^-------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 174: + local write_should_succeed="$5" + ^------------------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 175: + local value="1 1 1 1" + ^---------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 179: + if ! "$bpftool_path" map lookup "$name_cmd" "$map_name" key $key 1>/dev/null; then + ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. + +Did you mean: + if ! "$bpftool_path" map lookup "$name_cmd" "$map_name" key "$key" 1>/dev/null; then + + +In test_bpftool_map.sh line 185: + if "$bpftool_path" map delete "$name_cmd" "$map_name" key $key 2>/dev/null; then + ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. + +Did you mean: + if "$bpftool_path" map delete "$name_cmd" "$map_name" key "$key" 2>/dev/null; then + + +In test_bpftool_map.sh line 198: + if "$bpftool_path" map lookup "$name_cmd" "$map_name" key $key 1>/dev/null; then + ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. + +Did you mean: + if "$bpftool_path" map lookup "$name_cmd" "$map_name" key "$key" 1>/dev/null; then + + +In test_bpftool_map.sh line 212: + if "$bpftool_path" map update "$name_cmd" "$map_name" key $key value \ + ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. + +Did you mean: + if "$bpftool_path" map update "$name_cmd" "$map_name" key "$key" value \ + + +In test_bpftool_map.sh line 213: + $value 2>/dev/null; then + ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. + +Did you mean: + "$value" 2>/dev/null; then + + +In test_bpftool_map.sh line 234: + local name_cmd="$1" + ^------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 235: + local map_name="$2" + ^------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 236: + local bpftool_path="$3" + ^----------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 237: + local bpf_dir="$4" + ^-----------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 238: + local bpf_file="$5" + ^------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 239: + local pin_path="$bpf_dir/map_iterator" + ^------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 262: + local name_cmd="$1" + ^------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 263: + local map_name="$2" + ^------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 264: + local bpftool_path="$3" + ^----------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 265: + local key_for_rw="$4" + ^--------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 266: + local key_to_del="$5" + ^--------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 267: + local write_should_succeed="$6" + ^------------------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 268: + local bpf_dir="$7" + ^-----------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 269: + local bpf_iter_file_path="$8" + ^----------------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 288: + local map_name="$1" + ^------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 289: + local bpftool_path="$2" + ^----------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 290: + local bpf_dir="$3" + ^-----------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 291: + local pin_path="$bpf_dir/${map_name}_pinned" + ^------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 292: + local write_should_succeed="$4" + ^------------------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 293: + local bpf_iter_file_path="$5" + ^----------------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 316: + local bpftool_path="$1" + ^----------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 317: + local bpf_dir="$2" + ^-----------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 318: + local outer_map_name="outer_map_tt" + ^------------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 319: + local inner_map_name="inner_map_tt" + ^------------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + + +In test_bpftool_map.sh line 354: + local bpftool_path="$1" + ^----------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. + +For more information: + https://www.shellcheck.net/wiki/SC2034 -- KDIR_ROOT_DIR appears unused. Ver... + https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt... + https://www.shellcheck.net/wiki/SC3043 -- In POSIX sh, 'local' is undefined.