Error: SHELLCHECK_WARNING (CWE-758): [#def1] /etc/profile.d/podman-docker.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. # 1|-> # DOCKER_HOST initialization # 2| # 3| if [ -z "${DOCKER_HOST-}" ]; then Error: SHELLCHECK_WARNING (CWE-156): [#def2] /etc/profile.d/podman-docker.sh:4:10: warning[SC2046]: Quote this to prevent word splitting. # 2| # 3| if [ -z "${DOCKER_HOST-}" ]; then # 4|-> if [ $(id -u) -eq 0 ]; then # 5| export DOCKER_HOST=unix:///run/podman/podman.sock # 6| else Error: SHELLCHECK_WARNING (CWE-563): [#def3] /usr/share/podman/test/system/001-basic.bats:12:5: warning[SC2034]: BATS_TEST_NAME_PREFIX appears unused. Verify use (or export if used externally). # 10| function setup() { # 11| # Makes test logs easier to read # 12|-> BATS_TEST_NAME_PREFIX="[001] " # 13| } # 14| Error: SHELLCHECK_WARNING (CWE-571): [#def4] /usr/share/podman/test/system/001-basic.bats:32:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 30| # 31| # Test that build date is reasonable, e.g. after 2019-01-01 # 32|-> local built=$(expr "$output" : ".*Built: \+\(.*\)" | head -n1) # 33| local built_t=$(date --date="$built" +%s) # 34| assert "$built_t" -gt 1546300800 "Preposterous 'Built' time in podman version" Error: SHELLCHECK_WARNING (CWE-571): [#def5] /usr/share/podman/test/system/001-basic.bats:33:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 31| # Test that build date is reasonable, e.g. after 2019-01-01 # 32| local built=$(expr "$output" : ".*Built: \+\(.*\)" | head -n1) # 33|-> local built_t=$(date --date="$built" +%s) # 34| assert "$built_t" -gt 1546300800 "Preposterous 'Built' time in podman version" # 35| Error: SHELLCHECK_WARNING (CWE-88): [#def6] /usr/share/podman/test/system/001-basic.bats:56:46: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 54| 'Store:{{.Store.GraphDriverName}}' # 55| ) # 56|-> run_podman info --format "$(IFS='/' echo ${want[@]})" # 57| echo "# $output" >&3 # 58| } Error: SHELLCHECK_WARNING (CWE-140): [#def7] /usr/share/podman/test/system/001-basic.bats:117:31: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. # 115| # Split it into its components; remove "-remote" from the command path; # 116| # and preserve any other args if present. # 117|-> local -a podman_as_array=($PODMAN) # 118| local podman_path=${podman_as_array[0]} # 119| local podman_non_remote=${podman_path%%-remote} Error: SHELLCHECK_WARNING (CWE-569): [#def8] /usr/share/podman/test/system/001-basic.bats:123:12: warning[SC2124]: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate. # 121| # 122| # This always worked: running "podman --remote ..." # 123|-> PODMAN="${podman_non_remote} --remote ${podman_args[@]}" run_podman version # 124| is "$output" ".*Server:" "podman --remote: contacts server" # 125| Error: SHELLCHECK_WARNING (CWE-569): [#def9] /usr/share/podman/test/system/001-basic.bats:127:12: warning[SC2124]: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate. # 125| # 126| # This was failing: "podman --foo --bar --remote". # 127|-> PODMAN="${podman_non_remote} --log-level=error ${podman_args[@]} --remote" run_podman version # 128| is "$output" ".*Server:" "podman [flags] --remote: contacts server" # 129| Error: SHELLCHECK_WARNING (CWE-569): [#def10] /usr/share/podman/test/system/001-basic.bats:131:12: warning[SC2124]: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate. # 129| # 130| # ...but no matter what, --remote is never allowed after subcommand # 131|-> PODMAN="${podman_non_remote} ${podman_args[@]}" run_podman 125 version --remote # 132| is "$output" "Error: unknown flag: --remote # 133| See 'podman version --help'" "podman version --remote" Error: SHELLCHECK_WARNING (CWE-563): [#def11] /usr/share/podman/test/system/005-info.bats:36:5: warning[SC2034]: expr_nvr appears unused. Verify use (or export if used externally). # 34| run_podman info --format=json # 35| # 36|-> expr_nvr="[a-z0-9-]\\\+-[a-z0-9.]\\\+-[a-z0-9]\\\+\." # 37| expr_path="/[a-z0-9\\\/.-]\\\+\\\$" # 38| Error: SHELLCHECK_WARNING (CWE-571): [#def12] /usr/share/podman/test/system/005-info.bats:92:19: warning[SC2155]: Declare and assign separately to avoid masking return values. # 90| local osrelease=/etc/os-release # 91| if [[ -e $osrelease ]]; then # 92|-> local osname=$(source $osrelease; echo $NAME) # 93| if [[ $osname =~ Red.Hat ]]; then # 94| die "CI_DESIRED_NETWORK must be set in gating.yaml for RHEL testing" Error: SHELLCHECK_WARNING (CWE-571): [#def13] /usr/share/podman/test/system/005-info.bats:161:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 159| test -e $osrelease || skip "Not a RHEL system (no $osrelease)" # 160| # 161|-> local osname=$(source $osrelease; echo $NAME) # 162| if [[ $osname =~ Red.Hat || $osname =~ CentOS ]]; then # 163| # Version can include minor; strip off first dot an all beyond it Error: SHELLCHECK_WARNING (CWE-571): [#def14] /usr/share/podman/test/system/005-info.bats:164:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 162| if [[ $osname =~ Red.Hat || $osname =~ CentOS ]]; then # 163| # Version can include minor; strip off first dot an all beyond it # 164|-> local osver=$(source $osrelease; echo $VERSION_ID) # 165| test ${osver%%.*} -le 8 || skip "$osname $osver > RHEL8" # 166| Error: SHELLCHECK_WARNING (CWE-480): [#def15] /usr/share/podman/test/system/005-info.bats:284:25: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ). # 282| safe_opts=$(podman_isolation_opts ${PODMAN_TMPDIR}) # 283| # 284|-> CI_DESIRED_DATABASE= run_podman 125 $safe_opts --db-backend=boltdb info # 285| assert "$output" =~ "deprecated, no new BoltDB databases can be created" \ # 286| "without CI_DESIRED_DATABASE" Error: SHELLCHECK_WARNING (CWE-571): [#def16] /usr/share/podman/test/system/010-images.bats:207:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 205| local aaa_tag=d # 206| local zzz_name=zzzzzzzzzz.yyyyyyyyy/xxxxxxxxx # 207|-> local zzz_tag=$(random_string 15) # 208| # 209| # Helper function to check one line of tabular output; all this does is Error: SHELLCHECK_WARNING (CWE-571): [#def17] /usr/share/podman/test/system/010-images.bats:371:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 369| # 370| # overlay or vfs # 371|-> local storagedriver="$(podman_storage_driver)" # 372| # 373| local imstore=$PODMAN_TMPDIR/imagestore Error: SHELLCHECK_WARNING (CWE-156): [#def18] /usr/share/podman/test/system/010-images.bats:427:39: warning[SC2046]: Quote this to prevent word splitting. # 425| RUN echo $i # 426| EOF # 427|-> run_podman build -q -t img-$i-$(safename) $PODMAN_TMPDIR # 428| done # 429| Error: SHELLCHECK_WARNING (CWE-156): [#def19] /usr/share/podman/test/system/010-images.bats:435:36: warning[SC2046]: Quote this to prevent word splitting. # 433| for i in $(seq --format '%02g' 1 $count); do # 434| timeout --foreground -v --kill=10 60 \ # 435|-> $PODMAN rmi img-$i-$(safename) & # 436| done # 437| Error: SHELLCHECK_WARNING: [#def20] /usr/share/podman/test/system/010-images.bats:439:27: warning[SC2076]: Remove quotes from right-hand side of =~ to match as a regex rather than literally. # 437| # 438| tries=100 # 439|-> while [[ "$output" =~ "$(safename)" ]] && [[ $tries -gt 0 ]]; do # 440| run_podman images --format "{{.ID}} {{.Names}}" # 441| tries=$((tries - 1)) Error: SHELLCHECK_WARNING (CWE-571): [#def21] /usr/share/podman/test/system/012-manifest.bats:125:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 123| # 124| # Build two images, different arches, and add each to one manifest list # 125|-> local img="i-$(safename)" # 126| local manifestlocal="m-$(safename):1.0" # 127| run_podman manifest create $manifestlocal Error: SHELLCHECK_WARNING (CWE-571): [#def22] /usr/share/podman/test/system/012-manifest.bats:126:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 124| # Build two images, different arches, and add each to one manifest list # 125| local img="i-$(safename)" # 126|-> local manifestlocal="m-$(safename):1.0" # 127| run_podman manifest create $manifestlocal # 128| for arch in amd arm;do Error: SHELLCHECK_WARNING (CWE-156): [#def23] /usr/share/podman/test/system/012-manifest.bats:206:16: warning[SC2046]: Quote this to prevent word splitting. # 204| # 205| if [[ -n "$listFlags" ]] ; then # 206|-> assert $(jq -r '.annotations["global"]' <<<"$index") == local \ # 207| "listFlags=$listFlags, .annotations[global]" # 208| fi Error: SHELLCHECK_WARNING (CWE-156): [#def24] /usr/share/podman/test/system/012-manifest.bats:210:16: warning[SC2046]: Quote this to prevent word splitting. # 208| fi # 209| if [[ -n "$platformFlags" ]] ; then # 210|-> assert $(jq -r '.manifests[1].platform.os' <<<"$index") == linux \ # 211| "platformFlags=$platformFlags, .platform.os" # 212| assert $(jq -r '.manifests[1].platform.architecture' <<<"$index") == amd64 \ Error: SHELLCHECK_WARNING (CWE-156): [#def25] /usr/share/podman/test/system/012-manifest.bats:212:16: warning[SC2046]: Quote this to prevent word splitting. # 210| assert $(jq -r '.manifests[1].platform.os' <<<"$index") == linux \ # 211| "platformFlags=$platformFlags, .platform.os" # 212|-> assert $(jq -r '.manifests[1].platform.architecture' <<<"$index") == amd64 \ # 213| "platformFlags=$platformFlags, .platform.architecture" # 214| fi Error: SHELLCHECK_WARNING (CWE-691): [#def26] /usr/share/podman/test/system/012-manifest.bats:225:9: warning[SC2254]: Quote expansions in case patterns to match literally rather than as a glob. # 223| for digest in $firstdigest $seconddigest ; do # 224| case $digest in # 225|-> $firstdigest) # 226| filetitle=listed.txt # 227| defaulttype=text/plain Error: SHELLCHECK_WARNING (CWE-691): [#def27] /usr/share/podman/test/system/012-manifest.bats:229:9: warning[SC2254]: Quote expansions in case patterns to match literally rather than as a glob. # 227| defaulttype=text/plain # 228| ;; # 229|-> $seconddigest) # 230| filetitle=zeroes # 231| defaulttype=application/octet-stream Error: SHELLCHECK_WARNING (CWE-571): [#def28] /usr/share/podman/test/system/012-manifest.bats:297:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 295| # every flag available. # 296| skip_if_remote "running a local registry doesn't work with podman-remote" # 297|-> local list="m-$(safename):1.0" # 298| truncate -s 20M ${PODMAN_TMPDIR}/zeroes # 299| echo oh yeah > ${PODMAN_TMPDIR}/listed.txt Error: SHELLCHECK_WARNING (CWE-398): [#def29] /usr/share/podman/test/system/015-help.bats:133:22: warning[SC2198]: Arrays don't work as operands in [ ]. Use a loop (or concatenate with * instead of @). # 131| fi # 132| # "network rm" too # 133|-> if [ "$@" = "network" -a "$cmd" = "rm" ]; then # 134| continue # 135| fi Error: SHELLCHECK_WARNING (CWE-477): [#def30] /usr/share/podman/test/system/015-help.bats:133:39: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 131| fi # 132| # "network rm" too # 133|-> if [ "$@" = "network" -a "$cmd" = "rm" ]; then # 134| continue # 135| fi Error: SHELLCHECK_WARNING (CWE-571): [#def31] /usr/share/podman/test/system/015-help.bats:154:19: warning[SC2155]: Declare and assign separately to avoid masking return values. # 152| # usage error. # 153| if ! expr "$usage" : ".*\.\.\."; then # 154|-> local n_args=$(wc -w <<<"$usage") # 155| # 156| run_podman '?' "$@" $cmd $(seq --format='x%g' 0 $n_args) Error: SHELLCHECK_WARNING (CWE-569): [#def32] /usr/share/podman/test/system/030-run.bats:15:12: warning[SC2089]: Quotes/backslashes will be treated literally. Use an array. # 13| err_no_exec_dir="Error:.*exec.*\\\(permission denied\\\|is a directory\\\)" # 14| # 15|-> tests=" # 16| true | 0 | # 17| false | 1 | Error: SHELLCHECK_WARNING (CWE-569): [#def33] /usr/share/podman/test/system/030-run.bats:50:34: warning[SC2090]: Quotes/backslashes in this variable will not be respected. # 48| # the rest were being silently ignored because of podman-remote # 49| # bug #4095, in which it slurps up stdin. # 50|-> is "$tests_run" "$(grep . <<<$tests | wc -l)" "Ran the full set of tests" # 51| } # 52| Error: SHELLCHECK_WARNING (CWE-563): [#def34] /usr/share/podman/test/system/030-run.bats:226:5: warning[SC2034]: i appears unused. Verify use (or export if used externally). # 224| run_podman run -d --name $cname --rmi $NONLOCAL_IMAGE /bin/true # 225| # 10 chances for the image to disappear # 226|-> for i in `seq 1 10`; do # 227| sleep 0.5 # 228| run_podman '?' image exists $NONLOCAL_IMAGE Error: SHELLCHECK_WARNING (CWE-571): [#def35] /usr/share/podman/test/system/030-run.bats:266:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 264| # 265| # Cross-check --conmon-pidfile against 'podman inspect' # 266|-> local conmon_pid_from_file=$(< $pidfile) # 267| run_podman inspect --format '{{.State.ConmonPid}}' $cid # 268| local conmon_pid_from_inspect="$output" Error: SHELLCHECK_WARNING (CWE-457): [#def36] /usr/share/podman/test/system/030-run.bats:344:69: warning[SC2154]: dir is referenced but not assigned. # 342| for keepid in "" ${keep}; do # 343| opts="$priv $user $keepid" # 344|-> run_podman run --rm $opts $IMAGE stat -c '%u:%g:%n' $dir /etc /usr # 345| remove_same_dev_warning # grumble # 346| is "${lines[0]}" "0:0:/etc" "run $opts /etc" Error: SHELLCHECK_WARNING (CWE-156): [#def37] /usr/share/podman/test/system/030-run.bats:506:35: warning[SC2046]: Quote this to prevent word splitting. # 504| --conmon-pidfile $pidfile $IMAGE echo $msg # 505| # 506|-> journalctl --output cat _PID=$(cat $pidfile) # 507| is "$output" "$msg" "check that journalctl output equals the container output" # 508| Error: SHELLCHECK_WARNING (CWE-571): [#def38] /usr/share/podman/test/system/030-run.bats:637:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 635| @test "podman run : look up correct image name" { # 636| # Create a 2nd tag for the local image. # 637|-> local newtag="localhost/r_$(safename)/i_$(safename)" # 638| run_podman tag $IMAGE $newtag # 639| Error: SHELLCHECK_WARNING (CWE-140): [#def39] /usr/share/podman/test/system/030-run.bats:689:33: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 687| run_podman inspect $IMAGE --format "{{json .RepoDigests}}" # 688| # ...so, strip off the prefix and get an array of sha strings # 689|-> declare -a expectedDigests=($(jq -r '.[]' <<<"$output" |\ # 690| sed -e "s;^${PODMAN_TEST_IMAGE_REGISTRY}/${PODMAN_TEST_IMAGE_USER}/${PODMAN_TEST_IMAGE_NAME}@;;")) # 691| Error: SHELLCHECK_WARNING (CWE-571): [#def40] /usr/share/podman/test/system/030-run.bats:883:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 881| # 882| # --layers=false needed to work around buildah#5674 parallel flake # 883|-> local iname=nomtab-$(safename) # 884| run_podman build -t $iname --layers=false $tmpdir # 885| run_podman run --rm $iname stat -c %N /etc/mtab Error: SHELLCHECK_WARNING (CWE-571): [#def41] /usr/share/podman/test/system/030-run.bats:1572:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1570| # bats test_tags=ci:parallel # 1571| @test "podman create container with conflicting name" { # 1572|-> local cname=c_$(safename) # 1573| local output_msg_ext="^Error: .*: the container name \"$cname\" is already in use by .* You have to remove that container to be able to reuse that name: that name is already in use by an external entity, or use --replace to instruct Podman to do so." # 1574| local output_msg="^Error: .*: the container name \"$cname\" is already in use by .* You have to remove that container to be able to reuse that name: that name is already in use, or use --replace to instruct Podman to do so." Error: SHELLCHECK_WARNING (CWE-398): [#def42] /usr/share/podman/test/system/035-logs.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Basic tests for podman logs Error: SHELLCHECK_WARNING (CWE-571): [#def43] /usr/share/podman/test/system/035-logs.bats:95:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 93| skip_if_remote "logs does not support multiple containers when run remotely" # 94| # 95|-> local events_backend=$(_additional_events_backend $driver) # 96| # 97| # Simple helper to make the container starts, below, easier to read Error: SHELLCHECK_WARNING (CWE-571): [#def44] /usr/share/podman/test/system/035-logs.bats:98:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 96| # 97| # Simple helper to make the container starts, below, easier to read # 98|-> local cname1="c-ltm-1-$(safename)" # 99| local cname2="c-ltm-2-$(safename)" # 100| local -a cid Error: SHELLCHECK_WARNING (CWE-571): [#def45] /usr/share/podman/test/system/035-logs.bats:99:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 97| # Simple helper to make the container starts, below, easier to read # 98| local cname1="c-ltm-1-$(safename)" # 99|-> local cname2="c-ltm-2-$(safename)" # 100| local -a cid # 101| doit() { Error: SHELLCHECK_WARNING (CWE-140): [#def46] /usr/share/podman/test/system/035-logs.bats:104:15: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 102| run_podman ${events_backend} run --log-driver=$driver -d \ # 103| --name "$1" $IMAGE sh -c "$2"; # 104|-> cid+=($(echo "${output:0:12}")) # 105| } # 106| Error: SHELLCHECK_WARNING (CWE-571): [#def47] /usr/share/podman/test/system/035-logs.bats:138:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 136| function _log_test_restarted() { # 137| local driver=$1 # 138|-> local events_backend=$(_additional_events_backend $driver) # 139| if [[ -n "${events_backend}" ]]; then # 140| skip_if_remote "remote does not support --events-backend" Error: SHELLCHECK_WARNING (CWE-571): [#def48] /usr/share/podman/test/system/035-logs.bats:288:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 286| contentB=$(random_string) # 287| contentC=$(random_string) # 288|-> local events_backend=$(_additional_events_backend $driver) # 289| # 290| if [[ -n "${events_backend}" ]]; then Error: SHELLCHECK_WARNING (CWE-571): [#def49] /usr/share/podman/test/system/035-logs.bats:321:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 319| cname="c-ltfs-$(safename)" # 320| content=$(random_string) # 321|-> local events_backend=$(_additional_events_backend $driver) # 322| # 323| if [[ -n "${events_backend}" ]]; then Error: SHELLCHECK_WARNING (CWE-571): [#def50] /usr/share/podman/test/system/035-logs.bats:368:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 366| cname="c-ltfu-$(safename)" # 367| content=$(random_string) # 368|-> local events_backend=$(_additional_events_backend $driver) # 369| # 370| if [[ -n "${events_backend}" ]]; then Error: SHELLCHECK_WARNING (CWE-457): [#def51] /usr/share/podman/test/system/040-ps.bats:24:57: warning[SC2154]: cname is referenced but not assigned. # 22| run_podman ps # 23| is "${lines[1]}" \ # 24|-> "${cid:0:12} \+$IMAGE \+sleep [0-9]\+ .*second.* $cname"\ # 25| "output from podman ps" # 26| Error: SHELLCHECK_WARNING (CWE-153): [#def52] /usr/share/podman/test/system/040-ps.bats:47:37: warning[SC2053]: Quote the right-hand side of == in [[ ]] to prevent glob matching. # 45| # 46| cid[stopped]=$output # 47|-> while [[ ${cid[stopped]:0:1} == ${cid[running]:0:1} ]]; do # 48| run_podman rm -f stopped # 49| run_podman run -d --name stopped $IMAGE true Error: SHELLCHECK_WARNING (CWE-153): [#def53] /usr/share/podman/test/system/040-ps.bats:55:36: warning[SC2053]: Quote the right-hand side of == in [[ ]] to prevent glob matching. # 53| # 54| cid[failed]=${cid[stopped]} # 55|-> while [[ ${cid[failed]:0:1} == ${cid[running]:0:1} ]] || [[ ${cid[failed]:0:1} == ${cid[stopped]:0:1} ]]; do # 56| run_podman rm -f failed # 57| run_podman run -d --name failed $IMAGE false Error: SHELLCHECK_WARNING (CWE-153): [#def54] /usr/share/podman/test/system/040-ps.bats:55:87: warning[SC2053]: Quote the right-hand side of == in [[ ]] to prevent glob matching. # 53| # 54| cid[failed]=${cid[stopped]} # 55|-> while [[ ${cid[failed]:0:1} == ${cid[running]:0:1} ]] || [[ ${cid[failed]:0:1} == ${cid[stopped]:0:1} ]]; do # 56| run_podman rm -f failed # 57| run_podman run -d --name failed $IMAGE false Error: SHELLCHECK_WARNING (CWE-398): [#def55] /usr/share/podman/test/system/040-ps.bats:205:5: warning[SC2178]: Variable was used as an array but is now assigned a string. # 203| is "${#lines[@]}" "2" "podman ps -a --external sees buildah containers" # 204| # 205|-> cid="${lines[1]:0:12}" # 206| # 207| # We can't rm it without -f, but podman should issue a helpful message Error: SHELLCHECK_WARNING (CWE-670): [#def56] /usr/share/podman/test/system/040-ps.bats:208:22: warning[SC2128]: Expanding an array without an index only gives the first element. # 206| # 207| # We can't rm it without -f, but podman should issue a helpful message # 208|-> run_podman 2 rm "$cid" # 209| is "$output" "Error: container .* is mounted and cannot be removed without using force: container state improper" "podman rm <buildah container> without -f" # 210| Error: SHELLCHECK_WARNING (CWE-670): [#def57] /usr/share/podman/test/system/040-ps.bats:212:28: warning[SC2128]: Expanding an array without an index only gives the first element. # 210| # 211| # With -f, we can remove it. # 212|-> run_podman rm -t 0 -f "$cid" # 213| # 214| run_podman ps --external Error: SHELLCHECK_WARNING (CWE-398): [#def58] /usr/share/podman/test/system/040-ps.bats:222:5: warning[SC2178]: Variable was used as an array but is now assigned a string. # 220| # 221| run_podman run -d --label mylabel=$rand_value $IMAGE sleep inf # 222|-> cid=$output # 223| is "$cid" "[0-9a-f]\{64\}$" # 224| Error: SHELLCHECK_WARNING (CWE-670): [#def59] /usr/share/podman/test/system/040-ps.bats:223:9: warning[SC2128]: Expanding an array without an index only gives the first element. # 221| run_podman run -d --label mylabel=$rand_value $IMAGE sleep inf # 222| cid=$output # 223|-> is "$cid" "[0-9a-f]\{64\}$" # 224| # 225| run_podman ps --format '{{ .Label "mylabel" }}' Error: SHELLCHECK_WARNING (CWE-670): [#def60] /usr/share/podman/test/system/040-ps.bats:228:27: warning[SC2128]: Expanding an array without an index only gives the first element. # 226| is "$output" "$rand_value" # 227| # 228|-> run_podman rm -t 0 -f $cid # 229| } # 230| Error: SHELLCHECK_WARNING (CWE-156): [#def61] /usr/share/podman/test/system/040-ps.bats:240:20: warning[SC2046]: Quote this to prevent word splitting. # 238| # 239| run_podman pod rm -t 0 -f test # 240|-> run_podman rmi $(pause_image) # 241| } # 242| Error: SHELLCHECK_WARNING (CWE-398): [#def62] /usr/share/podman/test/system/040-ps.bats:247:5: warning[SC2178]: Variable was used as an array but is now assigned a string. # 245| # 246| run_podman run -d --pod new:${rand_value} --label mylabel=$rand_value $IMAGE sleep inf # 247|-> cid=$output # 248| is "$cid" "[0-9a-f]\{64\}$" # 249| Error: SHELLCHECK_WARNING (CWE-670): [#def63] /usr/share/podman/test/system/040-ps.bats:248:9: warning[SC2128]: Expanding an array without an index only gives the first element. # 246| run_podman run -d --pod new:${rand_value} --label mylabel=$rand_value $IMAGE sleep inf # 247| cid=$output # 248|-> is "$cid" "[0-9a-f]\{64\}$" # 249| # 250| run_podman ps --format '{{ .PodName }}' Error: SHELLCHECK_WARNING (CWE-670): [#def64] /usr/share/podman/test/system/040-ps.bats:253:27: warning[SC2128]: Expanding an array without an index only gives the first element. # 251| is "$output" ".*$rand_value" # 252| # 253|-> run_podman rm -t 0 -f $cid # 254| run_podman pod rm -t 0 -f $rand_value # 255| run_podman rmi $(pause_image) Error: SHELLCHECK_WARNING (CWE-156): [#def65] /usr/share/podman/test/system/040-ps.bats:255:20: warning[SC2046]: Quote this to prevent word splitting. # 253| run_podman rm -t 0 -f $cid # 254| run_podman pod rm -t 0 -f $rand_value # 255|-> run_podman rmi $(pause_image) # 256| } # 257| Error: SHELLCHECK_WARNING (CWE-398): [#def66] /usr/share/podman/test/system/045-start.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # 3| load helpers Error: SHELLCHECK_WARNING (CWE-563): [#def67] /usr/share/podman/test/system/045-start.bats:51:5: warning[SC2034]: c2_id appears unused. Verify use (or export if used externally). # 49| c1_id="$output" # 50| run_podman create --name=$c2 --restart=on-failure $IMAGE /bin/true # 51|-> c2_id="$output" # 52| run_podman create --name=$c3 --restart=always $IMAGE /bin/true # 53| c3_id="$output" Error: SHELLCHECK_WARNING (CWE-398): [#def68] /usr/share/podman/test/system/050-stop.bats:262:11: warning[SC2010]: Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames. # 260| # 261| # Check the OCI runtime directory has removed. # 262|-> is "$(ls $OCIDir | grep $cid)" "" "The OCI runtime directory should have been removed" # 263| } # 264| # vim: filetype=sh Error: SHELLCHECK_WARNING (CWE-398): [#def69] /usr/share/podman/test/system/055-rm.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # tests for podman rm Error: SHELLCHECK_WARNING (CWE-398): [#def70] /usr/share/podman/test/system/055-rm.bats:78:11: warning[SC2010]: Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames. # 76| # 77| # Check the OCI runtime directory has removed. # 78|-> is "$(ls $OCIDir | grep $cid)" "" "The OCI runtime directory should have been removed" # 79| } # 80| Error: SHELLCHECK_WARNING (CWE-156): [#def71] /usr/share/podman/test/system/055-rm.bats:113:37: warning[SC2046]: Quote this to prevent word splitting. # 111| # bats test_tags=ci:parallel # 112| @test "podman container rm --force bogus" { # 113|-> run_podman 1 container rm bogus-$(safename) # 114| is "$output" "Error: no container with ID or name \"bogus-$(safename)\" found: no such container" "Should print error" # 115| run_podman container rm --force bogus-$(safename) Error: SHELLCHECK_WARNING (CWE-156): [#def72] /usr/share/podman/test/system/055-rm.bats:115:43: warning[SC2046]: Quote this to prevent word splitting. # 113| run_podman 1 container rm bogus-$(safename) # 114| is "$output" "Error: no container with ID or name \"bogus-$(safename)\" found: no such container" "Should print error" # 115|-> run_podman container rm --force bogus-$(safename) # 116| is "$output" "" "Should print no output" # 117| Error: SHELLCHECK_WARNING (CWE-156): [#def73] /usr/share/podman/test/system/055-rm.bats:118:38: warning[SC2046]: Quote this to prevent word splitting. # 116| is "$output" "" "Should print no output" # 117| # 118|-> run_podman create --name testctr-$(safename) $IMAGE # 119| run_podman container rm --force bogus-$(safename) testctr-$(safename) # 120| assert "$output" = "testctr-$(safename)" "should delete test" Error: SHELLCHECK_WARNING (CWE-156): [#def74] /usr/share/podman/test/system/055-rm.bats:119:43: warning[SC2046]: Quote this to prevent word splitting. # 117| # 118| run_podman create --name testctr-$(safename) $IMAGE # 119|-> run_podman container rm --force bogus-$(safename) testctr-$(safename) # 120| assert "$output" = "testctr-$(safename)" "should delete test" # 121| Error: SHELLCHECK_WARNING (CWE-156): [#def75] /usr/share/podman/test/system/055-rm.bats:119:63: warning[SC2046]: Quote this to prevent word splitting. # 117| # 118| run_podman create --name testctr-$(safename) $IMAGE # 119|-> run_podman container rm --force bogus-$(safename) testctr-$(safename) # 120| assert "$output" = "testctr-$(safename)" "should delete test" # 121| Error: SHELLCHECK_WARNING (CWE-571): [#def76] /usr/share/podman/test/system/055-rm.bats:143:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 141| # bats test_tags=ci:parallel # 142| @test "podman container rm doesn't affect stopping containers" { # 143|-> local cname=c-$(safename) # 144| __run_healthcheck_container $cname # 145| local cid=$output Error: SHELLCHECK_WARNING (CWE-571): [#def77] /usr/share/podman/test/system/055-rm.bats:181:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 179| # bats test_tags=ci:parallel # 180| @test "podman container rm --force doesn't leave running processes" { # 181|-> local cname=c-$(safename) # 182| __run_healthcheck_container $cname # 183| local cid=$output Error: SHELLCHECK_WARNING (CWE-563): [#def78] /usr/share/podman/test/system/055-rm.bats:189:5: warning[SC2034]: i appears unused. Verify use (or export if used externally). # 187| local pid=$output # 188| # 189|-> for i in {1..10}; do # 190| run_podman inspect $cname --format '{{.State.Status}}' # 191| if [ "$output" = "stopping" ]; then Error: SHELLCHECK_WARNING (CWE-156): [#def79] /usr/share/podman/test/system/060-mount.bats:24:8: warning[SC2046]: Quote this to prevent word splitting. # 22| test -d $mount_path # 23| test -e "$mount_path/$f_path" # 24|-> is $(< "$mount_path/$f_path") "$f_content" "contents of file, as read via fs" # 25| # 26| # Make sure that 'podman mount' (no args) returns the expected path and CID Error: SHELLCHECK_WARNING (CWE-156): [#def80] /usr/share/podman/test/system/060-mount.bats:73:8: warning[SC2046]: Quote this to prevent word splitting. # 71| testimage_file="/home/podman/testimage-id" # 72| test -e "$mount_path$testimage_file" # 73|-> is $(< "$mount_path$testimage_file") "$PODMAN_TEST_IMAGE_TAG" \ # 74| "Contents of $testimage_file in image" # 75| Error: SHELLCHECK_WARNING (CWE-571): [#def81] /usr/share/podman/test/system/060-mount.bats:125:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 123| # 124| # For parallel safety: create a temporary image to use for mounts # 125|-> local tmpctr="c-$(safename)" # 126| local iname="i-$(safename)" # 127| run_podman run --name $tmpctr $IMAGE true Error: SHELLCHECK_WARNING (CWE-571): [#def82] /usr/share/podman/test/system/060-mount.bats:126:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 124| # For parallel safety: create a temporary image to use for mounts # 125| local tmpctr="c-$(safename)" # 126|-> local iname="i-$(safename)" # 127| run_podman run --name $tmpctr $IMAGE true # 128| run_podman commit -q $tmpctr $iname Error: SHELLCHECK_WARNING (CWE-156): [#def83] /usr/share/podman/test/system/060-mount.bats:288:44: warning[SC2046]: Quote this to prevent word splitting. # 286| # 287| # Create a container that podman does not know about # 288|-> external_cname=$(buildah from --name b-$(safename) $IMAGE) # 289| # 290| run_podman mount $external_cname Error: SHELLCHECK_WARNING (CWE-156): [#def84] /usr/share/podman/test/system/060-mount.bats:301:8: warning[SC2046]: Quote this to prevent word splitting. # 299| # Test image will always have this file, and will always have the tag # 300| test -d $mount_path # 301|-> is $(< "$mount_path/home/podman/testimage-id") "$PODMAN_TEST_IMAGE_TAG" \ # 302| "Contents of well-known file in image" # 303| Error: SHELLCHECK_WARNING (CWE-156): [#def85] /usr/share/podman/test/system/060-mount.bats:402:10: warning[SC2046]: Quote this to prevent word splitting. # 400| # absolute (abs) symlinks. # 401| # 402|-> if [ $(podman_runtime) != "crun" ]; then # 403| # Requires crun >= 1.11.0 # 404| skip "only crun supports the no-dereference (copy-symlink) mount option" Error: SHELLCHECK_WARNING (CWE-149): [#def86] /usr/share/podman/test/system/060-mount.bats:547:86: warning[SC2140]: Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A\"B\"C"? # 545| # 546| run_podman $exit_code run \ # 547|-> --mount type=$mount_type,src="$sourcedir$mount_source",dst="$mount_dest$mount_opts" \ # 548| --rm --privileged $img sh -c "stat -c '%N' $containerpath; cat $containerpath" # 549| assert "${lines[0]}" = "$expect_stat" "$description -- stat $containerpath" Error: SHELLCHECK_WARNING (CWE-571): [#def87] /usr/share/podman/test/system/060-mount.bats:561:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 559| local workdir=$PODMAN_TMPDIR/test-restart # 560| mkdir $workdir # 561|-> local datafile="data-$(random_string 5)" # 562| local datafile_contents="What we expect to see, $(random_string 20)" # 563| echo "$datafile_contents" > $workdir/$datafile Error: SHELLCHECK_WARNING (CWE-571): [#def88] /usr/share/podman/test/system/060-mount.bats:562:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 560| mkdir $workdir # 561| local datafile="data-$(random_string 5)" # 562|-> local datafile_contents="What we expect to see, $(random_string 20)" # 563| echo "$datafile_contents" > $workdir/$datafile # 564| ln -s $datafile $workdir/link Error: SHELLCHECK_WARNING (CWE-398): [#def89] /usr/share/podman/test/system/065-cp.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Tests for 'podman cp' Error: SHELLCHECK_WARNING (CWE-140): [#def90] /usr/share/podman/test/system/065-cp.bats:17:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 15| mkdir -p $srcdir # 16| local -a randomcontent=( # 17|-> random-0-$(random_string 10) # 18| random-1-$(random_string 15) # 19| random-2-$(random_string 20) Error: SHELLCHECK_WARNING (CWE-140): [#def91] /usr/share/podman/test/system/065-cp.bats:18:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 16| local -a randomcontent=( # 17| random-0-$(random_string 10) # 18|-> random-1-$(random_string 15) # 19| random-2-$(random_string 20) # 20| ) Error: SHELLCHECK_WARNING (CWE-140): [#def92] /usr/share/podman/test/system/065-cp.bats:19:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 17| random-0-$(random_string 10) # 18| random-1-$(random_string 15) # 19|-> random-2-$(random_string 20) # 20| ) # 21| Error: SHELLCHECK_WARNING (CWE-571): [#def93] /usr/share/podman/test/system/065-cp.bats:28:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 26| echo "${randomcontent[2]}" > $srcdir/subdir/dotfile. # 27| # 28|-> local destrunning="c-destrun-$(safename)" # 29| run_podman run -d --name $destrunning --workdir=/srv $IMAGE sh -c "mkdir /srv/subdir; echo READY; sleep infinity" # 30| wait_for_ready $destrunning Error: SHELLCHECK_WARNING (CWE-571): [#def94] /usr/share/podman/test/system/065-cp.bats:83:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 81| # CREATED container # 82| while read id dest dest_fullname description; do # 83|-> local destcreated="c-destcreated-$(safename)" # 84| run_podman create --name $destcreated --workdir=/srv $cpimage sleep infinity # 85| run_podman cp $srcdir/hostfile$id $destcreated:$dest Error: SHELLCHECK_WARNING (CWE-571): [#def95] /usr/share/podman/test/system/065-cp.bats:103:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 101| # 102| # RUNNING container # 103|-> local destrunning="c-destrun-$(safename)" # 104| run_podman run -d --mount type=tmpfs,dst=/tmp --name $destrunning $IMAGE sleep infinity # 105| run_podman cp $srcdir/file $destrunning:/tmp Error: SHELLCHECK_WARNING (CWE-571): [#def96] /usr/share/podman/test/system/065-cp.bats:111:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 109| # 110| # CREATED container (with copy up) # 111|-> local destcreated=cdestcreated$(safename) # 112| run_podman create --mount type=tmpfs,dst=/tmp --name $destcreated $IMAGE sleep infinity # 113| run_podman cp $srcdir/file $destcreated:/tmp Error: SHELLCHECK_WARNING (CWE-571): [#def97] /usr/share/podman/test/system/065-cp.bats:130:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 128| keepid="--userns=keep-id" # 129| is_rootless || keepid="" # 130|-> local destrunning="c-destrun-$(safename)" # 131| run_podman run --user=$userid ${keepid} -d --name $destrunning $IMAGE sleep infinity # 132| run_podman cp $srcdir/hostfile $destrunning:/tmp/hostfile Error: SHELLCHECK_WARNING (CWE-571): [#def98] /usr/share/podman/test/system/065-cp.bats:151:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 149| keepid="--userns=keep-id" # 150| is_rootless || keepid="" # 151|-> local destrunning="c-destrun-$(safename)" # 152| run_podman run --user=$userid ${keepid} -d --name $destrunning $IMAGE sleep infinity # 153| run_podman cp -a=false - $destrunning:/tmp/ < "${tmpdir}/a.tar" Error: SHELLCHECK_WARNING (CWE-571): [#def99] /usr/share/podman/test/system/065-cp.bats:168:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 166| touch $srcdir/hostfile # 167| # 168|-> local cpcontainer="cpctr-$(safename)" # 169| run_podman run --pid=host -d --name $cpcontainer $IMAGE sleep infinity # 170| run_podman cp $srcdir/hostfile $cpcontainer:/tmp/hostfile Error: SHELLCHECK_WARNING (CWE-140): [#def100] /usr/share/podman/test/system/065-cp.bats:181:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 179| # Create 3 files with random content in the container. # 180| local -a randomcontent=( # 181|-> random-0-$(random_string 10) # 182| random-1-$(random_string 15) # 183| random-2-$(random_string 20) Error: SHELLCHECK_WARNING (CWE-140): [#def101] /usr/share/podman/test/system/065-cp.bats:182:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 180| local -a randomcontent=( # 181| random-0-$(random_string 10) # 182|-> random-1-$(random_string 15) # 183| random-2-$(random_string 20) # 184| ) Error: SHELLCHECK_WARNING (CWE-140): [#def102] /usr/share/podman/test/system/065-cp.bats:183:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 181| random-0-$(random_string 10) # 182| random-1-$(random_string 15) # 183|-> random-2-$(random_string 20) # 184| ) # 185| local srcrunning="c-srcrun-$(safename)" Error: SHELLCHECK_WARNING (CWE-571): [#def103] /usr/share/podman/test/system/065-cp.bats:185:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 183| random-2-$(random_string 20) # 184| ) # 185|-> local srcrunning="c-srcrun-$(safename)" # 186| run_podman run -d --name $srcrunning --workdir=/srv $IMAGE sh -c "mkdir /srv/subdir; # 187| echo ${randomcontent[0]} > /tmp/containerfile; Error: SHELLCHECK_WARNING (CWE-571): [#def104] /usr/share/podman/test/system/065-cp.bats:225:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 223| # 224| # Created container # 225|-> local srccreated="c-src-crt-$(safename)" # 226| run_podman create --name $srccreated --workdir=/srv $cpimage # 227| while read id src dest dest_fullname description; do Error: SHELLCHECK_WARNING (CWE-140): [#def105] /usr/share/podman/test/system/065-cp.bats:244:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 242| # Create 3 files with random content in the container. # 243| local -a randomcontent=( # 244|-> random-0-$(random_string 10) # 245| random-1-$(random_string 15) # 246| random-2-$(random_string 20) Error: SHELLCHECK_WARNING (CWE-140): [#def106] /usr/share/podman/test/system/065-cp.bats:245:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 243| local -a randomcontent=( # 244| random-0-$(random_string 10) # 245|-> random-1-$(random_string 15) # 246| random-2-$(random_string 20) # 247| ) Error: SHELLCHECK_WARNING (CWE-140): [#def107] /usr/share/podman/test/system/065-cp.bats:246:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 244| random-0-$(random_string 10) # 245| random-1-$(random_string 15) # 246|-> random-2-$(random_string 20) # 247| ) # 248| Error: SHELLCHECK_WARNING (CWE-571): [#def108] /usr/share/podman/test/system/065-cp.bats:249:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 247| ) # 248| # 249|-> local srcrunning="c-src-run-$(safename)" # 250| run_podman run -d --name $srcrunning --workdir=/srv $IMAGE sh -c "mkdir /srv/subdir; # 251| echo ${randomcontent[0]} > /tmp/containerfile; Error: SHELLCHECK_WARNING (CWE-140): [#def109] /usr/share/podman/test/system/065-cp.bats:287:26: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. # 285| run_podman run -d $IMAGE sleep infinity # 286| destcontainer="$output" # 287|-> destcontainers+=($destcontainer) # 288| run_podman cp $srcrunning:$src $destcontainer:"$dest" # 289| run_podman exec $destcontainer cat "$dest_fullname" Error: SHELLCHECK_WARNING (CWE-140): [#def110] /usr/share/podman/test/system/065-cp.bats:295:26: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. # 293| run_podman create $IMAGE sleep infinity # 294| destcontainer="$output" # 295|-> destcontainers+=($destcontainer) # 296| run_podman cp $srcrunning:$src $destcontainer:"$dest" # 297| run_podman start $destcontainer Error: SHELLCHECK_WARNING (CWE-88): [#def111] /usr/share/podman/test/system/065-cp.bats:301:39: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 299| is "$output" "${randomcontent[$id]}" "$description (cp ctr:$src to $dest - CREATED)" # 300| done < <(parse_table "$tests") # 301|-> run_podman rm -t 0 -f $srcrunning ${destcontainers[@]} # 302| # 303| # From CREATED container Error: SHELLCHECK_WARNING (CWE-571): [#def112] /usr/share/podman/test/system/065-cp.bats:305:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 303| # From CREATED container # 304| destcontainers=() # 305|-> local srccreated="c-src-crt-$(safename)" # 306| run_podman create --name $srccreated --workdir=/srv $cpimage # 307| while read id src dest dest_fullname description; do Error: SHELLCHECK_WARNING (CWE-140): [#def113] /usr/share/podman/test/system/065-cp.bats:316:26: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. # 314| run_podman run -d $IMAGE sleep infinity # 315| destcontainer="$output" # 316|-> destcontainers+=($destcontainer) # 317| run_podman cp $srccreated:$src $destcontainer:"$dest" # 318| run_podman exec $destcontainer cat "$dest_fullname" Error: SHELLCHECK_WARNING (CWE-140): [#def114] /usr/share/podman/test/system/065-cp.bats:323:26: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. # 321| run_podman create $IMAGE sleep infinity # 322| destcontainer="$output" # 323|-> destcontainers+=($destcontainer) # 324| run_podman cp $srccreated:$src $destcontainer:"$dest" # 325| run_podman start $destcontainer Error: SHELLCHECK_WARNING (CWE-88): [#def115] /usr/share/podman/test/system/065-cp.bats:329:39: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 327| is "$output" "${randomcontent[$id]}" "$description (cp ctr:$src to $dest)" # 328| done < <(parse_table "$tests") # 329|-> run_podman rm -t 0 -f $srccreated ${destcontainers[@]} # 330| run_podman rmi -f $cpimage # 331| } Error: SHELLCHECK_WARNING (CWE-140): [#def116] /usr/share/podman/test/system/065-cp.bats:337:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 335| mkdir -p $srcdir/dir/sub # 336| local -a randomcontent=( # 337|-> random-0-$(random_string 10) # 338| random-1-$(random_string 15) # 339| ) Error: SHELLCHECK_WARNING (CWE-140): [#def117] /usr/share/podman/test/system/065-cp.bats:338:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 336| local -a randomcontent=( # 337| random-0-$(random_string 10) # 338|-> random-1-$(random_string 15) # 339| ) # 340| echo "${randomcontent[0]}" > $srcdir/dir/sub/hostfile0 Error: SHELLCHECK_WARNING (CWE-571): [#def118] /usr/share/podman/test/system/065-cp.bats:348:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 346| cp -r $srcdir/dir/* $srcdir/dir. # 347| # 348|-> local destrunning="c-destrun-$(safename)" # 349| run_podman run -d --name $destrunning --workdir=/srv $IMAGE sh -c "mkdir /srv/subdir; echo READY;sleep infinity" # 350| wait_for_ready $destrunning Error: SHELLCHECK_WARNING (CWE-571): [#def119] /usr/share/podman/test/system/065-cp.bats:380:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 378| # 379| # CREATED container # 380|-> local destcreated="c-dest-created-$(safename)" # 381| run_podman create --name $destcreated --workdir=/srv $cpimage sleep infinity # 382| while read src dest dest_fullname description; do Error: SHELLCHECK_WARNING (CWE-571): [#def120] /usr/share/podman/test/system/065-cp.bats:396:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 394| run_podman rm -t 0 -f $destcreated # 395| # 396|-> local destnotdir="c-destnotdir-$(safename)" # 397| run_podman create --name $destnotdir --workdir=/srv $cpimage sleep infinity # 398| run_podman 125 cp $srcdir $destnotdir:/etc/os-release Error: SHELLCHECK_WARNING (CWE-140): [#def121] /usr/share/podman/test/system/065-cp.bats:411:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 409| # Create 2 files with random content in the container. # 410| local -a randomcontent=( # 411|-> random-0-$(random_string 10) # 412| random-1-$(random_string 15) # 413| ) Error: SHELLCHECK_WARNING (CWE-140): [#def122] /usr/share/podman/test/system/065-cp.bats:412:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 410| local -a randomcontent=( # 411| random-0-$(random_string 10) # 412|-> random-1-$(random_string 15) # 413| ) # 414| Error: SHELLCHECK_WARNING (CWE-571): [#def123] /usr/share/podman/test/system/065-cp.bats:415:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 413| ) # 414| # 415|-> local srcrunning="c-src-run-$(safename)" # 416| run_podman run -d --name $srcrunning --workdir=/srv $IMAGE sh -c "mkdir /srv/subdir; # 417| echo ${randomcontent[0]} > /srv/subdir/containerfile0; \ Error: SHELLCHECK_WARNING (CWE-571): [#def124] /usr/share/podman/test/system/065-cp.bats:457:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 455| # 456| # CREATED container # 457|-> local srccreated="c-src-crt-$(safename)" # 458| run_podman create --name $srccreated --workdir=/srv $cpimage # 459| while read src dest dest_fullname description; do Error: SHELLCHECK_WARNING (CWE-140): [#def125] /usr/share/podman/test/system/065-cp.bats:483:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 481| # Create 2 files with random content in the container. # 482| local -a randomcontent=( # 483|-> random-0-$(random_string 10) # 484| random-1-$(random_string 15) # 485| ) Error: SHELLCHECK_WARNING (CWE-140): [#def126] /usr/share/podman/test/system/065-cp.bats:484:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 482| local -a randomcontent=( # 483| random-0-$(random_string 10) # 484|-> random-1-$(random_string 15) # 485| ) # 486| Error: SHELLCHECK_WARNING (CWE-571): [#def127] /usr/share/podman/test/system/065-cp.bats:487:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 485| ) # 486| # 487|-> local srcrunning="c-src-run-$(safename)" # 488| run_podman run -d --name $srcrunning --workdir=/srv $IMAGE sh -c "mkdir /srv/subdir; # 489| echo ${randomcontent[0]} > /srv/subdir/containerfile0; \ Error: SHELLCHECK_WARNING (CWE-140): [#def128] /usr/share/podman/test/system/065-cp.bats:523:26: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. # 521| run_podman run -d $IMAGE sleep infinity # 522| destcontainer="$output" # 523|-> destcontainers+=($destcontainer) # 524| run_podman cp $srcrunning:$src $destcontainer:"$dest" # 525| run_podman exec $destcontainer cat "$dest_fullname/containerfile0" "$dest_fullname/containerfile1" Error: SHELLCHECK_WARNING (CWE-140): [#def129] /usr/share/podman/test/system/065-cp.bats:531:26: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. # 529| run_podman create $IMAGE sleep infinity # 530| destcontainer="$output" # 531|-> destcontainers+=($destcontainer) # 532| run_podman cp $srcrunning:$src $destcontainer:"$dest" # 533| run_podman start $destcontainer Error: SHELLCHECK_WARNING (CWE-88): [#def130] /usr/share/podman/test/system/065-cp.bats:537:39: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 535| is "$(echo $output)" "${randomcontent[*]}" "$description - from RUNNING to CREATED/STARTED" # 536| done < <(parse_table "$tests") # 537|-> run_podman rm -t 0 -f $srcrunning ${destcontainers[@]} # 538| # 539| # From CREATED container Error: SHELLCHECK_WARNING (CWE-571): [#def131] /usr/share/podman/test/system/065-cp.bats:541:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 539| # From CREATED container # 540| destcontainers=() # 541|-> local srccreated="c-src-crt-$(safename)" # 542| run_podman create --name $srccreated --workdir=/srv $cpimage # 543| while read src dest dest_fullname description; do Error: SHELLCHECK_WARNING (CWE-140): [#def132] /usr/share/podman/test/system/065-cp.bats:551:26: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. # 549| run_podman run -d $IMAGE sleep infinity # 550| destcontainer="$output" # 551|-> destcontainers+=($destcontainer) # 552| run_podman cp $srccreated:$src $destcontainer:"$dest" # 553| run_podman exec $destcontainer cat "$dest_fullname/containerfile0" "$dest_fullname/containerfile1" Error: SHELLCHECK_WARNING (CWE-140): [#def133] /usr/share/podman/test/system/065-cp.bats:559:26: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. # 557| run_podman create $IMAGE sleep infinity # 558| destcontainer="$output" # 559|-> destcontainers+=($destcontainer) # 560| run_podman start $destcontainer # 561| run_podman cp $srccreated:$src $destcontainer:"$dest" Error: SHELLCHECK_WARNING (CWE-88): [#def134] /usr/share/podman/test/system/065-cp.bats:566:39: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 564| done < <(parse_table "$tests") # 565| # 566|-> run_podman rm -t 0 -f $srccreated ${destcontainers[@]} # 567| run_podman rmi -f $cpimage # 568| } Error: SHELLCHECK_WARNING (CWE-140): [#def135] /usr/share/podman/test/system/065-cp.bats:576:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 574| # Create 3 files with random content in the container. # 575| local -a randomcontent=( # 576|-> random-0-$(random_string 10) # 577| random-1-$(random_string 15) # 578| ) Error: SHELLCHECK_WARNING (CWE-140): [#def136] /usr/share/podman/test/system/065-cp.bats:577:18: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # 575| local -a randomcontent=( # 576| random-0-$(random_string 10) # 577|-> random-1-$(random_string 15) # 578| ) # 579| Error: SHELLCHECK_WARNING (CWE-571): [#def137] /usr/share/podman/test/system/065-cp.bats:580:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 578| ) # 579| # 580|-> local srcrunning="c-src-run-$(safename)" # 581| run_podman run -d --name $srcrunning $IMAGE sh -c "echo ${randomcontent[0]} > /tmp/containerfile0; \ # 582| echo ${randomcontent[1]} > /tmp/containerfile1; \ Error: SHELLCHECK_WARNING (CWE-571): [#def138] /usr/share/podman/test/system/065-cp.bats:604:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 602| # 603| # CREATED container # 604|-> local srccreated="c-src-crt-$(safename)" # 605| run_podman create --name $srccreated $cpimage # 606| run_podman cp $srccreated:/tmp/sub/weirdlink $destdir/dest Error: SHELLCHECK_WARNING (CWE-571): [#def139] /usr/share/podman/test/system/065-cp.bats:635:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 633| # This test is extra tricky, as volume2 is mounted into a sub-directory of # 634| # volume1. Podman must copy the file into volume2 and not volume1. # 635|-> local cpcontainer="c-cp_$(safename)" # 636| run_podman create --name $cpcontainer -v $volume1:/tmp/volume -v $volume2:/tmp/volume/sub-volume $IMAGE # 637| Error: SHELLCHECK_WARNING (CWE-571): [#def140] /usr/share/podman/test/system/065-cp.bats:660:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 658| # 659| # Make it a bit more complex and put the mount on a volume. # 660|-> local cpcontainer="c-cp-$(safename)" # 661| run_podman create --name $cpcontainer -v $volume:/tmp/volume -v $mountdir:/tmp/volume/mount $IMAGE # 662| Error: SHELLCHECK_WARNING (CWE-571): [#def141] /usr/share/podman/test/system/065-cp.bats:685:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 683| rand_content2=$(random_string 50) # 684| # 685|-> local cpcontainer="c-cp-$(safename)" # 686| run_podman run --name $cpcontainer $IMAGE sh -c \ # 687| "echo $rand_content1 >/tmp/$rand_filename1; Error: SHELLCHECK_WARNING (CWE-571): [#def142] /usr/share/podman/test/system/065-cp.bats:705:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 703| echo "this file is on the host" >$srcdir/hostfile # 704| # 705|-> local cpcontainer="c-cp-$(safename)" # 706| run_podman run --name $cpcontainer $IMAGE \ # 707| sh -c "ln -s $srcdir/hostfile /tmp/badlink" Error: SHELLCHECK_WARNING (CWE-571): [#def143] /usr/share/podman/test/system/065-cp.bats:733:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 731| echo "This file is on the host" > $srcdir/hostfile # 732| # 733|-> local cpcontainer="c-cp-$(safename)" # 734| run_podman run --name $cpcontainer $IMAGE \ # 735| sh -c "ln -s $srcdir/hostfile file1;ln -s file\* copyme" Error: SHELLCHECK_WARNING (CWE-571): [#def144] /usr/share/podman/test/system/065-cp.bats:754:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 752| echo "This file lives on the host" > $srcdir/hostfile # 753| # 754|-> local cpcontainer="c-cp-$(safename)" # 755| run_podman run --name $cpcontainer $IMAGE \ # 756| sh -c "ln -s $srcdir/hostfile /tmp/\*" Error: SHELLCHECK_WARNING (CWE-571): [#def145] /usr/share/podman/test/system/065-cp.bats:788:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 786| # Create tmp subdirectories in container, most with an invalid 'x' symlink # 787| # Keep container running so we can exec into it. # 788|-> local cpcontainer="c-cp-$(safename)" # 789| run_podman run -d --name $cpcontainer $IMAGE \ # 790| sh -c "mkdir /tmp/d1;ln -s /tmp/nonesuch1 /tmp/d1/x; Error: SHELLCHECK_WARNING (CWE-571): [#def146] /usr/share/podman/test/system/065-cp.bats:843:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 841| # 842| # Create that directory in the container, and keep container running # 843|-> local cpcontainer="c-cp-$(safename)" # 844| run_podman run -d --name $cpcontainer $IMAGE sh -c \ # 845| "mkdir -p $graphroot; echo READY; top" Error: SHELLCHECK_WARNING (CWE-571): [#def147] /usr/share/podman/test/system/065-cp.bats:876:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 874| tar -zvcf $tar_file $srcdir # 875| # 876|-> local cpcontainer="c-cp-$(safename)" # 877| run_podman run -d --name $cpcontainer $IMAGE sleep infinity # 878| Error: SHELLCHECK_WARNING (CWE-571): [#def148] /usr/share/podman/test/system/065-cp.bats:917:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 915| rand_content=$(random_string 50) # 916| # 917|-> local cpcontainer="c-cp-$(safename)" # 918| run_podman run -d --name $cpcontainer $IMAGE sleep infinity # 919| Error: SHELLCHECK_WARNING (CWE-571): [#def149] /usr/share/podman/test/system/065-cp.bats:959:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 957| rand_content_dir=$(random_string 50) # 958| # 959|-> local ctrfile="c-f-$(safename)" # 960| local ctrdir="c-d-$(safename)" # 961| run_podman run -d --name $ctrfile $IMAGE sh -c "echo '$rand_content_file' > /tmp/foo; echo READY; sleep infinity" Error: SHELLCHECK_WARNING (CWE-571): [#def150] /usr/share/podman/test/system/065-cp.bats:960:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 958| # 959| local ctrfile="c-f-$(safename)" # 960|-> local ctrdir="c-d-$(safename)" # 961| run_podman run -d --name $ctrfile $IMAGE sh -c "echo '$rand_content_file' > /tmp/foo; echo READY; sleep infinity" # 962| run_podman run -d --name $ctrdir $IMAGE sh -c "mkdir /tmp/foo; echo '$rand_content_dir' > /tmp/foo/file.txt; echo READY; sleep infinity" Error: SHELLCHECK_WARNING (CWE-571): [#def151] /usr/share/podman/test/system/065-cp.bats:997:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 995| rand_content_dir=$(random_string 50) # 996| # 997|-> local ctrfile="c-f-$(safename)" # 998| local ctrdir="c-d-$(safename)" # 999| run_podman run -d --name $ctrfile $IMAGE sh -c "echo '$rand_content_file' > /tmp/foo; echo READY; sleep infinity" Error: SHELLCHECK_WARNING (CWE-571): [#def152] /usr/share/podman/test/system/065-cp.bats:998:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 996| # 997| local ctrfile="c-f-$(safename)" # 998|-> local ctrdir="c-d-$(safename)" # 999| run_podman run -d --name $ctrfile $IMAGE sh -c "echo '$rand_content_file' > /tmp/foo; echo READY; sleep infinity" # 1000| run_podman run -d --name $ctrdir $IMAGE sh -c "mkdir /tmp/foo; echo '$rand_content_dir' > /tmp/foo/file.txt; echo READY; sleep infinity" Error: SHELLCHECK_WARNING (CWE-571): [#def153] /usr/share/podman/test/system/065-cp.bats:1033:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1031| rand_content_dir=$(random_string 50) # 1032| # 1033|-> local ctrfile="c-f-$(safename)" # 1034| local ctrdir="c-d-$(safename)" # 1035| run_podman run -d --name $ctrdir $IMAGE sh -c "mkdir /tmp/foo; echo READY; sleep infinity" Error: SHELLCHECK_WARNING (CWE-571): [#def154] /usr/share/podman/test/system/065-cp.bats:1034:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1032| # 1033| local ctrfile="c-f-$(safename)" # 1034|-> local ctrdir="c-d-$(safename)" # 1035| run_podman run -d --name $ctrdir $IMAGE sh -c "mkdir /tmp/foo; echo READY; sleep infinity" # 1036| run_podman run -d --name $ctrfile $IMAGE sh -c "touch /tmp/foo; echo READY; sleep infinity" Error: SHELLCHECK_WARNING (CWE-571): [#def155] /usr/share/podman/test/system/065-cp.bats:1072:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1070| touch $srcdir/test1./file1 $srcdir/test2/file2 # 1071| # 1072|-> local cname="c-$(safename)" # 1073| run_podman run -d --name=$cname --rm $IMAGE sleep infinity # 1074| run_podman cp $srcdir/test1. $cname:/tmp/foo Error: SHELLCHECK_WARNING (CWE-571): [#def156] /usr/share/podman/test/system/065-cp.bats:1085:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1083| mkdir -p $dstdir # 1084| # 1085|-> local cname="c-$(safename)" # 1086| run_podman run -d --name=$cname --rm $IMAGE sh -c "mkdir -p /foo/test1. /foo/test2; touch /foo/test1./file1 /foo/test2/file2; echo READY;sleep infinity" # 1087| wait_for_ready $cname Error: SHELLCHECK_WARNING (CWE-571): [#def157] /usr/share/podman/test/system/065-cp.bats:1097:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1095| # 1096| @test "podman cp - dot notation - container to container" { # 1097|-> local ctrsrc="c-src-$(safename)" # 1098| run_podman run -d --name=$ctrsrc --rm $IMAGE sh -c "mkdir -p /foo/test1. /foo/test2; touch /foo/test1./file1 /foo/test2/file2; echo READY;sleep infinity" # 1099| wait_for_ready $ctrsrc Error: SHELLCHECK_WARNING (CWE-571): [#def158] /usr/share/podman/test/system/065-cp.bats:1101:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1099| wait_for_ready $ctrsrc # 1100| # 1101|-> local ctrdest="c-test-$(safename)" # 1102| run_podman run -d --name=$ctrdest --rm $IMAGE sleep infinity # 1103| run_podman cp $ctrsrc:/foo/test1. $ctrdest:/foo Error: SHELLCHECK_WARNING (CWE-571): [#def159] /usr/share/podman/test/system/070-build.bats:255:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 253| EOF # 254| # 255|-> local imgbase="b-$(safename)" # 256| local count=10 # 257| for i in $(seq --format '%02g' 1 $count); do Error: SHELLCHECK_WARNING (CWE-571): [#def160] /usr/share/podman/test/system/070-build.bats:335:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 333| # 334| # For --dns-search: a domain that is unlikely to exist # 335|-> local nosuchdomain=nx$(random_string 10).net # 336| # 337| # Command to run on container startup with no args Error: SHELLCHECK_WARNING (CWE-571): [#def161] /usr/share/podman/test/system/070-build.bats:358:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 356| # 357| # Build args: one explicit (foo=bar), one implicit (foo) # 358|-> local arg_implicit_value=implicit_$(random_string 15) # 359| local arg_explicit_value=explicit_$(random_string 15) # 360| Error: SHELLCHECK_WARNING (CWE-571): [#def162] /usr/share/podman/test/system/070-build.bats:359:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 357| # Build args: one explicit (foo=bar), one implicit (foo) # 358| local arg_implicit_value=implicit_$(random_string 15) # 359|-> local arg_explicit_value=explicit_$(random_string 15) # 360| # 361| # NOTE: it's important to not create the workdir. Error: SHELLCHECK_WARNING (CWE-571): [#def163] /usr/share/podman/test/system/070-build.bats:567:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 565| # 566| @test "podman build - COPY with ignore" { # 567|-> local tmpdir=$PODMAN_TMPDIR/build-test-$(random_string 10) # 568| mkdir -p $tmpdir/subdir{1,2} # 569| Error: SHELLCHECK_WARNING (CWE-571): [#def164] /usr/share/podman/test/system/070-build.bats:595:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 593| # 594| # Directory that doesn't exist in the image; COPY should create it # 595|-> local newdir=/newdir-$(random_string 12) # 596| cat >$tmpdir/Containerfile <<EOF # 597| FROM $IMAGE Error: SHELLCHECK_WARNING (CWE-88): [#def165] /usr/share/podman/test/system/070-build.bats:636:18: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 634| # takes a second or so, and we are mindful of each second. # 635| run_podman run --rm $imgname find $newdir -type f # 636|-> for f in ${files[@]}; do # 637| if [[ $f =~ ^- ]]; then # 638| f=${f##-} Error: SHELLCHECK_WARNING (CWE-571): [#def166] /usr/share/podman/test/system/070-build.bats:656:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 654| # the Containerfile/Dockerfile in the context dir are used # 655| @test "podman build with ignore '*'" { # 656|-> local tmpdir=$PODMAN_TMPDIR/build-test-$(random_string 10) # 657| mkdir -p $tmpdir # 658| Error: SHELLCHECK_WARNING (CWE-571): [#def167] /usr/share/podman/test/system/070-build.bats:696:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 694| # Regression test for #20259 # 695| @test "podman build with ignore '*' and containerfile outside of build context" { # 696|-> local tmpdir=$PODMAN_TMPDIR/build-test-$(random_string 10) # 697| mkdir -p $tmpdir # 698| mkdir -p $tmpdir/context Error: SHELLCHECK_WARNING (CWE-571): [#def168] /usr/share/podman/test/system/070-build.bats:908:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 906| # 907| # First, confirm that --pull-never is a NOP if image exists locally # 908|-> local random_string=$(random_string 15) # 909| # 910| cat >$tmpdir/Containerfile <<EOF Error: SHELLCHECK_WARNING (CWE-156): [#def169] /usr/share/podman/test/system/070-build.bats:1009:18: warning[SC2046]: Quote this to prevent word splitting. # 1007| local -a linkfiles=(hardlink1 subdir/hardlink2 subdir/subsubdir/hardlink3) # 1008| for l in "${linkfiles[@]}"; do # 1009|-> mkdir -p $(dirname $build_dir/$l) # 1010| ln $dockerfile $build_dir/$l # 1011| done Error: SHELLCHECK_WARNING (CWE-156): [#def170] /usr/share/podman/test/system/070-build.bats:1204:29: warning[SC2046]: Quote this to prevent word splitting. # 1202| # test failures. Try a last-ditch force-rm in cleanup, ignoring errors. # 1203| run_podman '?' rm -t 0 -a -f # 1204|-> run_podman '?' rmi -f b-$(safename) # 1205| # 1206| # Many of the tests above leave interim layers behind. Clean them up. Error: SHELLCHECK_WARNING (CWE-398): [#def171] /usr/share/podman/test/system/075-exec.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Tests for podman exec Error: SHELLCHECK_WARNING (CWE-563): [#def172] /usr/share/podman/test/system/075-exec.bats:220:5: warning[SC2034]: i appears unused. Verify use (or export if used externally). # 218| cid="$output" # 219| # 220|-> for i in {1..3}; do # 221| run_podman 127 exec $cid blahblah # 222| run_podman 125 exec -d $cid blahblah Error: SHELLCHECK_WARNING (CWE-398): [#def173] /usr/share/podman/test/system/080-pause.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # tests for podman pause/unpause functionality Error: SHELLCHECK_WARNING (CWE-398): [#def174] /usr/share/podman/test/system/090-events.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # tests for podman events functionality Error: SHELLCHECK_WARNING (CWE-571): [#def175] /usr/share/podman/test/system/090-events.bats:321:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 319| @test "events - labels included in container die" { # 320| skip_if_remote "remote does not support --events-backend" # 321|-> local cname=c-$(safename) # 322| local lname=label$(safename | tr -d -) # 323| local lvalue="labelvalue-$(safename) $(random_string 5)" Error: SHELLCHECK_WARNING (CWE-571): [#def176] /usr/share/podman/test/system/090-events.bats:322:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 320| skip_if_remote "remote does not support --events-backend" # 321| local cname=c-$(safename) # 322|-> local lname=label$(safename | tr -d -) # 323| local lvalue="labelvalue-$(safename) $(random_string 5)" # 324| Error: SHELLCHECK_WARNING (CWE-571): [#def177] /usr/share/podman/test/system/090-events.bats:323:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 321| local cname=c-$(safename) # 322| local lname=label$(safename | tr -d -) # 323|-> local lvalue="labelvalue-$(safename) $(random_string 5)" # 324| # 325| run_podman 17 --events-backend=file run --rm \ Error: SHELLCHECK_WARNING (CWE-571): [#def178] /usr/share/podman/test/system/090-events.bats:355:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 353| EOF # 354| # 355|-> local cname=c-$1-$(safename) # 356| t0=$(date --iso-8601=seconds) # 357| Error: SHELLCHECK_WARNING (CWE-571): [#def179] /usr/share/podman/test/system/090-events.bats:410:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 408| # bats test_tags=ci:parallel # 409| @test "events - docker compat" { # 410|-> local cname=c-$(safename) # 411| t0=$(date --iso-8601=ns) # 412| run_podman run --name=$cname --rm $IMAGE true Error: SHELLCHECK_WARNING (CWE-571): [#def180] /usr/share/podman/test/system/090-events.bats:423:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 421| # bats test_tags=ci:parallel # 422| @test "events - volume events" { # 423|-> local vname=v-$(safename) # 424| run_podman volume create $vname # 425| run_podman volume rm $vname Error: SHELLCHECK_WARNING (CWE-398): [#def181] /usr/share/podman/test/system/120-load.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # tests for podman load Error: SHELLCHECK_WARNING (CWE-571): [#def182] /usr/share/podman/test/system/120-load.bats:58:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 56| @test "podman save to pipe and load" { # 57| # Generate a random name and tag (must be lower-case) # 58|-> local random_name=x0$(random_string 12 | tr A-Z a-z) # 59| local random_tag=t0$(random_string 7 | tr A-Z a-z) # 60| local fqin=localhost/$random_name:$random_tag Error: SHELLCHECK_WARNING (CWE-571): [#def183] /usr/share/podman/test/system/120-load.bats:59:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 57| # Generate a random name and tag (must be lower-case) # 58| local random_name=x0$(random_string 12 | tr A-Z a-z) # 59|-> local random_tag=t0$(random_string 7 | tr A-Z a-z) # 60| local fqin=localhost/$random_name:$random_tag # 61| run_podman tag $IMAGE $fqin Error: SHELLCHECK_WARNING (CWE-156): [#def184] /usr/share/podman/test/system/120-load.bats:66:14: warning[SC2046]: Quote this to prevent word splitting. # 64| # included a capital letter # 65| archive=$PODMAN_TMPDIR/MySubDirWithCaps/MyImage-$(random_string 8).tar # 66|-> mkdir -p $(dirname $archive) # 67| # 68| # We can't use run_podman because that uses the BATS 'run' function Error: SHELLCHECK_WARNING (CWE-563): [#def185] /usr/share/podman/test/system/120-load.bats:110:9: warning[SC2034]: whoami appears unused. Verify use (or export if used externally). # 108| else # 109| # Harder: our CI infrastructure needs to define this & set up the acct # 110|-> whoami=root # 111| notme=${PODMAN_ROOTLESS_USER} # 112| if [[ -z "$notme" ]]; then Error: SHELLCHECK_WARNING (CWE-457): [#def186] /usr/share/podman/test/system/120-load.bats:152:26: warning[SC2154]: src_digest is referenced but not assigned (did you mean 'src_digests'?). # 150| # 151| run_podman image inspect --format '{{.Digest}}' foobar:123 # 152|-> assert "$output" =~ "$src_digest" "Digest of re-fetched image is in list of original image digests" # 153| # 154| # remove root img for transfer back with another name Error: SHELLCHECK_WARNING (CWE-571): [#def187] /usr/share/podman/test/system/120-load.bats:246:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 244| run_podman rm -f -t0 myweb # 245| run_podman images -a --format '{{.ID}} {{.Repository}}:{{.Tag}}' # 246|-> local myweb_iid=$(echo "$output" | sed -n '/<none>:<none>/s/ .*$//p') # 247| if [[ -n "$myweb_iid" ]]; then # 248| run_podman rmi $myweb_iid Error: SHELLCHECK_WARNING (CWE-398): [#def188] /usr/share/podman/test/system/125-import.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # tests for podman import Error: SHELLCHECK_WARNING (CWE-571): [#def189] /usr/share/podman/test/system/125-import.bats:11:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 9| @test "podman import" { # 10| local archive=$PODMAN_TMPDIR/archive.tar # 11|-> local random_content=$(random_string 12) # 12| # Generate a random name and tag (must be lower-case) # 13| local random_name=x0$(random_string 12 | tr A-Z a-z) Error: SHELLCHECK_WARNING (CWE-571): [#def190] /usr/share/podman/test/system/125-import.bats:13:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 11| local random_content=$(random_string 12) # 12| # Generate a random name and tag (must be lower-case) # 13|-> local random_name=x0$(random_string 12 | tr A-Z a-z) # 14| local random_tag=t0$(random_string 7 | tr A-Z a-z) # 15| local fqin=localhost/$random_name:$random_tag Error: SHELLCHECK_WARNING (CWE-571): [#def191] /usr/share/podman/test/system/125-import.bats:14:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 12| # Generate a random name and tag (must be lower-case) # 13| local random_name=x0$(random_string 12 | tr A-Z a-z) # 14|-> local random_tag=t0$(random_string 7 | tr A-Z a-z) # 15| local fqin=localhost/$random_name:$random_tag # 16| Error: SHELLCHECK_WARNING (CWE-398): [#def192] /usr/share/podman/test/system/130-kill.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # tests for podman kill Error: SHELLCHECK_WARNING (CWE-571): [#def193] /usr/share/podman/test/system/130-kill.bats:10:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 8| # bats test_tags=distro-integration, ci:parallel # 9| @test "podman kill - test signal handling in containers" { # 10|-> local cname=c-$(safename) # 11| local fifo=${PODMAN_TMPDIR}/podman-kill-fifo.$(random_string 10) # 12| mkfifo $fifo Error: SHELLCHECK_WARNING (CWE-571): [#def194] /usr/share/podman/test/system/130-kill.bats:11:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 9| @test "podman kill - test signal handling in containers" { # 10| local cname=c-$(safename) # 11|-> local fifo=${PODMAN_TMPDIR}/podman-kill-fifo.$(random_string 10) # 12| mkfifo $fifo # 13| Error: SHELLCHECK_WARNING (CWE-398): [#def195] /usr/share/podman/test/system/130-kill.bats:61:20: warning[SC1010]: Use semicolon or linefeed before 'done' (or quote to make it literal). # 59| # could get caught and killed by cleanup, causing this step to exit 137 # 60| run_podman exec -d $cname touch /stop # 61|-> read -t 5 -u 5 done || die "Timed out waiting for DONE from container" # 62| is "$done" "DONE" "final log message from container" # 63| Error: SHELLCHECK_WARNING (CWE-88): [#def196] /usr/share/podman/test/system/130-kill.bats:73:14: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 71| # These errors are thrown by the imported docker/signal.ParseSignal() # 72| local -a bad_signal_names=(0 SIGBADSIG SIG BADSIG %% ! "''" '""' " ") # 73|-> for s in ${bad_signal_names[@]}; do # 74| # 'nosuchcontainer' is fine: podman should bail before it gets there # 75| run_podman 125 kill -s $s nosuchcontainer Error: SHELLCHECK_WARNING (CWE-88): [#def197] /usr/share/podman/test/system/130-kill.bats:86:14: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 84| # error message doesn't include the dash. # 85| local -a bad_dash_signals=(-0 -SIGBADSIG -SIG -BADSIG -) # 86|-> for s in ${bad_dash_signals[@]}; do # 87| run_podman 125 kill -s $s nosuchcontainer # 88| is "$output" "Error: invalid signal: ${s##-}" "Error from kill -s $s" Error: SHELLCHECK_WARNING (CWE-88): [#def198] /usr/share/podman/test/system/130-kill.bats:93:14: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 91| # This error (signal out of range) is thrown by our wrapper # 92| local -a bad_signal_nums=(65 -65 96 999 99999999) # 93|-> for s in ${bad_signal_nums[@]}; do # 94| run_podman 125 kill -s $s nosuchcontainer # 95| is "$output" "Error: valid signals are 1 through 64" \ Error: SHELLCHECK_WARNING (CWE-398): [#def199] /usr/share/podman/test/system/140-diff.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Tests for podman diff Error: SHELLCHECK_WARNING (CWE-88): [#def200] /usr/share/podman/test/system/140-diff.bats:27:18: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 25| ) # 26| # 27|-> for field in ${!expect[@]}; do # 28| # ARGH! The /sys/fs kludgery is for RHEL8 rootless, which mumble mumble # 29| # does some sort of magic muckery with /sys - I think the relevant Error: SHELLCHECK_WARNING (CWE-88): [#def201] /usr/share/podman/test/system/140-diff.bats:54:18: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 52| ) # 53| # 54|-> for field in ${!expect[@]}; do # 55| result=$(jq -r -c ".${field}[]" <<<"$output") # 56| is "$result" "${expect[$field]}" "$field" Error: SHELLCHECK_WARNING (CWE-398): [#def202] /usr/share/podman/test/system/150-login.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # tests for podman login Error: SHELLCHECK_WARNING (CWE-457): [#def203] /usr/share/podman/test/system/150-login.bats:343:28: warning[SC2154]: mid is referenced but not assigned. # 341| run_podman tag $IMAGE $image1 # 342| run_podman push --authfile=$authfile \ # 343|-> --tls-verify=false $mid \ # 344| $image1 # 345| run_podman rmi $image1 Error: SHELLCHECK_WARNING (CWE-571): [#def204] /usr/share/podman/test/system/150-login.bats:347:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 345| run_podman rmi $image1 # 346| # 347|-> local podman_image_config_digest=$(image_config_digest $IMAGE) # 348| # 349| run_podman pull -q --retry 4 --retry-delay "0s" --authfile=$authfile \ Error: SHELLCHECK_WARNING (CWE-398): [#def205] /usr/share/podman/test/system/155-partial-pull.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # tests for podman partial pulls support Error: SHELLCHECK_WARNING (CWE-569): [#def206] /usr/share/podman/test/system/155-partial-pull.bats:143:15: warning[SC2089]: Quotes/backslashes will be treated literally. Use an array. # 141| function dir_digest() { # 142| # inspired on https://www.gnu.org/software/tar/manual/html_node/Reproducibility.html # 143|-> TARFLAGS="--numeric-owner --sort=name --format=posix --pax-option=exthdr.name=%d/PaxHeaders/%f --pax-option=delete=atime,delete=ctime --clamp-mtime --mtime='1970-01-01T01:01:01Z'" # 144| # 145| tardest=$PODMAN_TMPDIR/tmp.tar Error: SHELLCHECK_WARNING (CWE-569): [#def207] /usr/share/podman/test/system/155-partial-pull.bats:147:35: warning[SC2090]: Quotes/backslashes in this variable will not be respected. # 145| tardest=$PODMAN_TMPDIR/tmp.tar # 146| # 147|-> run -0 tar -C $1 -cf $tardest $TARFLAGS . # 148| run -0 sha256sum < $tardest # 149| last_dir_digest=$(echo $output | tr -d ' -') Error: SHELLCHECK_WARNING (CWE-398): [#def208] /usr/share/podman/test/system/160-volumes.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # podman volume-related tests Error: SHELLCHECK_WARNING (CWE-156): [#def209] /usr/share/podman/test/system/160-volumes.bats:36:10: warning[SC2046]: Quote this to prevent word splitting. # 34| # 35| # In each directory, write a random string to a file # 36|-> echo $(random_string) >$vol1/file1_in # 37| echo $(random_string) >$vol2/file2_in # 38| echo $(random_string) >$vol3/file3_in Error: SHELLCHECK_WARNING (CWE-156): [#def210] /usr/share/podman/test/system/160-volumes.bats:37:10: warning[SC2046]: Quote this to prevent word splitting. # 35| # In each directory, write a random string to a file # 36| echo $(random_string) >$vol1/file1_in # 37|-> echo $(random_string) >$vol2/file2_in # 38| echo $(random_string) >$vol3/file3_in # 39| Error: SHELLCHECK_WARNING (CWE-156): [#def211] /usr/share/podman/test/system/160-volumes.bats:38:10: warning[SC2046]: Quote this to prevent word splitting. # 36| echo $(random_string) >$vol1/file1_in # 37| echo $(random_string) >$vol2/file2_in # 38|-> echo $(random_string) >$vol3/file3_in # 39| # 40| # Run 'cat' on each file, and compare against local files. Mix -v / --volume Error: SHELLCHECK_WARNING (CWE-457): [#def212] /usr/share/podman/test/system/160-volumes.bats:48:41: warning[SC2154]: voldir is referenced but not assigned (did you mean 'myvoldir'?). # 46| for i in 1 2 3; do # 47| eval voldir=\$vol${i} # 48|-> is "${lines[$(($i - 1))]}" "$(< $voldir/file${i}_in)" \ # 49| "contents of /vol${i}/file${i}_in" # 50| done Error: SHELLCHECK_WARNING (CWE-571): [#def213] /usr/share/podman/test/system/160-volumes.bats:265:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 263| skip_if_remote "N/A on podman-remote" # 264| # 265|-> local volname="myvol_$(random_string 10)" # 266| local mountpoint="/data$(random_string 8)" # 267| Error: SHELLCHECK_WARNING (CWE-571): [#def214] /usr/share/podman/test/system/160-volumes.bats:266:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 264| # 265| local volname="myvol_$(random_string 10)" # 266|-> local mountpoint="/data$(random_string 8)" # 267| # 268| run_podman volume create $volname Error: SHELLCHECK_WARNING (CWE-571): [#def215] /usr/share/podman/test/system/160-volumes.bats:271:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 269| assert "$output" == "$volname" "volume create emits the name it was given" # 270| # 271|-> local content="mycontent-$(random_string 20)-the-end" # 272| run_podman run --rm --volume "$volname:$mountpoint" $IMAGE \ # 273| sh -c "echo $content >$mountpoint/testfile" Error: SHELLCHECK_WARNING (CWE-156): [#def216] /usr/share/podman/test/system/160-volumes.bats:386:16: warning[SC2046]: Quote this to prevent word splitting. # 384| # List available volumes for pruning after using 1,2,3 # 385| run_podman volume prune <<< N # 386|-> is "$(echo $(sort <<<${lines[*]:1:3}))" "${v[4]} ${v[5]} ${v[6]}" "volume prune, with 1,2,3 in use, lists 4,5,6" # 387| # 388| # List available volumes for pruning after using 1,2,3 and filtering; see #8913 Error: SHELLCHECK_WARNING (CWE-569): [#def217] /usr/share/podman/test/system/160-volumes.bats:386:26: warning[SC2048]: Use "${array[@]}" (with quotes) to prevent whitespace problems. # 384| # List available volumes for pruning after using 1,2,3 # 385| run_podman volume prune <<< N # 386|-> is "$(echo $(sort <<<${lines[*]:1:3}))" "${v[4]} ${v[5]} ${v[6]}" "volume prune, with 1,2,3 in use, lists 4,5,6" # 387| # 388| # List available volumes for pruning after using 1,2,3 and filtering; see #8913 Error: SHELLCHECK_WARNING (CWE-156): [#def218] /usr/share/podman/test/system/160-volumes.bats:390:16: warning[SC2046]: Quote this to prevent word splitting. # 388| # List available volumes for pruning after using 1,2,3 and filtering; see #8913 # 389| run_podman volume prune --filter label=mylabel <<< N # 390|-> is "$(echo $(sort <<<${lines[*]:1:2}))" "${v[5]} ${v[6]}" "volume prune, with 1,2,3 in use and 4 filtered out, lists 5,6" # 391| # 392| # prune should remove v4 Error: SHELLCHECK_WARNING (CWE-569): [#def219] /usr/share/podman/test/system/160-volumes.bats:390:26: warning[SC2048]: Use "${array[@]}" (with quotes) to prevent whitespace problems. # 388| # List available volumes for pruning after using 1,2,3 and filtering; see #8913 # 389| run_podman volume prune --filter label=mylabel <<< N # 390|-> is "$(echo $(sort <<<${lines[*]:1:2}))" "${v[5]} ${v[6]}" "volume prune, with 1,2,3 in use and 4 filtered out, lists 5,6" # 391| # 392| # prune should remove v4 Error: SHELLCHECK_WARNING (CWE-156): [#def220] /usr/share/podman/test/system/160-volumes.bats:394:16: warning[SC2046]: Quote this to prevent word splitting. # 392| # prune should remove v4 # 393| run_podman volume prune --force # 394|-> is "$(echo $(sort <<<$output))" "${v[4]} ${v[5]} ${v[6]}" \ # 395| "volume prune, with 1, 2, 3 in use, deletes only 4, 5, 6" # 396| Error: SHELLCHECK_WARNING (CWE-156): [#def221] /usr/share/podman/test/system/160-volumes.bats:401:16: warning[SC2046]: Quote this to prevent word splitting. # 399| run_podman rm c2 # 400| run_podman volume prune --force # 401|-> is "$(echo $(sort <<<$output))" "${v[2]} ${v[3]}" \ # 402| "volume prune, after rm c2, deletes volumes 2 and 3" # 403| Error: SHELLCHECK_WARNING (CWE-563): [#def222] /usr/share/podman/test/system/160-volumes.bats:519:5: warning[SC2034]: fs appears unused. Verify use (or export if used externally). # 517| VOLUME /data # 518| EOF # 519|-> fs=$(stat -f -c %T .) # 520| run_podman build -t volume_image $tmpdir # 521| Error: SHELLCHECK_WARNING (CWE-569): [#def223] /usr/share/podman/test/system/160-volumes.bats:538:30: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 536| # 537| # get the hostfs first so we can match it below # 538|-> run_podman info --format {{.Store.GraphRoot}} # 539| hostfs=$(stat -f -c %T $output) # 540| Error: SHELLCHECK_WARNING (CWE-569): [#def224] /usr/share/podman/test/system/160-volumes.bats:538:31: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 536| # 537| # get the hostfs first so we can match it below # 538|-> run_podman info --format {{.Store.GraphRoot}} # 539| hostfs=$(stat -f -c %T $output) # 540| Error: SHELLCHECK_WARNING (CWE-569): [#def225] /usr/share/podman/test/system/160-volumes.bats:538:48: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 536| # 537| # get the hostfs first so we can match it below # 538|-> run_podman info --format {{.Store.GraphRoot}} # 539| hostfs=$(stat -f -c %T $output) # 540| Error: SHELLCHECK_WARNING (CWE-569): [#def226] /usr/share/podman/test/system/160-volumes.bats:538:49: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 536| # 537| # get the hostfs first so we can match it below # 538|-> run_podman info --format {{.Store.GraphRoot}} # 539| hostfs=$(stat -f -c %T $output) # 540| Error: SHELLCHECK_WARNING (CWE-571): [#def227] /usr/share/podman/test/system/160-volumes.bats:599:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 597| local user_id=2000 # 598| local group_id=2000 # 599|-> local volume_name=$(random_string) # 600| # 601| # Create a volume and get its mount point Error: SHELLCHECK_WARNING (CWE-571): [#def228] /usr/share/podman/test/system/160-volumes.bats:610:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 608| # 609| # Podman chowns the mount point according to the user used in the previous command # 610|-> local original_owner=$(stat --format %g:%u ${mountpoint}) # 611| # 612| # Creating an existing volume with ignore should be a noop Error: SHELLCHECK_WARNING (CWE-156): [#def229] /usr/share/podman/test/system/170-run-userns.bats:155:36: warning[SC2046]: Quote this to prevent word splitting. # 153| @test "podman userns=keep-id in a pod" { # 154| user=$(id -u) # 155|-> run_podman pod create --name p_$(safename) --userns keep-id # 156| pid=$output # 157| run_podman run --rm --pod $pid $IMAGE id -u Error: SHELLCHECK_WARNING (CWE-398): [#def230] /usr/share/podman/test/system/180-blkio.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # podman blkio-related tests Error: SHELLCHECK_WARNING (CWE-156): [#def231] /usr/share/podman/test/system/180-blkio.bats:45:32: warning[SC2046]: Quote this to prevent word splitting. # 43| # 44| # use bfq io scheduler # 45|-> run grep -w bfq /sys/block/$(basename ${lodevice})/queue/scheduler # 46| if [ $status -ne 0 ]; then # 47| skip "BFQ scheduler is not supported on the system" Error: SHELLCHECK_WARNING (CWE-156): [#def232] /usr/share/podman/test/system/180-blkio.bats:49:27: warning[SC2046]: Quote this to prevent word splitting. # 47| skip "BFQ scheduler is not supported on the system" # 48| fi # 49|-> echo bfq > /sys/block/$(basename ${lodevice})/queue/scheduler # 50| # 51| # run podman Error: SHELLCHECK_WARNING (CWE-156): [#def233] /usr/share/podman/test/system/180-blkio.bats:63:14: warning[SC2046]: Quote this to prevent word splitting. # 61| skip "Kernel does not support BFQ IO scheduler" # 62| fi # 63|-> if [ $(podman_runtime) = "crun" ]; then # 64| # As of crun 1.2, crun doesn't support blkio.bfq.weight_device # 65| skip "crun doesn't support blkio.bfq.weight_device" Error: SHELLCHECK_WARNING (CWE-398): [#def234] /usr/share/podman/test/system/195-run-namespaces.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Tests for the namespace options Error: SHELLCHECK_WARNING (CWE-571): [#def235] /usr/share/podman/test/system/195-run-namespaces.bats:21:19: warning[SC2155]: Declare and assign separately to avoid masking return values. # 19| for nstype in private host; do # 20| while read name option; do # 21|-> local cname="c-${name}-$(safename)" # 22| # ipc is special, private does not allow joining from another container. # 23| # Instead we must use "shareable". Error: SHELLCHECK_WARNING (CWE-571): [#def236] /usr/share/podman/test/system/200-pod.bats:193:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 191| # Generate the address IN CAPS (A-F), but we will test it in lowercase. # 192| function random_mac() { # 193|-> local mac=$(printf "%02X" $(( $(octet) & 242 | 2 )) ) # 194| for i in $(seq 2 6); do # 195| mac+=$(printf ":%02X" $(octet)) Error: SHELLCHECK_WARNING (CWE-156): [#def237] /usr/share/podman/test/system/200-pod.bats:195:31: warning[SC2046]: Quote this to prevent word splitting. # 193| local mac=$(printf "%02X" $(( $(octet) & 242 | 2 )) ) # 194| for i in $(seq 2 6); do # 195|-> mac+=$(printf ":%02X" $(octet)) # 196| done # 197| Error: SHELLCHECK_WARNING (CWE-156): [#def238] /usr/share/podman/test/system/200-pod.bats:205:28: warning[SC2046]: Quote this to prevent word splitting. # 203| local ip="172.20" # 204| for i in 1 2;do # 205|-> ip+=$(printf ".%d" $(octet)) # 206| done # 207| echo $ip Error: SHELLCHECK_WARNING (CWE-571): [#def239] /usr/share/podman/test/system/200-pod.bats:241:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 239| # existing 'pause' script in our testimage. We assign a bogus # 240| # entrypoint to confirm that --infra-command will override. # 241|-> local infra_image="infra_image_$(safename)" # 242| local infra_command="/pause_$(safename)" # 243| local infra_name="infra_container_$(safename)" Error: SHELLCHECK_WARNING (CWE-571): [#def240] /usr/share/podman/test/system/200-pod.bats:242:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 240| # entrypoint to confirm that --infra-command will override. # 241| local infra_image="infra_image_$(safename)" # 242|-> local infra_command="/pause_$(safename)" # 243| local infra_name="infra_container_$(safename)" # 244| # --layers=false needed to work around buildah#5674 parallel flake Error: SHELLCHECK_WARNING (CWE-571): [#def241] /usr/share/podman/test/system/200-pod.bats:243:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 241| local infra_image="infra_image_$(safename)" # 242| local infra_command="/pause_$(safename)" # 243|-> local infra_name="infra_container_$(safename)" # 244| # --layers=false needed to work around buildah#5674 parallel flake # 245| run_podman build -t $infra_image --layers=false - << EOF Error: SHELLCHECK_WARNING (CWE-571): [#def242] /usr/share/podman/test/system/200-pod.bats:251:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 249| EOF # 250| # 251|-> local podname="pod-$(safename)" # 252| if is_rootless; then # 253| mac_option= Error: SHELLCHECK_WARNING (CWE-398): [#def243] /usr/share/podman/test/system/200-pod.bats:296:21: error[SC1087]: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). # 294| # 295| run_podman run --rm --pod $pod_id $IMAGE cat /etc/hosts # 296|-> is "$output" ".*$add_host_ip[[:blank:]]$add_host_n" "--add-host was added" # 297| is "$output" ".* $hostname" "--hostname is in /etc/hosts" # 298| # ^^^^ this must be a tab, not a space Error: SHELLCHECK_WARNING (CWE-571): [#def244] /usr/share/podman/test/system/200-pod.bats:365:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 363| # bats test_tags=ci:parallel # 364| @test "podman pod create should fail when infra-name is already in use" { # 365|-> local infra_name="infra_container_$(safename)" # 366| local infra_image="quay.io/libpod/k8s-pause:3.5" # 367| local pod_name="p-$(safename)" Error: SHELLCHECK_WARNING (CWE-571): [#def245] /usr/share/podman/test/system/200-pod.bats:367:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 365| local infra_name="infra_container_$(safename)" # 366| local infra_image="quay.io/libpod/k8s-pause:3.5" # 367|-> local pod_name="p-$(safename)" # 368| # 369| run_podman --noout pod create --name $pod_name --infra-name "$infra_name" --infra-image "$infra_image" Error: SHELLCHECK_WARNING (CWE-571): [#def246] /usr/share/podman/test/system/200-pod.bats:382:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 380| # bats test_tags=ci:parallel # 381| @test "podman pod create --share" { # 382|-> local pod_name="p-$(safename)" # 383| run_podman 125 pod create --share bogus --name $pod_name # 384| is "$output" ".*invalid kernel namespace to share: bogus. Options are: cgroup, ipc, net, pid, uts or none" \ Error: SHELLCHECK_WARNING (CWE-571): [#def247] /usr/share/podman/test/system/200-pod.bats:402:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 400| # bats test_tags=ci:parallel # 401| @test "podman pod create --pod new:$POD --hostname" { # 402|-> local pod_name="p-$(safename)" # 403| run_podman run --rm --pod "new:$pod_name" --hostname foobar $IMAGE hostname # 404| is "$output" "foobar" "--hostname should work when creating a new:pod" Error: SHELLCHECK_WARNING (CWE-571): [#def248] /usr/share/podman/test/system/200-pod.bats:413:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 411| # bats test_tags=ci:parallel # 412| @test "podman rm --force to remove infra container" { # 413|-> local pod_name="p-$(safename)" # 414| run_podman create --pod "new:$pod_name" $IMAGE # 415| container_ID="$output" Error: SHELLCHECK_WARNING (CWE-569): [#def249] /usr/share/podman/test/system/200-pod.bats:451:46: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 449| podname="p-$(safename)" # 450| run_podman pod create --name $podname # 451|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 452| is "$output" "false" "Default network sharing should be false" # 453| run_podman pod rm $podname Error: SHELLCHECK_WARNING (CWE-569): [#def250] /usr/share/podman/test/system/200-pod.bats:451:47: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 449| podname="p-$(safename)" # 450| run_podman pod create --name $podname # 451|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 452| is "$output" "false" "Default network sharing should be false" # 453| run_podman pod rm $podname Error: SHELLCHECK_WARNING (CWE-569): [#def251] /usr/share/podman/test/system/200-pod.bats:451:72: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 449| podname="p-$(safename)" # 450| run_podman pod create --name $podname # 451|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 452| is "$output" "false" "Default network sharing should be false" # 453| run_podman pod rm $podname Error: SHELLCHECK_WARNING (CWE-569): [#def252] /usr/share/podman/test/system/200-pod.bats:451:73: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 449| podname="p-$(safename)" # 450| run_podman pod create --name $podname # 451|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 452| is "$output" "false" "Default network sharing should be false" # 453| run_podman pod rm $podname Error: SHELLCHECK_WARNING (CWE-569): [#def253] /usr/share/podman/test/system/200-pod.bats:456:46: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 454| # 455| run_podman pod create --share ipc --network private $podname # 456|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 457| is "$output" "false" "Private network sharing with only ipc should be false" # 458| run_podman pod rm $podname Error: SHELLCHECK_WARNING (CWE-569): [#def254] /usr/share/podman/test/system/200-pod.bats:456:47: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 454| # 455| run_podman pod create --share ipc --network private $podname # 456|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 457| is "$output" "false" "Private network sharing with only ipc should be false" # 458| run_podman pod rm $podname Error: SHELLCHECK_WARNING (CWE-569): [#def255] /usr/share/podman/test/system/200-pod.bats:456:72: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 454| # 455| run_podman pod create --share ipc --network private $podname # 456|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 457| is "$output" "false" "Private network sharing with only ipc should be false" # 458| run_podman pod rm $podname Error: SHELLCHECK_WARNING (CWE-569): [#def256] /usr/share/podman/test/system/200-pod.bats:456:73: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 454| # 455| run_podman pod create --share ipc --network private $podname # 456|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 457| is "$output" "false" "Private network sharing with only ipc should be false" # 458| run_podman pod rm $podname Error: SHELLCHECK_WARNING (CWE-569): [#def257] /usr/share/podman/test/system/200-pod.bats:461:46: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 459| # 460| run_podman pod create --name $podname --share net --network private # 461|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 462| is "$output" "false" "Private network sharing with only net should be false" # 463| Error: SHELLCHECK_WARNING (CWE-569): [#def258] /usr/share/podman/test/system/200-pod.bats:461:47: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 459| # 460| run_podman pod create --name $podname --share net --network private # 461|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 462| is "$output" "false" "Private network sharing with only net should be false" # 463| Error: SHELLCHECK_WARNING (CWE-569): [#def259] /usr/share/podman/test/system/200-pod.bats:461:72: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 459| # 460| run_podman pod create --name $podname --share net --network private # 461|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 462| is "$output" "false" "Private network sharing with only net should be false" # 463| Error: SHELLCHECK_WARNING (CWE-569): [#def260] /usr/share/podman/test/system/200-pod.bats:461:73: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 459| # 460| run_podman pod create --name $podname --share net --network private # 461|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 462| is "$output" "false" "Private network sharing with only net should be false" # 463| Error: SHELLCHECK_WARNING (CWE-569): [#def261] /usr/share/podman/test/system/200-pod.bats:465:46: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 463| # 464| run_podman pod create --share net --network host --replace $podname # 465|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 466| is "$output" "true" "Host network sharing with only net should be true" # 467| run_podman pod rm $podname Error: SHELLCHECK_WARNING (CWE-569): [#def262] /usr/share/podman/test/system/200-pod.bats:465:47: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 463| # 464| run_podman pod create --share net --network host --replace $podname # 465|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 466| is "$output" "true" "Host network sharing with only net should be true" # 467| run_podman pod rm $podname Error: SHELLCHECK_WARNING (CWE-569): [#def263] /usr/share/podman/test/system/200-pod.bats:465:72: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 463| # 464| run_podman pod create --share net --network host --replace $podname # 465|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 466| is "$output" "true" "Host network sharing with only net should be true" # 467| run_podman pod rm $podname Error: SHELLCHECK_WARNING (CWE-569): [#def264] /usr/share/podman/test/system/200-pod.bats:465:73: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 463| # 464| run_podman pod create --share net --network host --replace $podname # 465|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 466| is "$output" "true" "Host network sharing with only net should be true" # 467| run_podman pod rm $podname Error: SHELLCHECK_WARNING (CWE-569): [#def265] /usr/share/podman/test/system/200-pod.bats:470:46: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 468| # 469| run_podman pod create --name $podname --share ipc --network host # 470|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 471| is "$output" "true" "Host network sharing with only ipc should be true" # 472| run_podman pod rm $podname Error: SHELLCHECK_WARNING (CWE-569): [#def266] /usr/share/podman/test/system/200-pod.bats:470:47: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 468| # 469| run_podman pod create --name $podname --share ipc --network host # 470|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 471| is "$output" "true" "Host network sharing with only ipc should be true" # 472| run_podman pod rm $podname Error: SHELLCHECK_WARNING (CWE-569): [#def267] /usr/share/podman/test/system/200-pod.bats:470:72: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 468| # 469| run_podman pod create --name $podname --share ipc --network host # 470|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 471| is "$output" "true" "Host network sharing with only ipc should be true" # 472| run_podman pod rm $podname Error: SHELLCHECK_WARNING (CWE-569): [#def268] /usr/share/podman/test/system/200-pod.bats:470:73: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 468| # 469| run_podman pod create --name $podname --share ipc --network host # 470|-> run_podman pod inspect $podname --format {{.InfraConfig.HostNetwork}} # 471| is "$output" "true" "Host network sharing with only ipc should be true" # 472| run_podman pod rm $podname Error: SHELLCHECK_WARNING (CWE-571): [#def269] /usr/share/podman/test/system/200-pod.bats:512:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 510| @test "pod exit policies - play kube" { # 511| # play-kube sets the exit policy to "stop" # 512|-> local name="p-$(safename)" # 513| # 514| kubeFile="apiVersion: v1 Error: SHELLCHECK_WARNING (CWE-156): [#def270] /usr/share/podman/test/system/200-pod.bats:547:32: warning[SC2046]: Quote this to prevent word splitting. # 545| # tr needed because losetup seems to use %2d # 546| lomajmin=$(losetup -l --noheadings --output MAJ:MIN $LOOPDEVICE | tr -d ' ') # 547|-> run grep -w bfq /sys/block/$(basename ${LOOPDEVICE})/queue/scheduler # 548| if [ $status -ne 0 ]; then # 549| losetup -d $LOOPDEVICE Error: SHELLCHECK_WARNING (CWE-156): [#def271] /usr/share/podman/test/system/200-pod.bats:553:27: warning[SC2046]: Quote this to prevent word splitting. # 551| skip "BFQ scheduler is not supported on the system" # 552| fi # 553|-> echo bfq > /sys/block/$(basename ${LOOPDEVICE})/queue/scheduler # 554| # 555| # FIXME: #15464: blkio-weight-device not working Error: SHELLCHECK_WARNING (CWE-571): [#def272] /usr/share/podman/test/system/200-pod.bats:566:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 564| defer-assertion-failures # 565| for cgm in systemd cgroupfs; do # 566|-> local name="p-resources-$cgm-$(safename)" # 567| run_podman --cgroup-manager=$cgm pod create --name=$name --cpus=5 --memory=5m --memory-swap=1g --cpu-shares=1000 --cpuset-cpus=0 --cpuset-mems=0 --device-read-bps=${LOOPDEVICE}:1mb --device-write-bps=${LOOPDEVICE}:1mb --blkio-weight=50 # 568| run_podman --cgroup-manager=$cgm pod start $name Error: SHELLCHECK_WARNING (CWE-571): [#def273] /usr/share/podman/test/system/200-pod.bats:573:19: warning[SC2155]: Declare and assign separately to avoid masking return values. # 571| # 572| while read unit expect; do # 573|-> local actual=$(< /sys/fs/cgroup/$cgroup_path/$unit) # 574| is "$actual" "$expect" "resource limit under $cgm: $unit" # 575| done < <(parse_table "$expected_limits") Error: SHELLCHECK_WARNING (CWE-563): [#def274] /usr/share/podman/test/system/200-pod.bats:587:5: warning[SC2034]: i appears unused. Verify use (or export if used externally). # 585| @test "podman pod ps doesn't race with pod rm" { # 586| # create a few pods # 587|-> for i in {0..10}; do # 588| run_podman pod create # 589| done Error: SHELLCHECK_WARNING (CWE-569): [#def275] /usr/share/podman/test/system/200-pod.bats:687:31: warning[SC2048]: Use "${array[@]}" (with quotes) to prevent whitespace problems. # 685| podname="p-${p}-$(safename)" # 686| thingy_with_unique_id "pod" "--infra=false --name $podname" \ # 687|-> ${podid[*]} ${ctrid[*]} # 688| podid[$p]=$id # 689| Error: SHELLCHECK_WARNING (CWE-569): [#def276] /usr/share/podman/test/system/200-pod.bats:687:43: warning[SC2048]: Use "${array[@]}" (with quotes) to prevent whitespace problems. # 685| podname="p-${p}-$(safename)" # 686| thingy_with_unique_id "pod" "--infra=false --name $podname" \ # 687|-> ${podid[*]} ${ctrid[*]} # 688| podid[$p]=$id # 689| Error: SHELLCHECK_WARNING (CWE-569): [#def277] /usr/share/podman/test/system/200-pod.bats:693:35: warning[SC2048]: Use "${array[@]}" (with quotes) to prevent whitespace problems. # 691| thingy_with_unique_id "container" \ # 692| "--pod $podname --name $podname-c${c} $IMAGE true" \ # 693|-> ${podid[*]} ${ctrid[*]} # 694| ctrid[$p$c]=$id # 695| done Error: SHELLCHECK_WARNING (CWE-569): [#def278] /usr/share/podman/test/system/200-pod.bats:693:47: warning[SC2048]: Use "${array[@]}" (with quotes) to prevent whitespace problems. # 691| thingy_with_unique_id "container" \ # 692| "--pod $podname --name $podname-c${c} $IMAGE true" \ # 693|-> ${podid[*]} ${ctrid[*]} # 694| ctrid[$p$c]=$id # 695| done Error: SHELLCHECK_WARNING (CWE-571): [#def279] /usr/share/podman/test/system/200-pod.bats:716:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 714| for p in 1 2 3; do # 715| local pid=${podid[$p]} # 716|-> local podname="p-$p-$(safename)" # 717| # 718| # Search by short pod ID, longer pod ID, pod ID regex, and pod name Error: SHELLCHECK_WARNING (CWE-571): [#def280] /usr/share/podman/test/system/200-pod.bats:740:19: warning[SC2155]: Declare and assign separately to avoid masking return values. # 738| for c in 1 2 3;do # 739| local cid=${ctrid[$p$c]} # 740|-> local podname="p-$p-$(safename)" # 741| for filter in "ctr-ids=${cid:0:2}" "ctr-ids=^${cid:0:2}.*"; do # 742| run_podman pod ps --filter=$filter --format '{{.Name}}:{{.Id}}' Error: SHELLCHECK_WARNING (CWE-569): [#def281] /usr/share/podman/test/system/200-pod.bats:758:26: warning[SC2048]: Use "${array[@]}" (with quotes) to prevent whitespace problems. # 756| # 757| # Clean up # 758|-> run_podman pod rm -f ${podid[*]} # 759| } # 760| Error: SHELLCHECK_WARNING (CWE-398): [#def282] /usr/share/podman/test/system/200-pod.bats:769:9: warning[SC2178]: Variable was used as an array but is now assigned a string. # 767| for infra in true false; do # 768| run_podman pod create --infra=$infra --memory=256M # 769|-> podid="$output" # 770| run_podman run -d --pod $podid $IMAGE top -d 2 # 771| Error: SHELLCHECK_WARNING (CWE-670): [#def283] /usr/share/podman/test/system/200-pod.bats:770:33: warning[SC2128]: Expanding an array without an index only gives the first element. # 768| run_podman pod create --infra=$infra --memory=256M # 769| podid="$output" # 770|-> run_podman run -d --pod $podid $IMAGE top -d 2 # 771| # 772| run_podman pod inspect $podid --format "{{.CgroupPath}}" Error: SHELLCHECK_WARNING (CWE-670): [#def284] /usr/share/podman/test/system/200-pod.bats:772:32: warning[SC2128]: Expanding an array without an index only gives the first element. # 770| run_podman run -d --pod $podid $IMAGE top -d 2 # 771| # 772|-> run_podman pod inspect $podid --format "{{.CgroupPath}}" # 773| result="$output" # 774| assert "$result" =~ "/" ".CgroupPath is a valid path" Error: SHELLCHECK_WARNING (CWE-670): [#def285] /usr/share/podman/test/system/200-pod.bats:786:34: warning[SC2128]: Expanding an array without an index only gives the first element. # 784| fi # 785| # 786|-> run_podman pod stop -t 0 $podid # 787| if test -e $cgroup_path; then # 788| die "the cgroup $cgroup_path should not exist after pod stop" Error: SHELLCHECK_WARNING (CWE-670): [#def286] /usr/share/podman/test/system/200-pod.bats:791:30: warning[SC2128]: Expanding an array without an index only gives the first element. # 789| fi # 790| # 791|-> run_podman pod start $podid # 792| if test ! -e $cgroup_path; then # 793| die "the cgroup $cgroup_path does not exist" Error: SHELLCHECK_WARNING (CWE-670): [#def287] /usr/share/podman/test/system/200-pod.bats:805:35: warning[SC2128]: Expanding an array without an index only gives the first element. # 803| assert "$(< $memory_limit_file)" = "268435456" "Contents of $memory_limit_file" # 804| # 805|-> run_podman pod rm -t 0 -f $podid # 806| if test -e $cgroup_path; then # 807| die "the cgroup $cgroup_path should not exist after pod rm" Error: SHELLCHECK_WARNING (CWE-398): [#def288] /usr/share/podman/test/system/220-healthcheck.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # tests for podman healthcheck Error: SHELLCHECK_WARNING (CWE-571): [#def289] /usr/share/podman/test/system/220-healthcheck.bats:56:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 54| # 55| @test "podman healthcheck" { # 56|-> local ctrname="c-h-$(safename)" # 57| run_podman run -d --name $ctrname \ # 58| --health-cmd /home/podman/healthcheck \ Error: SHELLCHECK_WARNING (CWE-563): [#def290] /usr/share/podman/test/system/220-healthcheck.bats:257:9: warning[SC2034]: t0 appears unused. Verify use (or export if used externally). # 255| # 256| for policy in stop kill restart ;do # 257|-> t0=$(date --iso-8601=seconds) # 258| run_podman run -d --name $ctr \ # 259| --health-cmd /bin/false \ Error: SHELLCHECK_WARNING (CWE-571): [#def291] /usr/share/podman/test/system/220-healthcheck.bats:320:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 318| # 319| @test "podman healthcheck --health-max-log-count default value (5)" { # 320|-> local msg="healthmsg-$(random_string)" # 321| local ctrname="c-h-$(safename)" # 322| _create_container_with_health_log_settings $ctrname $msg "{{.Config.HealthMaxLogCount}}" "" "5" "HealthMaxLogCount is the expected default" Error: SHELLCHECK_WARNING (CWE-571): [#def292] /usr/share/podman/test/system/220-healthcheck.bats:321:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 319| @test "podman healthcheck --health-max-log-count default value (5)" { # 320| local msg="healthmsg-$(random_string)" # 321|-> local ctrname="c-h-$(safename)" # 322| _create_container_with_health_log_settings $ctrname $msg "{{.Config.HealthMaxLogCount}}" "" "5" "HealthMaxLogCount is the expected default" # 323| Error: SHELLCHECK_WARNING (CWE-571): [#def293] /usr/share/podman/test/system/220-healthcheck.bats:337:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 335| @test "podman healthcheck --health-max-log-count infinite value (0)" { # 336| local repeat_count=10 # 337|-> local msg="healthmsg-$(random_string)" # 338| local ctrname="c-h-$(safename)" # 339| _create_container_with_health_log_settings $ctrname $msg "{{.Config.HealthMaxLogCount}}" "--health-max-log-count 0" "0" "HealthMaxLogCount" Error: SHELLCHECK_WARNING (CWE-571): [#def294] /usr/share/podman/test/system/220-healthcheck.bats:338:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 336| local repeat_count=10 # 337| local msg="healthmsg-$(random_string)" # 338|-> local ctrname="c-h-$(safename)" # 339| _create_container_with_health_log_settings $ctrname $msg "{{.Config.HealthMaxLogCount}}" "--health-max-log-count 0" "0" "HealthMaxLogCount" # 340| Error: SHELLCHECK_WARNING (CWE-571): [#def295] /usr/share/podman/test/system/220-healthcheck.bats:358:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 356| @test "podman healthcheck --health-max-log-count 10" { # 357| local repeat_count=10 # 358|-> local msg="healthmsg-$(random_string)" # 359| local ctrname="c-h-$(safename)" # 360| _create_container_with_health_log_settings $ctrname $msg "{{.Config.HealthMaxLogCount}}" "--health-max-log-count $repeat_count" "$repeat_count" "HealthMaxLogCount" Error: SHELLCHECK_WARNING (CWE-571): [#def296] /usr/share/podman/test/system/220-healthcheck.bats:359:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 357| local repeat_count=10 # 358| local msg="healthmsg-$(random_string)" # 359|-> local ctrname="c-h-$(safename)" # 360| _create_container_with_health_log_settings $ctrname $msg "{{.Config.HealthMaxLogCount}}" "--health-max-log-count $repeat_count" "$repeat_count" "HealthMaxLogCount" # 361| Error: SHELLCHECK_WARNING (CWE-571): [#def297] /usr/share/podman/test/system/220-healthcheck.bats:375:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 373| # 374| @test "podman healthcheck --health-max-log-size 10" { # 375|-> local msg="healthmsg-$(random_string)" # 376| local ctrname="c-h-$(safename)" # 377| _create_container_with_health_log_settings $ctrname $msg "{{.Config.HealthMaxLogSize}}" "--health-max-log-size 10" "10" "HealthMaxLogSize" Error: SHELLCHECK_WARNING (CWE-571): [#def298] /usr/share/podman/test/system/220-healthcheck.bats:376:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 374| @test "podman healthcheck --health-max-log-size 10" { # 375| local msg="healthmsg-$(random_string)" # 376|-> local ctrname="c-h-$(safename)" # 377| _create_container_with_health_log_settings $ctrname $msg "{{.Config.HealthMaxLogSize}}" "--health-max-log-size 10" "10" "HealthMaxLogSize" # 378| Error: SHELLCHECK_WARNING (CWE-571): [#def299] /usr/share/podman/test/system/220-healthcheck.bats:389:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 387| # 388| @test "podman healthcheck --health-max-log-size infinite value (0)" { # 389|-> local s=$(printf "healthmsg-%1000s") # 390| local long_msg=${s// /$(random_string)} # 391| local ctrname="c-h-$(safename)" Error: SHELLCHECK_WARNING (CWE-398): [#def300] /usr/share/podman/test/system/220-healthcheck.bats:389:22: warning[SC2183]: This format string has 1 variable, but is passed 0 argument. # 387| # 388| @test "podman healthcheck --health-max-log-size infinite value (0)" { # 389|-> local s=$(printf "healthmsg-%1000s") # 390| local long_msg=${s// /$(random_string)} # 391| local ctrname="c-h-$(safename)" Error: SHELLCHECK_WARNING (CWE-571): [#def301] /usr/share/podman/test/system/220-healthcheck.bats:391:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 389| local s=$(printf "healthmsg-%1000s") # 390| local long_msg=${s// /$(random_string)} # 391|-> local ctrname="c-h-$(safename)" # 392| _create_container_with_health_log_settings $ctrname $long_msg "{{.Config.HealthMaxLogSize}}" "--health-max-log-size 0" "0" "HealthMaxLogSize" # 393| Error: SHELLCHECK_WARNING (CWE-571): [#def302] /usr/share/podman/test/system/220-healthcheck.bats:405:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 403| # 404| @test "podman healthcheck --health-max-log-size default value (500)" { # 405|-> local s=$(printf "healthmsg-%1000s") # 406| local long_msg=${s// /$(random_string)} # 407| local ctrname="c-h-$(safename)" Error: SHELLCHECK_WARNING (CWE-398): [#def303] /usr/share/podman/test/system/220-healthcheck.bats:405:22: warning[SC2183]: This format string has 1 variable, but is passed 0 argument. # 403| # 404| @test "podman healthcheck --health-max-log-size default value (500)" { # 405|-> local s=$(printf "healthmsg-%1000s") # 406| local long_msg=${s// /$(random_string)} # 407| local ctrname="c-h-$(safename)" Error: SHELLCHECK_WARNING (CWE-571): [#def304] /usr/share/podman/test/system/220-healthcheck.bats:407:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 405| local s=$(printf "healthmsg-%1000s") # 406| local long_msg=${s// /$(random_string)} # 407|-> local ctrname="c-h-$(safename)" # 408| _create_container_with_health_log_settings $ctrname $long_msg "{{.Config.HealthMaxLogSize}}" "" "500" "HealthMaxLogSize is the expected default" # 409| Error: SHELLCHECK_WARNING (CWE-571): [#def305] /usr/share/podman/test/system/220-healthcheck.bats:423:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 421| local TMP_DIR_HEALTHCHECK="$PODMAN_TMPDIR/healthcheck" # 422| mkdir $TMP_DIR_HEALTHCHECK # 423|-> local ctrname="c-h-$(safename)" # 424| local msg="healthmsg-$(random_string)" # 425| _create_container_with_health_log_settings $ctrname $msg "{{.Config.HealthLogDestination}}" "--health-log-destination $TMP_DIR_HEALTHCHECK" "$TMP_DIR_HEALTHCHECK" "HealthLogDestination" Error: SHELLCHECK_WARNING (CWE-571): [#def306] /usr/share/podman/test/system/220-healthcheck.bats:424:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 422| mkdir $TMP_DIR_HEALTHCHECK # 423| local ctrname="c-h-$(safename)" # 424|-> local msg="healthmsg-$(random_string)" # 425| _create_container_with_health_log_settings $ctrname $msg "{{.Config.HealthLogDestination}}" "--health-log-destination $TMP_DIR_HEALTHCHECK" "$TMP_DIR_HEALTHCHECK" "HealthLogDestination" # 426| cid="$output" Error: SHELLCHECK_WARNING (CWE-571): [#def307] /usr/share/podman/test/system/220-healthcheck.bats:447:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 445| skip_if_journald_unavailable # 446| # 447|-> local ctrname="c-h-$(safename)" # 448| local msg="healthmsg-$(random_string)" # 449| _create_container_with_health_log_settings $ctrname $msg "{{.Config.HealthLogDestination}}" "--health-log-destination events_logger" "events_logger" "HealthLogDestination" Error: SHELLCHECK_WARNING (CWE-571): [#def308] /usr/share/podman/test/system/220-healthcheck.bats:448:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 446| # 447| local ctrname="c-h-$(safename)" # 448|-> local msg="healthmsg-$(random_string)" # 449| _create_container_with_health_log_settings $ctrname $msg "{{.Config.HealthLogDestination}}" "--health-log-destination events_logger" "events_logger" "HealthLogDestination" # 450| cid="$output" Error: SHELLCHECK_WARNING (CWE-398): [#def309] /usr/share/podman/test/system/250-systemd.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Tests generated configurations for systemd. Error: SHELLCHECK_WARNING (CWE-252): [#def310] /usr/share/podman/test/system/250-systemd.bats:64:9: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. # 62| # is forgiving about that, but RHEL8 systemd chokes with EINVAL) # 63| ( # 64|-> cd $PODMAN_TMPDIR # 65| run_podman generate systemd --files --name \ # 66| -e http_proxy -e https_proxy -e no_proxy \ Error: SHELLCHECK_WARNING (CWE-480): [#def311] /usr/share/podman/test/system/250-systemd.bats:306:30: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ). # 304| # 305| @test "podman --cgroup=cgroupfs doesn't show systemd warning" { # 306|-> DBUS_SESSION_BUS_ADDRESS= run_podman --log-level warning --cgroup-manager=cgroupfs info -f '' # 307| is "$output" "" "output should be empty" # 308| } Error: SHELLCHECK_WARNING (CWE-571): [#def312] /usr/share/podman/test/system/250-systemd.bats:331:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 329| # 330| cname=c-$(safename) # 331|-> local netname=testnet-$(safename) # 332| # 333| # create network and container with network Error: SHELLCHECK_WARNING (CWE-563): [#def313] /usr/share/podman/test/system/250-systemd.bats:490:5: warning[SC2034]: i appears unused. Verify use (or export if used externally). # 488| # Kill the pod and make sure the service is not running. # 489| run_podman pod kill $podname # 490|-> for i in {0..20}; do # 491| # echos are for debugging test flakes # 492| echo "$_LOG_PROMPT systemctl is-active $service_name" Error: SHELLCHECK_WARNING (CWE-398): [#def314] /usr/share/podman/test/system/251-system-service.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Tests that require 'podman system service' but no other systemd aspects Error: SHELLCHECK_WARNING (CWE-571): [#def315] /usr/share/podman/test/system/251-system-service.bats:43:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 41| @test "podman-system-service containers survive service stop" { # 42| skip_if_remote "podman system service unavailable over remote" # 43|-> local runtime=$(podman_runtime) # 44| if [[ "$runtime" != "crun" ]]; then # 45| skip "survival code only implemented in crun; you're using $runtime" Error: SHELLCHECK_WARNING (CWE-398): [#def316] /usr/share/podman/test/system/252-quadlet.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Tests generated configurations for systemd. Error: SHELLCHECK_WARNING (CWE-88): [#def317] /usr/share/podman/test/system/252-quadlet.bats:33:22: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 31| # 32| function teardown() { # 33|-> for UNIT_FILE in ${UNIT_FILES[@]}; do # 34| if [[ -e "$UNIT_FILE" ]]; then # 35| local service=$(basename "$UNIT_FILE") Error: SHELLCHECK_WARNING (CWE-571): [#def318] /usr/share/podman/test/system/252-quadlet.bats:35:19: warning[SC2155]: Declare and assign separately to avoid masking return values. # 33| for UNIT_FILE in ${UNIT_FILES[@]}; do # 34| if [[ -e "$UNIT_FILE" ]]; then # 35|-> local service=$(basename "$UNIT_FILE") # 36| run systemctl stop "$service" # 37| if [ $status -ne 0 ]; then Error: SHELLCHECK_WARNING (CWE-571): [#def319] /usr/share/podman/test/system/252-quadlet.bats:52:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 50| function run_quadlet() { # 51| local sourcefile="$1" # 52|-> local service=$(quadlet_to_service_name "$sourcefile") # 53| # 54| # quadlet always works on an entire directory, so copy the file Error: SHELLCHECK_WARNING (CWE-571): [#def320] /usr/share/podman/test/system/252-quadlet.bats:138:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 136| # 137| function create_secret() { # 138|-> local secret_name=$(random_string) # 139| local secret_file=$PODMAN_TMPDIR/secret_$(random_string) # 140| local secret=$(random_string) Error: SHELLCHECK_WARNING (CWE-571): [#def321] /usr/share/podman/test/system/252-quadlet.bats:139:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 137| function create_secret() { # 138| local secret_name=$(random_string) # 139|-> local secret_file=$PODMAN_TMPDIR/secret_$(random_string) # 140| local secret=$(random_string) # 141| Error: SHELLCHECK_WARNING (CWE-571): [#def322] /usr/share/podman/test/system/252-quadlet.bats:140:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 138| local secret_name=$(random_string) # 139| local secret_file=$PODMAN_TMPDIR/secret_$(random_string) # 140|-> local secret=$(random_string) # 141| # 142| echo $secret > $secret_file Error: SHELLCHECK_WARNING: [#def323] /usr/share/podman/test/system/252-quadlet.bats:179:28: warning[SC2076]: Remove quotes from right-hand side of =~ to match as a regex rather than literally. # 177| while [ "$count" -gt 0 ]; do # 178| run journalctl "--since=$STARTED_TIME" --unit="$QUADLET_SERVICE_NAME" # 179|-> if [[ "$output" =~ "$expect_str" ]]; then # 180| return # 181| fi Error: SHELLCHECK_WARNING (CWE-571): [#def324] /usr/share/podman/test/system/252-quadlet.bats:192:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 190| # Network=none is to work around a Pasta bug, can be removed once a patched Pasta is available. # 191| # Ref https://github.com/containers/podman/pull/21563#issuecomment-1965145324 # 192|-> local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).container # 193| cat > $quadlet_file <<EOF # 194| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def325] /usr/share/podman/test/system/252-quadlet.bats:240:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 238| dir1=$PODMAN_TMPDIR/$(random_string) # 239| dir2=$PODMAN_TMPDIR/$(random_string) # 240|-> local quadlet_file=basic_$(safename).container # 241| mkdir -p $dir1 $dir2 # 242| Error: SHELLCHECK_WARNING (CWE-571): [#def326] /usr/share/podman/test/system/252-quadlet.bats:262:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 260| # 261| @test "quadlet - envvar" { # 262|-> local quadlet_file=$PODMAN_TMPDIR/envvar_$(safename).container # 263| cat > $quadlet_file <<EOF # 264| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def327] /usr/share/podman/test/system/252-quadlet.bats:286:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 284| # 285| @test "quadlet - ContainerName and journal output check" { # 286|-> local quadlet_file=$PODMAN_TMPDIR/containername_$(safename).container # 287| local token_out="STDOUT$(random_string 10)" # 288| local token_err="STDERR$(random_string 10)" Error: SHELLCHECK_WARNING (CWE-571): [#def328] /usr/share/podman/test/system/252-quadlet.bats:287:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 285| @test "quadlet - ContainerName and journal output check" { # 286| local quadlet_file=$PODMAN_TMPDIR/containername_$(safename).container # 287|-> local token_out="STDOUT$(random_string 10)" # 288| local token_err="STDERR$(random_string 10)" # 289| cat > $quadlet_file <<EOF Error: SHELLCHECK_WARNING (CWE-571): [#def329] /usr/share/podman/test/system/252-quadlet.bats:288:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 286| local quadlet_file=$PODMAN_TMPDIR/containername_$(safename).container # 287| local token_out="STDOUT$(random_string 10)" # 288|-> local token_err="STDERR$(random_string 10)" # 289| cat > $quadlet_file <<EOF # 290| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def330] /usr/share/podman/test/system/252-quadlet.bats:319:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 317| # 318| @test "quadlet - labels" { # 319|-> local quadlet_file=$PODMAN_TMPDIR/labels_$(safename).container # 320| cat > $quadlet_file <<EOF # 321| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def331] /usr/share/podman/test/system/252-quadlet.bats:345:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 343| # 344| @test "quadlet - oneshot" { # 345|-> local quadlet_file=$PODMAN_TMPDIR/oneshot_$(safename).container # 346| cat > $quadlet_file <<EOF # 347| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def332] /usr/share/podman/test/system/252-quadlet.bats:368:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 366| # 367| @test "quadlet - volume" { # 368|-> local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).volume # 369| cat > $quadlet_file <<EOF # 370| [Volume] Error: SHELLCHECK_WARNING (CWE-571): [#def333] /usr/share/podman/test/system/252-quadlet.bats:378:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 376| service_setup $QUADLET_SERVICE_NAME # 377| # 378|-> local volume_name=systemd-$(basename $quadlet_file .volume) # 379| run_podman volume ls # 380| is "$output" ".*local.*${volume_name}.*" Error: SHELLCHECK_WARNING (CWE-571): [#def334] /usr/share/podman/test/system/252-quadlet.bats:394:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 392| @test "quadlet - volume dependency" { # 393| # Save the unit name to use as the volume for the container # 394|-> local quadlet_vol_unit=dep_$(safename).volume # 395| local quadlet_vol_file=$PODMAN_TMPDIR/${quadlet_vol_unit} # 396| cat > $quadlet_vol_file <<EOF Error: SHELLCHECK_WARNING (CWE-571): [#def335] /usr/share/podman/test/system/252-quadlet.bats:400:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 398| EOF # 399| # 400|-> local quadlet_tmpdir=$(mktemp -d --tmpdir=$PODMAN_TMPDIR quadlet.XXXXXX) # 401| # Have quadlet create the systemd unit file for the volume unit # 402| run_quadlet "$quadlet_vol_file" "$quadlet_tmpdir" Error: SHELLCHECK_WARNING (CWE-571): [#def336] /usr/share/podman/test/system/252-quadlet.bats:406:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 404| # Save the volume service name since the variable will be overwritten # 405| local vol_service=$QUADLET_SERVICE_NAME # 406|-> local volume_name=systemd-$(basename $quadlet_vol_file .volume) # 407| # 408| local quadlet_file=$PODMAN_TMPDIR/user_$(safename).container Error: SHELLCHECK_WARNING (CWE-571): [#def337] /usr/share/podman/test/system/252-quadlet.bats:408:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 406| local volume_name=systemd-$(basename $quadlet_vol_file .volume) # 407| # 408|-> local quadlet_file=$PODMAN_TMPDIR/user_$(safename).container # 409| cat > $quadlet_file <<EOF # 410| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def338] /usr/share/podman/test/system/252-quadlet.bats:443:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 441| # A quadlet container depends on a named quadlet volume # 442| @test "quadlet - named volume dependency" { # 443|-> local volume_name="v-$(safename)" # 444| # 445| # Save the unit name to use as the volume for the container Error: SHELLCHECK_WARNING (CWE-571): [#def339] /usr/share/podman/test/system/252-quadlet.bats:446:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 444| # 445| # Save the unit name to use as the volume for the container # 446|-> local quadlet_vol_unit=dep_$(safename).volume # 447| local quadlet_vol_file=$PODMAN_TMPDIR/${quadlet_vol_unit} # 448| cat > $quadlet_vol_file <<EOF Error: SHELLCHECK_WARNING (CWE-571): [#def340] /usr/share/podman/test/system/252-quadlet.bats:454:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 452| # 453| # Have quadlet create the systemd unit file for the volume unit # 454|-> local quadlet_tmpdir=$(mktemp -d --tmpdir=$PODMAN_TMPDIR quadlet.XXXXXX) # 455| run_quadlet "$quadlet_vol_file" "$quadlet_tmpdir" # 456| Error: SHELLCHECK_WARNING (CWE-571): [#def341] /usr/share/podman/test/system/252-quadlet.bats:460:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 458| local vol_service=$QUADLET_SERVICE_NAME # 459| # 460|-> local quadlet_file=$PODMAN_TMPDIR/user_$(safename).container # 461| cat > $quadlet_file <<EOF # 462| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def342] /usr/share/podman/test/system/252-quadlet.bats:473:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 471| # Save the container service name for readability # 472| local container_service=$QUADLET_SERVICE_NAME # 473|-> local container_name=systemd-$(basename $quadlet_file .container) # 474| # 475| # Volume should not exist Error: SHELLCHECK_WARNING (CWE-571): [#def343] /usr/share/podman/test/system/252-quadlet.bats:498:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 496| # 497| @test "quadlet - network" { # 498|-> local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).network # 499| cat > $quadlet_file <<EOF # 500| [Network] Error: SHELLCHECK_WARNING (CWE-571): [#def344] /usr/share/podman/test/system/252-quadlet.bats:508:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 506| service_setup $QUADLET_SERVICE_NAME # 507| # 508|-> local network_name=systemd-$(basename $quadlet_file .network) # 509| run_podman network exists $network_name # 510| Error: SHELLCHECK_WARNING (CWE-571): [#def345] /usr/share/podman/test/system/252-quadlet.bats:523:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 521| @test "quadlet - network dependency" { # 522| # Save the unit name to use as the network for the container # 523|-> local quadlet_network_unit=dep_$(safename).network # 524| local quadlet_network_file=$PODMAN_TMPDIR/${quadlet_network_unit} # 525| cat > $quadlet_network_file <<EOF Error: SHELLCHECK_WARNING (CWE-571): [#def346] /usr/share/podman/test/system/252-quadlet.bats:529:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 527| EOF # 528| # 529|-> local quadlet_tmpdir=$(mktemp -d --tmpdir=$PODMAN_TMPDIR quadlet.XXXXXX) # 530| # Have quadlet create the systemd unit file for the network unit # 531| run_quadlet "$quadlet_network_file" "$quadlet_tmpdir" Error: SHELLCHECK_WARNING (CWE-571): [#def347] /usr/share/podman/test/system/252-quadlet.bats:535:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 533| # Save the volume service name since the variable will be overwritten # 534| local network_service=$QUADLET_SERVICE_NAME # 535|-> local network_name=systemd-$(basename $quadlet_network_file .network) # 536| # 537| local quadlet_file=$PODMAN_TMPDIR/user_$(safename).container Error: SHELLCHECK_WARNING (CWE-571): [#def348] /usr/share/podman/test/system/252-quadlet.bats:537:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 535| local network_name=systemd-$(basename $quadlet_network_file .network) # 536| # 537|-> local quadlet_file=$PODMAN_TMPDIR/user_$(safename).container # 538| cat > $quadlet_file <<EOF # 539| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def349] /usr/share/podman/test/system/252-quadlet.bats:570:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 568| @test "quadlet - named network dependency" { # 569| # Save the unit name to use as the network for the container # 570|-> local quadlet_network_unit=dep_$(safename).network # 571| local quadlet_network_file=$PODMAN_TMPDIR/${quadlet_network_unit} # 572| cat > $quadlet_network_file <<EOF Error: SHELLCHECK_WARNING (CWE-571): [#def350] /usr/share/podman/test/system/252-quadlet.bats:578:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 576| # 577| # Have quadlet create the systemd unit file for the network unit # 578|-> local quadlet_tmpdir=$(mktemp -d --tmpdir=$PODMAN_TMPDIR quadlet.XXXXXX) # 579| run_quadlet "$quadlet_network_file" "$quadlet_tmpdir" # 580| Error: SHELLCHECK_WARNING (CWE-571): [#def351] /usr/share/podman/test/system/252-quadlet.bats:585:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 583| local network_name="foo" # 584| # 585|-> local quadlet_file=$PODMAN_TMPDIR/user_$(safename).container # 586| cat > $quadlet_file <<EOF # 587| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def352] /usr/share/podman/test/system/252-quadlet.bats:597:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 595| # Save the container service name for readability # 596| local container_service=$QUADLET_SERVICE_NAME # 597|-> local container_name=systemd-$(basename $quadlet_file .container) # 598| # 599| # Network should not exist Error: SHELLCHECK_WARNING (CWE-571): [#def353] /usr/share/podman/test/system/252-quadlet.bats:643:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 641| # 642| # Create the Quadlet file # 643|-> local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).kube # 644| cat > $quadlet_file <<EOF # 645| [Kube] Error: SHELLCHECK_WARNING (CWE-571): [#def354] /usr/share/podman/test/system/252-quadlet.bats:663:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 661| @test "quadlet kube - named network dependency" { # 662| # Save the unit name to use as the network for the container # 663|-> local quadlet_network_unit=dep_$(safename).network # 664| local quadlet_network_file=$PODMAN_TMPDIR/${quadlet_network_unit} # 665| local network_name="n-$(safename)" Error: SHELLCHECK_WARNING (CWE-571): [#def355] /usr/share/podman/test/system/252-quadlet.bats:665:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 663| local quadlet_network_unit=dep_$(safename).network # 664| local quadlet_network_file=$PODMAN_TMPDIR/${quadlet_network_unit} # 665|-> local network_name="n-$(safename)" # 666| cat > $quadlet_network_file <<EOF # 667| [Network] Error: SHELLCHECK_WARNING (CWE-571): [#def356] /usr/share/podman/test/system/252-quadlet.bats:672:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 670| # 671| # Have quadlet create the systemd unit file for the network unit # 672|-> local quadlet_tmpdir=$(mktemp -d --tmpdir=$PODMAN_TMPDIR quadlet.XXXXXX) # 673| run_quadlet "$quadlet_network_file" "$quadlet_tmpdir" # 674| Error: SHELLCHECK_WARNING (CWE-571): [#def357] /usr/share/podman/test/system/252-quadlet.bats:701:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 699| # 700| # Create the Quadlet file # 701|-> local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).kube # 702| cat > $quadlet_file <<EOF # 703| [Kube] Error: SHELLCHECK_WARNING (CWE-571): [#def358] /usr/share/podman/test/system/252-quadlet.bats:746:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 744| mountpoint="$output" # 745| # 746|-> local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).container # 747| cat > $quadlet_file <<EOF # 748| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def359] /usr/share/podman/test/system/252-quadlet.bats:767:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 765| @test "quadlet - selinux disable" { # 766| skip_if_no_selinux # 767|-> local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).container # 768| cat > $quadlet_file <<EOF # 769| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def360] /usr/share/podman/test/system/252-quadlet.bats:790:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 788| skip_if_no_selinux # 789| NAME=name$(safename) # 790|-> local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).container # 791| cat > $quadlet_file <<EOF # 792| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def361] /usr/share/podman/test/system/252-quadlet.bats:819:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 817| create_secret # 818| # 819|-> local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).container # 820| cat > $quadlet_file <<EOF # 821| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def362] /usr/share/podman/test/system/252-quadlet.bats:845:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 843| create_secret # 844| # 845|-> local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).container # 846| cat > $quadlet_file <<EOF # 847| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def363] /usr/share/podman/test/system/252-quadlet.bats:874:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 872| # seem to be any systemctly way to find this. # 873| percent_t_file="${PODMAN_TMPDIR}/foo" # 874|-> local service=get-percent-t.$(safename).service # 875| local unitfile=${UNIT_DIR}/$service # 876| cat >$unitfile <<EOF Error: SHELLCHECK_WARNING (CWE-571): [#def364] /usr/share/podman/test/system/252-quadlet.bats:894:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 892| # 893| # Step 2: Make a subdirectory in %T, and in there, a scratch file # 894|-> local tmp_path=$(mktemp -d --tmpdir=${percent_t} quadlet.volume.XXXXXX) # 895| local tmp_subdir=$(basename $tmp_path) # 896| local file_name="f$(random_string 10).txt" Error: SHELLCHECK_WARNING (CWE-571): [#def365] /usr/share/podman/test/system/252-quadlet.bats:895:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 893| # Step 2: Make a subdirectory in %T, and in there, a scratch file # 894| local tmp_path=$(mktemp -d --tmpdir=${percent_t} quadlet.volume.XXXXXX) # 895|-> local tmp_subdir=$(basename $tmp_path) # 896| local file_name="f$(random_string 10).txt" # 897| local file_content="data_$(random_string 15)" Error: SHELLCHECK_WARNING (CWE-571): [#def366] /usr/share/podman/test/system/252-quadlet.bats:896:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 894| local tmp_path=$(mktemp -d --tmpdir=${percent_t} quadlet.volume.XXXXXX) # 895| local tmp_subdir=$(basename $tmp_path) # 896|-> local file_name="f$(random_string 10).txt" # 897| local file_content="data_$(random_string 15)" # 898| echo $file_content > $tmp_path/$file_name Error: SHELLCHECK_WARNING (CWE-571): [#def367] /usr/share/podman/test/system/252-quadlet.bats:897:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 895| local tmp_subdir=$(basename $tmp_path) # 896| local file_name="f$(random_string 10).txt" # 897|-> local file_content="data_$(random_string 15)" # 898| echo $file_content > $tmp_path/$file_name # 899| Error: SHELLCHECK_WARNING (CWE-571): [#def368] /usr/share/podman/test/system/252-quadlet.bats:900:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 898| echo $file_content > $tmp_path/$file_name # 899| # 900|-> local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).container # 901| cat > $quadlet_file <<EOF # 902| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def369] /usr/share/podman/test/system/252-quadlet.bats:921:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 919| # 920| @test "quadlet - tmpfs" { # 921|-> local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).container # 922| cat > $quadlet_file <<EOF # 923| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def370] /usr/share/podman/test/system/252-quadlet.bats:946:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 944| # 945| @test "quadlet - userns" { # 946|-> local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).container # 947| cat > $quadlet_file <<EOF # 948| [Container] Error: SHELLCHECK_WARNING (CWE-571): [#def371] /usr/share/podman/test/system/252-quadlet.bats:972:13: warning[SC2155]: Declare and assign separately to avoid masking return values. # 970| " # 971| while read exit_code_prop cmd exit_code service_state; do # 972|-> local basename=propagate-${exit_code_prop}-${cmd}_$(safename) # 973| local quadlet_file=$PODMAN_TMPDIR/$basename.kube # 974| local yaml_file=$PODMAN_TMPDIR/$basename.yaml Error: SHELLCHECK_WARNING: [#def372] /usr/share/podman/test/system/252-quadlet.bats:1011:30: warning[SC2076]: Remove quotes from right-hand side of =~ to match as a regex rather than literally. # 1009| for tries in $(seq 1 5); do # 1010| run journalctl "--since=$STARTED_TIME" --unit="$QUADLET_SERVICE_NAME" # 1011|-> if [[ "$output" =~ "Started.*\.service" ]]; then # 1012| break # 1013| fi Error: SHELLCHECK_WARNING (CWE-571): [#def373] /usr/share/podman/test/system/252-quadlet.bats:1086:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1084| # 1085| # Create the Quadlet file # 1086|-> local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).kube # 1087| cat > $quadlet_file <<EOF # 1088| [Kube] Error: SHELLCHECK_WARNING (CWE-156): [#def374] /usr/share/podman/test/system/252-quadlet.bats:1105:8: warning[SC2046]: Quote this to prevent word splitting. # 1103| # 1104| run_podman exec $pod_name-$container_name /bin/sh -c "echo hello > /test/test.txt" # 1105|-> is $(cat $PODMAN_TMPDIR/$local_path/test.txt) "hello" # 1106| # 1107| service_cleanup $QUADLET_SERVICE_NAME inactive Error: SHELLCHECK_WARNING (CWE-571): [#def375] /usr/share/podman/test/system/252-quadlet.bats:1114:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1112| # 1113| local registry=localhost:${PODMAN_LOGIN_REGISTRY_PORT} # 1114|-> local image_for_test=$registry/i-$(safename):$(random_string) # 1115| local authfile=$PODMAN_TMPDIR/authfile.json # 1116| Error: SHELLCHECK_WARNING (CWE-571): [#def376] /usr/share/podman/test/system/252-quadlet.bats:1117:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1115| local authfile=$PODMAN_TMPDIR/authfile.json # 1116| # 1117|-> local quadlet_image_unit=image_test_$(safename).image # 1118| local quadlet_image_file=$PODMAN_TMPDIR/$quadlet_image_unit # 1119| cat > $quadlet_image_file <<EOF Error: SHELLCHECK_WARNING (CWE-571): [#def377] /usr/share/podman/test/system/252-quadlet.bats:1126:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1124| EOF # 1125| # 1126|-> local quadlet_volume_unit=image_test_$(safename).volume # 1127| local quadlet_volume_file=$PODMAN_TMPDIR/$quadlet_volume_unit # 1128| local volume_name=systemd-$(basename $quadlet_volume_file .volume) Error: SHELLCHECK_WARNING (CWE-571): [#def378] /usr/share/podman/test/system/252-quadlet.bats:1128:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1126| local quadlet_volume_unit=image_test_$(safename).volume # 1127| local quadlet_volume_file=$PODMAN_TMPDIR/$quadlet_volume_unit # 1128|-> local volume_name=systemd-$(basename $quadlet_volume_file .volume) # 1129| cat > $quadlet_volume_file <<EOF # 1130| [Volume] Error: SHELLCHECK_WARNING (CWE-571): [#def379] /usr/share/podman/test/system/252-quadlet.bats:1135:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1133| EOF # 1134| # 1135|-> local quadlet_container_unit=image_test_$(safename).container # 1136| local quadlet_container_file=$PODMAN_TMPDIR/$quadlet_container_unit # 1137| cat > $quadlet_container_file <<EOF Error: SHELLCHECK_WARNING (CWE-571): [#def380] /usr/share/podman/test/system/252-quadlet.bats:1241:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1239| @test "quadlet - kube oneshot" { # 1240| local quadlet_tmpdir=$PODMAN_TMPDIR/quadlets # 1241|-> local test_random_string=r_$(safename) # 1242| # 1243| local quadlet_kube_volume_name=test-volume_$test_random_string Error: SHELLCHECK_WARNING (CWE-571): [#def381] /usr/share/podman/test/system/252-quadlet.bats:1269:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1267| EOF # 1268| # 1269|-> local pod_name="p-$(safename)" # 1270| local container_name="c-$(safename)" # 1271| local quadlet_kube_pod_yaml_file=$PODMAN_TMPDIR/pod_$test_random_string.yaml Error: SHELLCHECK_WARNING (CWE-571): [#def382] /usr/share/podman/test/system/252-quadlet.bats:1270:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1268| # 1269| local pod_name="p-$(safename)" # 1270|-> local container_name="c-$(safename)" # 1271| local quadlet_kube_pod_yaml_file=$PODMAN_TMPDIR/pod_$test_random_string.yaml # 1272| cat > $quadlet_kube_pod_yaml_file <<EOF Error: SHELLCHECK_WARNING (CWE-571): [#def383] /usr/share/podman/test/system/252-quadlet.bats:1346:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1344| # 1345| @test "quadlet - kube down force" { # 1346|-> local test_random_string=$(random_string) # 1347| # 1348| local quadlet_kube_volume_name=test-volume_$test_random_string Error: SHELLCHECK_WARNING (CWE-571): [#def384] /usr/share/podman/test/system/252-quadlet.bats:1349:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1347| # 1348| local quadlet_kube_volume_name=test-volume_$test_random_string # 1349|-> local pod_name="p-$(safename)" # 1350| local container_name="c-$(safename)" # 1351| local quadlet_kube_pod_yaml_file=$PODMAN_TMPDIR/pod_$test_random_string.yaml Error: SHELLCHECK_WARNING (CWE-571): [#def385] /usr/share/podman/test/system/252-quadlet.bats:1350:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1348| local quadlet_kube_volume_name=test-volume_$test_random_string # 1349| local pod_name="p-$(safename)" # 1350|-> local container_name="c-$(safename)" # 1351| local quadlet_kube_pod_yaml_file=$PODMAN_TMPDIR/pod_$test_random_string.yaml # 1352| cat > $quadlet_kube_pod_yaml_file <<EOF Error: SHELLCHECK_WARNING (CWE-571): [#def386] /usr/share/podman/test/system/252-quadlet.bats:1426:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1424| local quadlet_tmpdir=$PODMAN_TMPDIR/quadlets # 1425| local archive_file=$PODMAN_TMPDIR/archive-file.tar # 1426|-> local image_for_test=localhost/i-$(safename):$(random_string) # 1427| # 1428| local quadlet_image_unit=image_test_$(safename).image Error: SHELLCHECK_WARNING (CWE-571): [#def387] /usr/share/podman/test/system/252-quadlet.bats:1428:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1426| local image_for_test=localhost/i-$(safename):$(random_string) # 1427| # 1428|-> local quadlet_image_unit=image_test_$(safename).image # 1429| local quadlet_image_file=$PODMAN_TMPDIR/$quadlet_image_unit # 1430| cat > $quadlet_image_file <<EOF Error: SHELLCHECK_WARNING (CWE-571): [#def388] /usr/share/podman/test/system/252-quadlet.bats:1436:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1434| EOF # 1435| # 1436|-> local quadlet_volume_unit=image_test_$(safename).volume # 1437| local quadlet_volume_file=$PODMAN_TMPDIR/$quadlet_volume_unit # 1438| local volume_name=systemd-$(basename $quadlet_volume_file .volume) Error: SHELLCHECK_WARNING (CWE-571): [#def389] /usr/share/podman/test/system/252-quadlet.bats:1438:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1436| local quadlet_volume_unit=image_test_$(safename).volume # 1437| local quadlet_volume_file=$PODMAN_TMPDIR/$quadlet_volume_unit # 1438|-> local volume_name=systemd-$(basename $quadlet_volume_file .volume) # 1439| cat > $quadlet_volume_file <<EOF # 1440| [Volume] Error: SHELLCHECK_WARNING (CWE-571): [#def390] /usr/share/podman/test/system/252-quadlet.bats:1445:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1443| EOF # 1444| # 1445|-> local quadlet_container_unit=image_test_$(safename).container # 1446| local quadlet_container_file=$PODMAN_TMPDIR/$quadlet_container_unit # 1447| cat > $quadlet_container_file <<EOF Error: SHELLCHECK_WARNING (CWE-571): [#def391] /usr/share/podman/test/system/252-quadlet.bats:1518:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1516| local quadlet_tmpdir=$PODMAN_TMPDIR/quadlets # 1517| # 1518|-> local test_pod_name=pod_test_$(safename) # 1519| local quadlet_pod_unit=$test_pod_name.pod # 1520| local quadlet_pod_file=$PODMAN_TMPDIR/$quadlet_pod_unit Error: SHELLCHECK_WARNING (CWE-571): [#def392] /usr/share/podman/test/system/252-quadlet.bats:1526:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1524| EOF # 1525| # 1526|-> local quadlet_container_unit=pod_test_$(safename).container # 1527| local quadlet_container_file=$PODMAN_TMPDIR/$quadlet_container_unit # 1528| cat > $quadlet_container_file <<EOF Error: SHELLCHECK_WARNING (CWE-563): [#def393] /usr/share/podman/test/system/252-quadlet.bats:1567:5: warning[SC2034]: tries appears unused. Verify use (or export if used externally). # 1565| # 1566| # It might take a few seconds to go inactive, esp. under heavy load # 1567|-> for tries in $(seq 1 5); do # 1568| run systemctl show --property=ActiveState "$container_service" # 1569| if [[ "$output" = "ActiveState=inactive" ]]; then Error: SHELLCHECK_WARNING (CWE-571): [#def394] /usr/share/podman/test/system/252-quadlet.bats:1590:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1588| # FIXME: how to make this parallel-safe? Can we? # 1589| local untagged_image=quay.io/libpod/busybox # 1590|-> local built_image="built-$(safename)" # 1591| local yaml_dir=$quadlet_tmpdir/$built_image # 1592| local build_dir=$yaml_dir/$built_image Error: SHELLCHECK_WARNING (CWE-571): [#def395] /usr/share/podman/test/system/252-quadlet.bats:1625:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1623| # 1624| # Create the Quadlet file # 1625|-> local quadlet_file=$quadlet_tmpdir/build_$(safename).kube # 1626| cat > $quadlet_file <<EOF # 1627| [Kube] Error: SHELLCHECK_WARNING (CWE-571): [#def396] /usr/share/podman/test/system/252-quadlet.bats:1652:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1650| local quadlet_tmpdir="${PODMAN_TMPDIR}/dropins" # 1651| # 1652|-> local quadlet_file="truncated-$(safename).container" # 1653| # 1654| local -A dropin_dirs=( Error: SHELLCHECK_WARNING (CWE-398): [#def397] /usr/share/podman/test/system/255-auto-update.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Tests for automatically update images for containerized services Error: SHELLCHECK_WARNING (CWE-252): [#def398] /usr/share/podman/test/system/255-auto-update.bats:96:6: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. # 94| run_podman create $extraArgs --name $cname $label $target_img $command # 95| # 96|-> (cd $UNIT_DIR; run_podman generate systemd --new --files --name $requires $cname) # 97| echo "container-$cname" >> $SNAME_FILE # 98| run_podman rm -t 0 -f $cname Error: SHELLCHECK_WARNING (CWE-153): [#def399] /usr/share/podman/test/system/255-auto-update.bats:143:28: warning[SC2053]: Quote the right-hand side of != in [[ ]] to prevent glob matching. # 141| die "podman inspect $cname failed unexpectedly" # 142| fi # 143|-> elif [[ $output != $old_iid ]]; then # 144| return # 145| fi Error: SHELLCHECK_WARNING (CWE-456): [#def400] /usr/share/podman/test/system/255-auto-update.bats:323:5: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string). # 321| RUN chmod +x /runme # 322| EOF # 323|-> image=test # 324| # 325| # Generate a healthy image that will run correctly. Error: SHELLCHECK_WARNING (CWE-571): [#def401] /usr/share/podman/test/system/255-auto-update.bats:359:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 357| local -A will_update=([image]=1 [registry]=1 [local]=1) # 358| # 359|-> local fakevalue=fake_$(random_string) # 360| for auto_update in image registry "" disabled "''" $fakevalue local # 361| do Error: SHELLCHECK_WARNING (CWE-569): [#def402] /usr/share/podman/test/system/255-auto-update.bats:360:52: warning[SC2089]: Quotes/backslashes will be treated literally. Use an array. # 358| # 359| local fakevalue=fake_$(random_string) # 360|-> for auto_update in image registry "" disabled "''" $fakevalue local # 361| do # 362| local img_base="alpine" Error: SHELLCHECK_WARNING (CWE-569): [#def403] /usr/share/podman/test/system/255-auto-update.bats:368:36: warning[SC2090]: Quotes/backslashes in this variable will not be respected. # 366| img_base="localtest" # 367| fi # 368|-> generate_service $img_base $auto_update # 369| cnames+=($cname) # 370| if [[ $auto_update == "local" ]]; then Error: SHELLCHECK_WARNING (CWE-140): [#def404] /usr/share/podman/test/system/255-auto-update.bats:369:18: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. # 367| fi # 368| generate_service $img_base $auto_update # 369|-> cnames+=($cname) # 370| if [[ $auto_update == "local" ]]; then # 371| local_cname=$cname Error: SHELLCHECK_WARNING (CWE-571): [#def405] /usr/share/podman/test/system/255-auto-update.bats:390:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 388| is "$update_log" ".*Error: invalid auto-update policy.*" "invalid policy setup" # 389| # 390|-> local n_updated=$(grep -c 'Trying to pull' <<<"$update_log") # 391| is "$n_updated" "2" "Number of images updated from registry." # 392| Error: SHELLCHECK_WARNING (CWE-457): [#def406] /usr/share/podman/test/system/255-auto-update.bats:436:25: warning[SC2154]: http_proxy is referenced but not assigned. # 434| Type=oneshot # 435| ExecStart=$PODMAN auto-update # 436|-> Environment="http_proxy=${http_proxy}" # 437| Environment="HTTP_PROXY=${HTTP_PROXY}" # 438| Environment="https_proxy=${https_proxy}" Error: SHELLCHECK_WARNING (CWE-457): [#def407] /usr/share/podman/test/system/255-auto-update.bats:438:26: warning[SC2154]: https_proxy is referenced but not assigned. # 436| Environment="http_proxy=${http_proxy}" # 437| Environment="HTTP_PROXY=${HTTP_PROXY}" # 438|-> Environment="https_proxy=${https_proxy}" # 439| Environment="HTTPS_PROXY=${HTTPS_PROXY}" # 440| Environment="no_proxy=${no_proxy}" Error: SHELLCHECK_WARNING (CWE-457): [#def408] /usr/share/podman/test/system/255-auto-update.bats:440:23: warning[SC2154]: no_proxy is referenced but not assigned. # 438| Environment="https_proxy=${https_proxy}" # 439| Environment="HTTPS_PROXY=${HTTPS_PROXY}" # 440|-> Environment="no_proxy=${no_proxy}" # 441| Environment="NO_PROXY=${NO_PROXY}" # 442| Error: SHELLCHECK_WARNING (CWE-156): [#def409] /usr/share/podman/test/system/255-auto-update.bats:566:23: warning[SC2046]: Quote this to prevent word splitting. # 564| # Clean up # 565| systemctl stop $service_name # 566|-> run_podman rmi -f $(pause_image) $local_image $newID $oldID # 567| run_podman network rm podman-default-kube-network # 568| rm -f $UNIT_DIR/$unit_name Error: SHELLCHECK_WARNING (CWE-457): [#def410] /usr/share/podman/test/system/255-auto-update.bats:568:21: warning[SC2154]: unit_name is referenced but not assigned. # 566| run_podman rmi -f $(pause_image) $local_image $newID $oldID # 567| run_podman network rm podman-default-kube-network # 568|-> rm -f $UNIT_DIR/$unit_name # 569| } # 570| Error: SHELLCHECK_WARNING (CWE-156): [#def411] /usr/share/podman/test/system/255-auto-update.bats:633:33: warning[SC2046]: Quote this to prevent word splitting. # 631| # 632| run_podman pod rm -f $podname # 633|-> run_podman rmi $local_image $(pause_image) # 634| rm -f $podunit $ctrunit # 635| systemctl daemon-reload Error: SHELLCHECK_WARNING (CWE-398): [#def412] /usr/share/podman/test/system/260-sdnotify.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Tests for systemd sdnotify Error: SHELLCHECK_WARNING (CWE-563): [#def413] /usr/share/podman/test/system/260-sdnotify.bats:58:5: warning[SC2034]: try appears unused. Verify use (or export if used externally). # 56| # Wait for socat to create the socket file. This _should_ be # 57| # instantaneous, but can take a few seconds under high load # 58|-> for try in $(seq 1 10); do # 59| if [[ -e "$NOTIFY_SOCKET" ]]; then # 60| return Error: SHELLCHECK_WARNING (CWE-571): [#def414] /usr/share/podman/test/system/260-sdnotify.bats:87:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 85| # Check that MAINPID=xxxxx points to a running conmon process # 86| function _assert_mainpid_is_conmon() { # 87|-> local mainpid=$(expr "$1" : ".*MAINPID=\([0-9]\+\)") # 88| test -n "$mainpid" || die "Could not parse '$1' as 'MAINPID=nnnn'" # 89| Error: SHELLCHECK_WARNING (CWE-571): [#def415] /usr/share/podman/test/system/260-sdnotify.bats:93:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 91| # 92| # e.g. /proc/12345/exe -> /usr/bin/conmon # 93|-> local mainpid_bin=$(readlink /proc/$mainpid/exe) # 94| is "$mainpid_bin" ".*/conmon" "sdnotify MAINPID=$mainpid is conmon process" # 95| } Error: SHELLCHECK_WARNING (CWE-563): [#def416] /usr/share/podman/test/system/260-sdnotify.bats:390:5: warning[SC2034]: i appears unused. Verify use (or export if used externally). # 388| # Wait for both containers to be running # 389| containers_running= # 390|-> for i in $(seq 1 20); do # 391| run_podman "?" container wait $container_a $container_b --condition="running" # 392| if [[ $status == 0 ]]; then Error: SHELLCHECK_WARNING (CWE-571): [#def417] /usr/share/podman/test/system/260-sdnotify.bats:458:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 456| local cmd2=$3 # 457| local sdnotify_policy=$4 # 458|-> local podname=p-$(safename) # 459| echo " # 460| apiVersion: v1 Error: SHELLCHECK_WARNING (CWE-149): [#def418] /usr/share/podman/test/system/260-sdnotify.bats:467:30: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them. # 465| name: $podname # 466| annotations: # 467|-> io.containers.sdnotify: "$sdnotify_policy" # 468| spec: # 469| restartPolicy: Never Error: SHELLCHECK_WARNING (CWE-571): [#def419] /usr/share/podman/test/system/260-sdnotify.bats:553:12: warning[SC2155]: Declare and assign separately to avoid masking return values. # 551| start_registry # 552| # 553|-> export NOTIFY_SOCKET=$PODMAN_TMPDIR/notify-$(safename).sock # 554| _start_socat # 555| Error: SHELLCHECK_WARNING (CWE-563): [#def420] /usr/share/podman/test/system/260-sdnotify.bats:585:5: warning[SC2034]: envfile appears unused. Verify use (or export if used externally). # 583| export NOTIFY_SOCKET=$PODMAN_TMPDIR/notify.sock # 584| podman_socket="unix://$PODMAN_TMPDIR/podman.sock" # 585|-> envfile=$PODMAN_TMPDIR/envfile # 586| _start_socat # 587| Error: SHELLCHECK_WARNING (CWE-398): [#def421] /usr/share/podman/test/system/270-socket-activation.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Tests podman system service under systemd socket activation Error: SHELLCHECK_WARNING (CWE-156): [#def422] /usr/share/podman/test/system/270-socket-activation.bats:67:21: warning[SC2046]: Quote this to prevent word splitting. # 65| local pause_pid_file="$XDG_RUNTIME_DIR/libpod/tmp/pause.pid" # 66| if [ -f $pause_pid_file ]; then # 67|-> kill -9 $(< $pause_pid_file) 2> /dev/null # 68| rm -f $pause_pid_file # 69| fi Error: SHELLCHECK_WARNING (CWE-156): [#def423] /usr/share/podman/test/system/270-socket-activation.bats:114:13: warning[SC2046]: Quote this to prevent word splitting. # 112| # 113| echo "kill -9 $(< $pause_pid_file) [pause process]" # 114|-> kill -9 $(< $pause_pid_file) # 115| # 116| run curl -s --max-time 3 --unix-socket $SERVICE_SOCK_ADDR $_PING Error: SHELLCHECK_WARNING (CWE-398): [#def424] /usr/share/podman/test/system/271-tcp-cors-server.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Tests podman system service CORS enabled Error: SHELLCHECK_WARNING (CWE-563): [#def425] /usr/share/podman/test/system/271-tcp-cors-server.bats:13:1: warning[SC2034]: SERVICE_FILE appears unused. Verify use (or export if used externally). # 11| SERVICE_TCP_HOST="127.0.0.1" # 12| # 13|-> SERVICE_FILE="$UNIT_DIR/$SERVICE_NAME.service" # 14| SOCKET_FILE="$UNIT_DIR/$SERVICE_NAME.socket" # 15| Error: SHELLCHECK_WARNING (CWE-563): [#def426] /usr/share/podman/test/system/271-tcp-cors-server.bats:14:1: warning[SC2034]: SOCKET_FILE appears unused. Verify use (or export if used externally). # 12| # 13| SERVICE_FILE="$UNIT_DIR/$SERVICE_NAME.service" # 14|-> SOCKET_FILE="$UNIT_DIR/$SERVICE_NAME.socket" # 15| # 16| # bats test_tags=ci:parallel Error: SHELLCHECK_WARNING (CWE-398): [#def427] /usr/share/podman/test/system/272-system-connection.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # tests for podman system connection Error: SHELLCHECK_WARNING (CWE-398): [#def428] /usr/share/podman/test/system/272-system-connection.bats:64:11: error[SC1087]: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). # 62| run_podman system connection ls # 63| is "$output" \ # 64|-> ".*$c1[ ]\+tcp://localhost:12345[ ]\+true[ ]\+true # 65| $c2[ ]\+tcp://localhost:54321[ ]\+false[ ]\+true" \ # 66| "system connection ls" Error: SHELLCHECK_WARNING (CWE-398): [#def429] /usr/share/podman/test/system/272-system-connection.bats:65:1: error[SC1087]: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). # 63| is "$output" \ # 64| ".*$c1[ ]\+tcp://localhost:12345[ ]\+true[ ]\+true # 65|-> $c2[ ]\+tcp://localhost:54321[ ]\+false[ ]\+true" \ # 66| "system connection ls" # 67| run_podman system connection ls -q Error: SHELLCHECK_WARNING (CWE-156): [#def430] /usr/share/podman/test/system/272-system-connection.bats:68:16: warning[SC2046]: Quote this to prevent word splitting. # 66| "system connection ls" # 67| run_podman system connection ls -q # 68|-> is "$(echo $(sort <<<$output))" \ # 69| "$c1 $c2" \ # 70| "system connection ls -q should show two names" Error: SHELLCHECK_WARNING (CWE-156): [#def431] /usr/share/podman/test/system/272-system-connection.bats:72:16: warning[SC2046]: Quote this to prevent word splitting. # 70| "system connection ls -q should show two names" # 71| run_podman context ls -q # 72|-> is "$(echo $(sort <<<$output))" \ # 73| "$c1 $c2" \ # 74| "context ls -q should show two names" Error: SHELLCHECK_WARNING (CWE-398): [#def432] /usr/share/podman/test/system/272-system-connection.bats:78:11: error[SC1087]: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). # 76| run_podman system connection ls # 77| is "$output" \ # 78|-> ".*$c1[ ]\+tcp://localhost:12345[ ]\+false[ ]\+true # 79| $c2[ ]\+tcp://localhost:54321[ ]\+true[ ]\+true" \ # 80| "system connection ls" Error: SHELLCHECK_WARNING (CWE-398): [#def433] /usr/share/podman/test/system/272-system-connection.bats:79:1: error[SC1087]: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). # 77| is "$output" \ # 78| ".*$c1[ ]\+tcp://localhost:12345[ ]\+false[ ]\+true # 79|-> $c2[ ]\+tcp://localhost:54321[ ]\+true[ ]\+true" \ # 80| "system connection ls" # 81| Error: SHELLCHECK_WARNING (CWE-398): [#def434] /usr/share/podman/test/system/272-system-connection.bats:85:21: error[SC1087]: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). # 83| run_podman system connection rm $c2 # 84| run_podman context ls # 85|-> is "$output" ".*$c1[ ]\+tcp://localhost:12345[ ]\+false[ ]\+true" \ # 86| "system connection ls (after removing default connection)" # 87| Error: SHELLCHECK_WARNING (CWE-156): [#def435] /usr/share/podman/test/system/272-system-connection.bats:111:25: warning[SC2046]: Quote this to prevent word splitting. # 109| # converts "podman-remote --opts" to just "podman", which is what # 110| # we need for the server. # 111|-> ${PODMAN%%-remote*} $(podman_isolation_opts ${PODMAN_TMPDIR}) \ # 112| system service -t 99 tcp://localhost:$_SERVICE_PORT & # 113| _SERVICE_PID=$! Error: SHELLCHECK_WARNING (CWE-398): [#def436] /usr/share/podman/test/system/280-update.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Tests for podman update Error: SHELLCHECK_WARNING (CWE-398): [#def437] /usr/share/podman/test/system/300-cli-parsing.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Various command-line parsing regression tests that don't fit in elsewhere Error: SHELLCHECK_WARNING (CWE-571): [#def438] /usr/share/podman/test/system/300-cli-parsing.bats:179:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 177| @test "podman run --env with glob" { # 178| # Set a bunch of different envariables with a common prefix # 179|-> local prefix="env$(random_string 10)" # 180| # 181| # prefix by itself Error: SHELLCHECK_WARNING (CWE-398): [#def439] /usr/share/podman/test/system/320-system-df.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # tests for podman system df Error: SHELLCHECK_WARNING (CWE-398): [#def440] /usr/share/podman/test/system/330-corrupt-images.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # All tests in here perform nasty manipulations on image storage. Error: SHELLCHECK_WARNING (CWE-571): [#def441] /usr/share/podman/test/system/330-corrupt-images.bats:13:12: warning[SC2155]: Declare and assign separately to avoid masking return values. # 11| # Create a scratch directory; this is what we'll use for image store and cache # 12| if [ -z "${PODMAN_CORRUPT_TEST_WORKDIR}" ]; then # 13|-> export PODMAN_CORRUPT_TEST_WORKDIR=$(mktemp -d --tmpdir=${BATS_TMPDIR:-${TMPDIR:-/tmp}} podman_corrupt_test.XXXXXX) # 14| fi # 15| Error: SHELLCHECK_WARNING (CWE-569): [#def442] /usr/share/podman/test/system/330-corrupt-images.bats:85:24: warning[SC2048]: Use "$@" (with quotes) to prevent whitespace problems. # 83| # 84| # Run the requested command. Confirm it succeeds, with suitable warnings. # 85|-> run_podman 0+w $* # 86| # There are three different variations on the warnings, allow each... # 87| allow_warnings "Failed to determine parent of image: .*, ignoring the error" \ Error: SHELLCHECK_WARNING (CWE-398): [#def443] /usr/share/podman/test/system/331-system-check.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Creates errors that should be caught by `system check`, and verifies Error: SHELLCHECK_WARNING (CWE-571): [#def444] /usr/share/podman/test/system/331-system-check.bats:203:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 201| # 202| function make_layer_blob() { # 203|-> local tmpdir=$(mktemp -d --tmpdir=${PODMAN_TMPDIR} make_layer_blob.XXXXXX) # 204| local blobfile # 205| local seqargs Error: SHELLCHECK_WARNING (CWE-571): [#def445] /usr/share/podman/test/system/331-system-check.bats:220:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 218| # 219| function testing_make_image_metadata_for_layer_blobs() { # 220|-> local tmpdir=$(mktemp -d --tmpdir=${PODMAN_TMPDIR} make_image_metadata.XXXXXX) # 221| local imageID=$1 # 222| shift Error: SHELLCHECK_WARNING (CWE-571): [#def446] /usr/share/podman/test/system/331-system-check.bats:227:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 225| local comma= # 226| for blob in "$@" ; do # 227|-> local sum=$(sha256sum $blob) # 228| sum=${sum%% *} # 229| local size=$(wc -c $blob) Error: SHELLCHECK_WARNING (CWE-571): [#def447] /usr/share/podman/test/system/331-system-check.bats:229:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 227| local sum=$(sha256sum $blob) # 228| sum=${sum%% *} # 229|-> local size=$(wc -c $blob) # 230| size=${size%% *} # 231| echo $comma '"sha256:'$sum'"' >> $tmpdir/config.json Error: SHELLCHECK_WARNING (CWE-398): [#def448] /usr/share/podman/test/system/400-unprivileged-access.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Tests #2730 - regular users are not able to read/write container storage Error: SHELLCHECK_WARNING (CWE-563): [#def449] /usr/share/podman/test/system/400-unprivileged-access.bats:21:5: warning[SC2034]: mount_path appears unused. Verify use (or export if used externally). # 19| # 20| run_podman mount c_mount # 21|-> mount_path=$output # 22| # 23| # Do all the work from within a test script. Since we'll be invoking it Error: SHELLCHECK_WARNING (CWE-140): [#def450] /usr/share/podman/test/system/400-unprivileged-access.bats:135:22: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. # 133| for mp in "${mps[@]}"; do # 134| if [ -e $mp ]; then # 135|-> subset+=($mp) # 136| fi # 137| done Error: SHELLCHECK_WARNING (CWE-398): [#def451] /usr/share/podman/test/system/410-selinux.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # 410-selinux - podman selinux tests Error: SHELLCHECK_WARNING (CWE-571): [#def452] /usr/share/podman/test/system/410-selinux.bats:201:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 199| # 200| # unique pod name helps when tracking down failure in journal # 201|-> local podname=p-$(safename) # 202| # 203| # We don't need a fullblown pause container; avoid pulling the k8s one Error: SHELLCHECK_WARNING (CWE-571): [#def453] /usr/share/podman/test/system/410-selinux.bats:229:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 227| # 228| # unique pod name helps when tracking down failure in journal # 229|-> local podname=p-$(safename) # 230| # 231| # We don't need a fullblown pause container; avoid pulling the k8s one Error: SHELLCHECK_WARNING (CWE-569): [#def454] /usr/share/podman/test/system/410-selinux.bats:395:72: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 393| run_podman run --rm -v $tmpdir:/test:Z --privileged $IMAGE true # 394| run ls -dZ $tmpdir # 395|-> is "$output" "${LABEL} $tmpdir" "Ignored private relabel Correctly"} # 396| umount $tmpdir # 397| Error: SHELLCHECK_WARNING (CWE-569): [#def455] /usr/share/podman/test/system/410-selinux.bats:400:74: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 398| run_podman run --rm -v $tmpdir:/test:z --privileged $IMAGE true # 399| run ls -dZ $tmpdir # 400|-> is "$output" "${RELABEL} $tmpdir" "Ignored private relabel Correctly"} # 401| } # 402| Error: SHELLCHECK_WARNING (CWE-398): [#def456] /usr/share/podman/test/system/420-cgroups.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # cgroups-related tests Error: SHELLCHECK_WARNING (CWE-398): [#def457] /usr/share/podman/test/system/500-networking.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Test podman local networking Error: SHELLCHECK_WARNING (CWE-571): [#def458] /usr/share/podman/test/system/500-networking.bats:24:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 22| # 23| # check deterministic list order # 24|-> local net1=net-a-$(safename) # 25| local net2=net-b-$(safename) # 26| local net3=net-c-$(safename) Error: SHELLCHECK_WARNING (CWE-571): [#def459] /usr/share/podman/test/system/500-networking.bats:25:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 23| # check deterministic list order # 24| local net1=net-a-$(safename) # 25|-> local net2=net-b-$(safename) # 26| local net3=net-c-$(safename) # 27| run_podman network create $net1 Error: SHELLCHECK_WARNING (CWE-571): [#def460] /usr/share/podman/test/system/500-networking.bats:26:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 24| local net1=net-a-$(safename) # 25| local net2=net-b-$(safename) # 26|-> local net3=net-c-$(safename) # 27| run_podman network create $net1 # 28| run_podman network create $net2 Error: SHELLCHECK_WARNING (CWE-571): [#def461] /usr/share/podman/test/system/500-networking.bats:166:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 164| # bats test_tags=ci:parallel # 165| @test "podman pod manages /etc/hosts correctly" { # 166|-> local pod_name=pod-$(safename) # 167| local infra_name=infra-$(safename) # 168| local con1_name=con1-$(safename) Error: SHELLCHECK_WARNING (CWE-571): [#def462] /usr/share/podman/test/system/500-networking.bats:167:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 165| @test "podman pod manages /etc/hosts correctly" { # 166| local pod_name=pod-$(safename) # 167|-> local infra_name=infra-$(safename) # 168| local con1_name=con1-$(safename) # 169| local con2_name=con2-$(safename) Error: SHELLCHECK_WARNING (CWE-571): [#def463] /usr/share/podman/test/system/500-networking.bats:168:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 166| local pod_name=pod-$(safename) # 167| local infra_name=infra-$(safename) # 168|-> local con1_name=con1-$(safename) # 169| local con2_name=con2-$(safename) # 170| run_podman pod create --name $pod_name --infra-name $infra_name Error: SHELLCHECK_WARNING (CWE-571): [#def464] /usr/share/podman/test/system/500-networking.bats:169:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 167| local infra_name=infra-$(safename) # 168| local con1_name=con1-$(safename) # 169|-> local con2_name=con2-$(safename) # 170| run_podman pod create --name $pod_name --infra-name $infra_name # 171| pid="$output" Error: SHELLCHECK_WARNING (CWE-571): [#def465] /usr/share/podman/test/system/500-networking.bats:206:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 204| CIDR="$(random_rfc1918_subnet)" # 205| IP=$(hostname -I | cut -f 1 -d " ") # 206|-> local conname=con-$(safename) # 207| run_podman run --rm --network slirp4netns:cidr="${CIDR}.0/24" \ # 208| --name $conname --hostname $conname $IMAGE cat /etc/hosts Error: SHELLCHECK_WARNING (CWE-571): [#def466] /usr/share/podman/test/system/500-networking.bats:256:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 254| myport=$(random_free_port) # 255| # 256|-> local mynetname=testnet-$(safename) # 257| local mysubnet=$(random_rfc1918_subnet) # 258| Error: SHELLCHECK_WARNING (CWE-571): [#def467] /usr/share/podman/test/system/500-networking.bats:257:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 255| # 256| local mynetname=testnet-$(safename) # 257|-> local mysubnet=$(random_rfc1918_subnet) # 258| # 259| run_podman network create --subnet "${mysubnet}.0/24" $mynetname Error: SHELLCHECK_WARNING (CWE-571): [#def468] /usr/share/podman/test/system/500-networking.bats:270:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 268| "sdfsdf" # 269| # 270|-> local cname="c-$(safename)" # 271| run_podman run -d --network $mynetname --name $cname -p 127.0.0.1:$myport:$myport \ # 272| $IMAGE nc -l -n -v -p $myport Error: SHELLCHECK_WARNING (CWE-571): [#def469] /usr/share/podman/test/system/500-networking.bats:329:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 327| # 328| # Bind-mount this file with a different name to a container running httpd # 329|-> local cname=c-$(safename) # 330| run_podman run -d --name $cname -p "$HOST_PORT:80" \ # 331| --network $netname \ Error: SHELLCHECK_WARNING (CWE-571): [#def470] /usr/share/podman/test/system/500-networking.bats:429:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 427| is_rootless || skip "only meaningful for rootless" # 428| # 429|-> local mynetname=testnet-$(safename) # 430| run_podman --noout network create $mynetname # 431| is "$output" "" "output should be empty" Error: SHELLCHECK_WARNING (CWE-571): [#def471] /usr/share/podman/test/system/500-networking.bats:470:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 468| # 469| # ipv4 cni # 470|-> local mysubnet=$(random_rfc1918_subnet) # 471| local netname=testnet1-$(safename) # 472| Error: SHELLCHECK_WARNING (CWE-571): [#def472] /usr/share/podman/test/system/500-networking.bats:471:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 469| # ipv4 cni # 470| local mysubnet=$(random_rfc1918_subnet) # 471|-> local netname=testnet1-$(safename) # 472| # 473| run_podman network create --subnet $mysubnet.0/24 $netname Error: SHELLCHECK_WARNING (CWE-571): [#def473] /usr/share/podman/test/system/500-networking.bats:505:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 503| echo $random_1 > $INDEX1 # 504| # 505|-> local netname=testnet1-$(safename) # 506| run_podman network create $netname # 507| is "$output" "$netname" "output of 'network create'" Error: SHELLCHECK_WARNING (CWE-571): [#def474] /usr/share/podman/test/system/500-networking.bats:509:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 507| is "$output" "$netname" "output of 'network create'" # 508| # 509|-> local netname2=testnet2-$(safename) # 510| run_podman network create $netname2 # 511| is "$output" "$netname2" "output of 'network create'" Error: SHELLCHECK_WARNING (CWE-571): [#def475] /usr/share/podman/test/system/500-networking.bats:518:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 516| background_cid=$output # 517| # 518|-> local hostname=host-$(safename) # 519| # Run a httpd container on first network with exposed port # 520| run_podman run -d -p "$HOST_PORT:80" \ Error: SHELLCHECK_WARNING (CWE-571): [#def476] /usr/share/podman/test/system/500-networking.bats:621:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 619| echo $random_1 > $INDEX1 # 620| # 621|-> local netname=testnet-$(safename) # 622| run_podman network create $netname # 623| is "$output" "$netname" "output of 'network create'" Error: SHELLCHECK_WARNING (CWE-571): [#def477] /usr/share/podman/test/system/500-networking.bats:631:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 629| for network in "${networks[@]}"; do # 630| # Start container with the restart always policy # 631|-> local cname=c-$(safename) # 632| run_podman run -d --name $cname -p "$HOST_PORT:80" \ # 633| --restart always \ Error: SHELLCHECK_WARNING (CWE-571): [#def478] /usr/share/podman/test/system/500-networking.bats:726:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 724| # 725| # create network with dns # 726|-> local netname=testnet-$(safename) # 727| local subnet=$(random_rfc1918_subnet) # 728| run_podman network create --subnet "$subnet.0/24" $netname Error: SHELLCHECK_WARNING (CWE-571): [#def479] /usr/share/podman/test/system/500-networking.bats:727:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 725| # create network with dns # 726| local netname=testnet-$(safename) # 727|-> local subnet=$(random_rfc1918_subnet) # 728| run_podman network create --subnet "$subnet.0/24" $netname # 729| # custom server overwrites the network dns server Error: SHELLCHECK_WARNING (CWE-571): [#def480] /usr/share/podman/test/system/500-networking.bats:782:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 780| # 781| for netmode in "${netmodes[@]}"; do # 782|-> local range=$(random_free_port_range 3) # 783| # die() inside $(...) does not actually stop us. # 784| assert "$range" != "" "Could not find free port range" Error: SHELLCHECK_WARNING (CWE-571): [#def481] /usr/share/podman/test/system/500-networking.bats:788:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 786| local port="${range%-*}" # 787| local end_port="${range#*-}" # 788|-> local random=$(random_string) # 789| # 790| run_podman run --network $netmode -p "$range:$range" -d $IMAGE sleep inf Error: SHELLCHECK_WARNING (CWE-398): [#def482] /usr/share/podman/test/system/500-networking.bats:851:21: error[SC1087]: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). # 849| # 850| CONTAINERS_CONF_OVERRIDE=$containersconf run_podman run --rm --add-host $name3:$ip3 $IMAGE cat /etc/hosts # 851|-> is "$output" ".*$ip3[[:blank:]]$name3.*" "--add-host entry in /etc/host" # 852| is "$output" ".*$ip1[[:blank:]]$name1.*" "first base entry in /etc/host" # 853| is "$output" ".*$ip2[[:blank:]]$name2.*" "second base entry in /etc/host" Error: SHELLCHECK_WARNING (CWE-398): [#def483] /usr/share/podman/test/system/500-networking.bats:852:21: error[SC1087]: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). # 850| CONTAINERS_CONF_OVERRIDE=$containersconf run_podman run --rm --add-host $name3:$ip3 $IMAGE cat /etc/hosts # 851| is "$output" ".*$ip3[[:blank:]]$name3.*" "--add-host entry in /etc/host" # 852|-> is "$output" ".*$ip1[[:blank:]]$name1.*" "first base entry in /etc/host" # 853| is "$output" ".*$ip2[[:blank:]]$name2.*" "second base entry in /etc/host" # 854| is "$output" ".*127.0.0.1[[:blank:]]localhost.*" "ipv4 localhost entry added" Error: SHELLCHECK_WARNING (CWE-398): [#def484] /usr/share/podman/test/system/500-networking.bats:853:21: error[SC1087]: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). # 851| is "$output" ".*$ip3[[:blank:]]$name3.*" "--add-host entry in /etc/host" # 852| is "$output" ".*$ip1[[:blank:]]$name1.*" "first base entry in /etc/host" # 853|-> is "$output" ".*$ip2[[:blank:]]$name2.*" "second base entry in /etc/host" # 854| is "$output" ".*127.0.0.1[[:blank:]]localhost.*" "ipv4 localhost entry added" # 855| is "$output" ".*::1[[:blank:]]localhost.*" "ipv6 localhost entry added" Error: SHELLCHECK_WARNING (CWE-398): [#def485] /usr/share/podman/test/system/500-networking.bats:856:21: error[SC1087]: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). # 854| is "$output" ".*127.0.0.1[[:blank:]]localhost.*" "ipv4 localhost entry added" # 855| is "$output" ".*::1[[:blank:]]localhost.*" "ipv6 localhost entry added" # 856|-> is "$output" ".*$containersinternal_ip[[:blank:]]host\.containers\.internal.*" "host.containers.internal ip from config in /etc/host" # 857| is "${#lines[@]}" "7" "expect 7 host entries in /etc/hosts" # 858| Error: SHELLCHECK_WARNING (CWE-398): [#def486] /usr/share/podman/test/system/500-networking.bats:862:21: error[SC1087]: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). # 860| # in this case podman should not add its own entry thus we only have 5 entries (-1 for the removed --add-host) # 861| CONTAINERS_CONF_OVERRIDE=$containersconf run_podman run --rm --name $name1 --hostname $name1 $IMAGE cat /etc/hosts # 862|-> is "$output" ".*$ip1[[:blank:]]$name1.*" "first base entry in /etc/host" # 863| is "$output" ".*$ip2[[:blank:]]$name2.*" "second base entry in /etc/host" # 864| is "$output" ".*$containersinternal_ip[[:blank:]]host\.containers\.internal.*" "host.containers.internal ip from config in /etc/host" Error: SHELLCHECK_WARNING (CWE-398): [#def487] /usr/share/podman/test/system/500-networking.bats:863:21: error[SC1087]: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). # 861| CONTAINERS_CONF_OVERRIDE=$containersconf run_podman run --rm --name $name1 --hostname $name1 $IMAGE cat /etc/hosts # 862| is "$output" ".*$ip1[[:blank:]]$name1.*" "first base entry in /etc/host" # 863|-> is "$output" ".*$ip2[[:blank:]]$name2.*" "second base entry in /etc/host" # 864| is "$output" ".*$containersinternal_ip[[:blank:]]host\.containers\.internal.*" "host.containers.internal ip from config in /etc/host" # 865| is "${#lines[@]}" "5" "expect 5 host entries in /etc/hosts" Error: SHELLCHECK_WARNING (CWE-398): [#def488] /usr/share/podman/test/system/500-networking.bats:864:21: error[SC1087]: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). # 862| is "$output" ".*$ip1[[:blank:]]$name1.*" "first base entry in /etc/host" # 863| is "$output" ".*$ip2[[:blank:]]$name2.*" "second base entry in /etc/host" # 864|-> is "$output" ".*$containersinternal_ip[[:blank:]]host\.containers\.internal.*" "host.containers.internal ip from config in /etc/host" # 865| is "${#lines[@]}" "5" "expect 5 host entries in /etc/hosts" # 866| } Error: SHELLCHECK_WARNING (CWE-571): [#def489] /usr/share/podman/test/system/500-networking.bats:919:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 917| # Create a tmpdir symlink pointing to /run, and use it briefly # 918| ln -s /run $PODMAN_TMPDIR/run # 919|-> local tmp_run=$PODMAN_TMPDIR/run/user/$(id -u) # 920| test -d $tmp_run || skip "/run/user/MYUID unavailable" # 921| Error: SHELLCHECK_WARNING (CWE-563): [#def490] /usr/share/podman/test/system/500-networking.bats:973:11: warning[SC2034]: count appears unused. Verify use (or export if used externally). # 971| function wait_for_restart_count() { # 972| local cname="$1" # 973|-> local count="$2" # 974| local tname="$3" # 975| Error: SHELLCHECK_WARNING (CWE-571): [#def491] /usr/share/podman/test/system/500-networking.bats:997:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 995| skip_if_cgroupsv1 "run --uidmap fails on cgroups v1 (issue 15025, wontfix)" # 996| # 997|-> local net1=net-a-$(safename) # 998| # use /29 subnet to limit available ip space, a 29 gives 5 usable addresses (6 - 1 for the gw) # 999| local subnet="$(random_rfc1918_subnet).0/29" Error: SHELLCHECK_WARNING (CWE-571): [#def492] /usr/share/podman/test/system/500-networking.bats:999:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 997| local net1=net-a-$(safename) # 998| # use /29 subnet to limit available ip space, a 29 gives 5 usable addresses (6 - 1 for the gw) # 999|-> local subnet="$(random_rfc1918_subnet).0/29" # 1000| run_podman network create --subnet $subnet $net1 # 1001| local cname=con1-$(safename) Error: SHELLCHECK_WARNING (CWE-571): [#def493] /usr/share/podman/test/system/500-networking.bats:1001:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 999| local subnet="$(random_rfc1918_subnet).0/29" # 1000| run_podman network create --subnet $subnet $net1 # 1001|-> local cname=con1-$(safename) # 1002| local cname2= # 1003| local cname3= Error: SHELLCHECK_WARNING (CWE-571): [#def494] /usr/share/podman/test/system/500-networking.bats:1059:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1057| # FIXME: random_rfc1918_subnet is not parallel-safe # 1058| @test "podman network inspect running containers" { # 1059|-> local cname1=c1-$(safename) # 1060| local cname2=c2-$(safename) # 1061| local cname3=c3-$(safename) Error: SHELLCHECK_WARNING (CWE-571): [#def495] /usr/share/podman/test/system/500-networking.bats:1060:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1058| @test "podman network inspect running containers" { # 1059| local cname1=c1-$(safename) # 1060|-> local cname2=c2-$(safename) # 1061| local cname3=c3-$(safename) # 1062| Error: SHELLCHECK_WARNING (CWE-571): [#def496] /usr/share/podman/test/system/500-networking.bats:1061:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1059| local cname1=c1-$(safename) # 1060| local cname2=c2-$(safename) # 1061|-> local cname3=c3-$(safename) # 1062| # 1063| local netname=net-$(safename) Error: SHELLCHECK_WARNING (CWE-571): [#def497] /usr/share/podman/test/system/500-networking.bats:1063:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1061| local cname3=c3-$(safename) # 1062| # 1063|-> local netname=net-$(safename) # 1064| local subnet=$(random_rfc1918_subnet) # 1065| Error: SHELLCHECK_WARNING (CWE-571): [#def498] /usr/share/podman/test/system/500-networking.bats:1064:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1062| # 1063| local netname=net-$(safename) # 1064|-> local subnet=$(random_rfc1918_subnet) # 1065| # 1066| run_podman network create --subnet "${subnet}.0/24" $netname Error: SHELLCHECK_WARNING (CWE-398): [#def499] /usr/share/podman/test/system/505-networking-pasta.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # SPDX-License-Identifier: Apache-2.0 Error: SHELLCHECK_WARNING (CWE-571): [#def500] /usr/share/podman/test/system/505-networking-pasta.bats:54:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 52| # -> TCP translated ... forwarding IPv4 loopback # 53| # -> TCP translated forwarding IPv4 loopback # 54|-> local test_name=$(printf "$(sed \ # 55| -e 's/^test_//' \ # 56| -e 's/-\([0-9a-f]\{2\}\)/ /gI' \ Error: SHELLCHECK_WARNING (CWE-156): [#def501] /usr/share/podman/test/system/505-networking-pasta.bats:77:48: warning[SC2046]: Quote this to prevent word splitting. # 75| case $kw in # 76| TCP|UDP) _set_opt proto ${kw,,} ;; # 77|-> IPv*) _set_opt ip_ver $(expr "$kw" : "IPv\(.\)") ;; # 78| Single) _set_opt range 1 ;; # 79| range) _set_opt range 3 ;; Error: SHELLCHECK_WARNING (CWE-571): [#def502] /usr/share/podman/test/system/505-networking-pasta.bats:150:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 148| local ifname="lo" # 149| else # 150|-> local ifname="$(default_ifname "${ip_ver}")" # 151| fi # 152| Error: SHELLCHECK_WARNING (CWE-571): [#def503] /usr/share/podman/test/system/505-networking-pasta.bats:153:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 151| fi # 152| # 153|-> local addr="$(default_addr "${ip_ver}" "${ifname}")" # 154| # 155| # ports, Error: SHELLCHECK_WARNING (CWE-571): [#def504] /usr/share/podman/test/system/505-networking-pasta.bats:157:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 155| # ports, # 156| if [ ${range} -gt 1 ]; then # 157|-> local port="$(random_free_port_range ${range} ${addr} ${proto})" # 158| local xport="$((${port%-*} + delta))-$((${port#*-} + delta))" # 159| local seq="$(echo ${port} | tr '-' ' ')" Error: SHELLCHECK_WARNING (CWE-571): [#def505] /usr/share/podman/test/system/505-networking-pasta.bats:159:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 157| local port="$(random_free_port_range ${range} ${addr} ${proto})" # 158| local xport="$((${port%-*} + delta))-$((${port#*-} + delta))" # 159|-> local seq="$(echo ${port} | tr '-' ' ')" # 160| local xseq="$(echo ${xport} | tr '-' ' ')" # 161| else Error: SHELLCHECK_WARNING (CWE-571): [#def506] /usr/share/podman/test/system/505-networking-pasta.bats:160:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 158| local xport="$((${port%-*} + delta))-$((${port#*-} + delta))" # 159| local seq="$(echo ${port} | tr '-' ' ')" # 160|-> local xseq="$(echo ${xport} | tr '-' ' ')" # 161| else # 162| local port=$(random_free_port "" ${addr} ${proto}) Error: SHELLCHECK_WARNING (CWE-571): [#def507] /usr/share/podman/test/system/505-networking-pasta.bats:162:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 160| local xseq="$(echo ${xport} | tr '-' ' ')" # 161| else # 162|-> local port=$(random_free_port "" ${addr} ${proto}) # 163| local xport="$((port + delta))" # 164| local seq="${port} ${port}" Error: SHELLCHECK_WARNING (CWE-571): [#def508] /usr/share/podman/test/system/505-networking-pasta.bats:168:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 166| fi # 167| # 168|-> local proto_upper="$(echo "${proto}" | tr [:lower:] [:upper:])" # 169| # 170| # socat options for first <address> in server ("LISTEN" address types), Error: SHELLCHECK_WARNING (CWE-398): [#def509] /usr/share/podman/test/system/505-networking-pasta.bats:168:47: warning[SC2060]: Quote parameters to tr to prevent glob expansion. # 166| fi # 167| # 168|-> local proto_upper="$(echo "${proto}" | tr [:lower:] [:upper:])" # 169| # 170| # socat options for first <address> in server ("LISTEN" address types), Error: SHELLCHECK_WARNING (CWE-398): [#def510] /usr/share/podman/test/system/505-networking-pasta.bats:168:57: warning[SC2060]: Quote parameters to tr to prevent glob expansion. # 166| fi # 167| # 168|-> local proto_upper="$(echo "${proto}" | tr [:lower:] [:upper:])" # 169| # 170| # socat options for first <address> in server ("LISTEN" address types), Error: SHELLCHECK_WARNING (CWE-571): [#def511] /usr/share/podman/test/system/505-networking-pasta.bats:213:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 211| else # 212| printf "x" > "${XFER_FILE}" # 213|-> local expect="$(for i in $(seq ${seq}); do printf "x"; done)" # 214| fi # 215| Error: SHELLCHECK_WARNING (CWE-563): [#def512] /usr/share/podman/test/system/505-networking-pasta.bats:213:25: warning[SC2034]: i appears unused. Verify use (or export if used externally). # 211| else # 212| printf "x" > "${XFER_FILE}" # 213|-> local expect="$(for i in $(seq ${seq}); do printf "x"; done)" # 214| fi # 215| Error: SHELLCHECK_WARNING (CWE-571): [#def513] /usr/share/podman/test/system/505-networking-pasta.bats:217:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 215| # 216| # Start server # 217|-> local cname="c-socat-$(safename)" # 218| run_podman run -d --name="$cname" --net=pasta"${pasta_spec}" -p "${podman_spec}" "${IMAGE}" \ # 219| sh -c 'for port in $(seq '"${xseq}"'); do '\ Error: SHELLCHECK_WARNING: [#def514] /usr/share/podman/test/system/505-networking-pasta.bats:228:32: warning[SC2076]: Remove quotes from right-hand side of =~ to match as a regex rather than literally. # 226| while [[ $retries -gt 0 ]]; do # 227| run_podman exec $cname ss -Hln -$ip_ver --$proto sport = "$cport" # 228|-> if [[ "$output" =~ "$cport" ]]; then # 229| break # 230| fi Error: SHELLCHECK_WARNING (CWE-571): [#def515] /usr/share/podman/test/system/505-networking-pasta.bats:275:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 273| run_podman run --rm --net=pasta $IMAGE ip -j -4 address show # 274| # 275|-> local container_address="$(ipv4_get_addr_global "${output}")" # 276| local host_address="$(default_addr 4)" # 277| Error: SHELLCHECK_WARNING (CWE-571): [#def516] /usr/share/podman/test/system/505-networking-pasta.bats:276:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 274| # 275| local container_address="$(ipv4_get_addr_global "${output}")" # 276|-> local host_address="$(default_addr 4)" # 277| # 278| assert "${container_address}" = "${host_address}" \ Error: SHELLCHECK_WARNING (CWE-571): [#def517] /usr/share/podman/test/system/505-networking-pasta.bats:287:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 285| run_podman run --rm --net=pasta:-a,192.0.2.1 $IMAGE ip -j -4 address show # 286| # 287|-> local container_address="$(ipv4_get_addr_global "${output}")" # 288| # 289| assert "${container_address}" = "192.0.2.1" \ Error: SHELLCHECK_WARNING (CWE-571): [#def518] /usr/share/podman/test/system/505-networking-pasta.bats:299:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 297| run_podman run --rm --net=pasta:-6 $IMAGE ip -j -4 address show # 298| # 299|-> local container_address="$(ipv4_get_addr_global "${output}")" # 300| # 301| assert "${container_address}" = "null" \ Error: SHELLCHECK_WARNING (CWE-571): [#def519] /usr/share/podman/test/system/505-networking-pasta.bats:310:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 308| run_podman run --rm --net=pasta $IMAGE ip -j -6 address show # 309| # 310|-> local container_address="$(ipv6_get_addr_global "${output}")" # 311| local host_address="$(default_addr 6)" # 312| Error: SHELLCHECK_WARNING (CWE-571): [#def520] /usr/share/podman/test/system/505-networking-pasta.bats:311:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 309| # 310| local container_address="$(ipv6_get_addr_global "${output}")" # 311|-> local host_address="$(default_addr 6)" # 312| # 313| assert "${container_address}" = "${host_address}" \ Error: SHELLCHECK_WARNING (CWE-571): [#def521] /usr/share/podman/test/system/505-networking-pasta.bats:322:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 320| run_podman run --rm --net=pasta:-a,2001:db8::1 $IMAGE ip -j -6 address show # 321| # 322|-> local container_address="$(ipv6_get_addr_global "${output}")" # 323| # 324| assert "${container_address}" = "2001:db8::1" \ Error: SHELLCHECK_WARNING (CWE-571): [#def522] /usr/share/podman/test/system/505-networking-pasta.bats:334:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 332| run_podman run --rm --net=pasta:-4 $IMAGE ip -j -6 address show # 333| # 334|-> local container_address="$(ipv6_get_addr_global "${output}")" # 335| # 336| assert "${container_address}" = "null" \ Error: SHELLCHECK_WARNING (CWE-571): [#def523] /usr/share/podman/test/system/505-networking-pasta.bats:361:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 359| run_podman run --rm --net=pasta $IMAGE ip -j -4 route show # 360| # 361|-> local container_route="$(ipv4_get_route_default "${output}")" # 362| local host_route="$(ipv4_get_route_default)" # 363| Error: SHELLCHECK_WARNING (CWE-571): [#def524] /usr/share/podman/test/system/505-networking-pasta.bats:362:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 360| # 361| local container_route="$(ipv4_get_route_default "${output}")" # 362|-> local host_route="$(ipv4_get_route_default)" # 363| # 364| assert "${container_route}" = "${host_route}" \ Error: SHELLCHECK_WARNING (CWE-571): [#def525] /usr/share/podman/test/system/505-networking-pasta.bats:374:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 372| ip -j -4 route show # 373| # 374|-> local container_route="$(ipv4_get_route_default "${output}")" # 375| # 376| assert "${container_route}" = "192.0.2.1" \ Error: SHELLCHECK_WARNING (CWE-571): [#def526] /usr/share/podman/test/system/505-networking-pasta.bats:385:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 383| run_podman run --rm --net=pasta $IMAGE ip -j -6 route show # 384| # 385|-> local container_route="$(ipv6_get_route_default "${output}")" # 386| local host_route="$(ipv6_get_route_default)" # 387| Error: SHELLCHECK_WARNING (CWE-571): [#def527] /usr/share/podman/test/system/505-networking-pasta.bats:386:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 384| # 385| local container_route="$(ipv6_get_route_default "${output}")" # 386|-> local host_route="$(ipv6_get_route_default)" # 387| # 388| assert "${container_route}" = "${host_route}" \ Error: SHELLCHECK_WARNING (CWE-571): [#def528] /usr/share/podman/test/system/505-networking-pasta.bats:398:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 396| ip -j -6 route show # 397| # 398|-> local container_route="$(ipv6_get_route_default "${output}")" # 399| # 400| assert "${container_route}" = "2001:db8::1" \ Error: SHELLCHECK_WARNING (CWE-571): [#def529] /usr/share/podman/test/system/505-networking-pasta.bats:783:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 781| # 782| # Allow time for process to vanish, in case there's high load # 783|-> local pid=$(< $pidfile) # 784| local timeout=5 # 785| while [[ $timeout -gt 0 ]]; do Error: SHELLCHECK_WARNING (CWE-571): [#def530] /usr/share/podman/test/system/505-networking-pasta.bats:800:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 798| ### Options #################################################################### # 799| @test "Unsupported protocol in port forwarding" { # 800|-> local port=$(random_free_port "" "" tcp) # 801| # 802| run_podman 126 run --rm --net=pasta -p "${port}:${port}/sctp" $IMAGE true Error: SHELLCHECK_WARNING (CWE-398): [#def531] /usr/share/podman/test/system/520-checkpoint.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # test podman checkpoint. Similar in many ways to our pause tests. Error: SHELLCHECK_WARNING (CWE-571): [#def532] /usr/share/podman/test/system/520-checkpoint.bats:138:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 136| # 137| # To avoid network pull, copy $IMAGE straight to temp root # 138|-> local p_opts="$(podman_isolation_opts ${PODMAN_TMPDIR}) --events-backend file" # 139| run_podman save -o $PODMAN_TMPDIR/image.tar $IMAGE # 140| run_podman $p_opts load -i $PODMAN_TMPDIR/image.tar Error: SHELLCHECK_WARNING (CWE-571): [#def533] /usr/share/podman/test/system/520-checkpoint.bats:145:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 143| volname=v-$(safename) # 144| run_podman $p_opts volume create $volname # 145|-> local cname=c-$(safename) # 146| local host_port=$(random_free_port) # 147| local server=http://127.0.0.1:$host_port Error: SHELLCHECK_WARNING (CWE-571): [#def534] /usr/share/podman/test/system/520-checkpoint.bats:146:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 144| run_podman $p_opts volume create $volname # 145| local cname=c-$(safename) # 146|-> local host_port=$(random_free_port) # 147| local server=http://127.0.0.1:$host_port # 148| Error: SHELLCHECK_WARNING (CWE-571): [#def535] /usr/share/podman/test/system/520-checkpoint.bats:238:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 236| # Refer to https://github.com/containers/podman/issues/16666#issuecomment-1337860545 # 237| # for the correct behavior, this should cover all cases listed there. # 238|-> local netname="net-$(safename)" # 239| local subnet="$(random_rfc1918_subnet)" # 240| run_podman network create --subnet "$subnet.0/24" $netname Error: SHELLCHECK_WARNING (CWE-571): [#def536] /usr/share/podman/test/system/520-checkpoint.bats:239:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 237| # for the correct behavior, this should cover all cases listed there. # 238| local netname="net-$(safename)" # 239|-> local subnet="$(random_rfc1918_subnet)" # 240| run_podman network create --subnet "$subnet.0/24" $netname # 241| Error: SHELLCHECK_WARNING (CWE-457): [#def537] /usr/share/podman/test/system/520-checkpoint.bats:363:24: warning[SC2154]: ip is referenced but not assigned. # 361| assert "$mac8" != "$static_mac" "static mac after restore --ignore-static-mac and restart should be different" # 362| assert "$ip8" != "$ip7" "static ip after restore --ignore-static-ip and restart should be different" # 363|-> assert "$mac8" != "$ip" "static mac after restore --ignore-static-mac and restart should be different" # 364| # 365| run_podman rm -t 0 -f $cid Error: SHELLCHECK_WARNING (CWE-398): [#def538] /usr/share/podman/test/system/550-pause-process.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # test to make sure we use the correct podman pause process Error: SHELLCHECK_WARNING (CWE-563): [#def539] /usr/share/podman/test/system/550-pause-process.bats:46:11: warning[SC2034]: baseline_userns appears unused. Verify use (or export if used externally). # 44| local getns="unshare readlink /proc/self/ns/user" # 45| run_podman $getns # 46|-> local baseline_userns="$output" # 47| # 48| # A pause process will now be running Error: SHELLCHECK_WARNING (CWE-156): [#def540] /usr/share/podman/test/system/550-pause-process.bats:60:16: warning[SC2046]: Quote this to prevent word splitting. # 58| test $status -eq 0 && die "Pause process $pause_pid is still running even after podman system migrate" # 59| # 60|-> run_podman $(podman_isolation_opts ${PODMAN_TMPDIR}) $getns # 61| tmpdir_userns="$output" # 62| Error: SHELLCHECK_WARNING (CWE-571): [#def541] /usr/share/podman/test/system/550-pause-process.bats:102:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 100| # 101| # First let's run a container in the background to keep the userns active # 102|-> local cname1=c1_$(random_string) # 103| run_podman run -d --name $cname1 --uidmap 0:100:100 $IMAGE top # 104| Error: SHELLCHECK_WARNING (CWE-571): [#def542] /usr/share/podman/test/system/550-pause-process.bats:114:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 112| # Now again directly start podman run and make sure it can forward signals # 113| # We're forced to use $PODMAN because run_podman cannot be backgrounded # 114|-> local cname2=c2_$(random_string) # 115| $PODMAN run -i --name $cname2 $IMAGE sh -c "$SLEEPLOOP" & # 116| local kidpid=$! Error: SHELLCHECK_WARNING (CWE-571): [#def543] /usr/share/podman/test/system/550-pause-process.bats:143:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 141| # 142| # First run a container with a custom userns as this uses different netns setup logic. # 143|-> local cname=c-$(safename) # 144| run_podman run --userns keep-id --name $cname -d $IMAGE sleep 100 # 145| Error: SHELLCHECK_WARNING (CWE-398): [#def544] /usr/share/podman/test/system/600-completion.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Test podman shell completion Error: SHELLCHECK_WARNING (CWE-140): [#def545] /usr/share/podman/test/system/600-completion.bats:13:31: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. # 11| function setup() { # 12| # $PODMAN may be a space-separated string, e.g. if we include a --url. # 13|-> local -a podman_as_array=($PODMAN) # 14| # __completeNoDesc must be the first arg if we running the completion cmd # 15| # set the var for the run_completion function Error: SHELLCHECK_WARNING (CWE-569): [#def546] /usr/share/podman/test/system/600-completion.bats:16:23: warning[SC2124]: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate. # 14| # __completeNoDesc must be the first arg if we running the completion cmd # 15| # set the var for the run_completion function # 16|-> PODMAN_COMPLETION="${podman_as_array[0]} __completeNoDesc ${podman_as_array[@]:1}" # 17| # 18| basic_setup Error: SHELLCHECK_WARNING (CWE-563): [#def547] /usr/share/podman/test/system/600-completion.bats:33:11: warning[SC2034]: count appears unused. Verify use (or export if used externally). # 31| # 32| function check_shell_completion() { # 33|-> local count=0 # 34| # 35| # Newline character; used for confirming string output Error: SHELLCHECK_WARNING: [#def548] /usr/share/podman/test/system/600-completion.bats:217:35: warning[SC2076]: Remove quotes from right-hand side of =~ to match as a regex rather than literally. # 215| # If the argument ends with ...] than we accept 0...n args # 216| # Loop two times to make sure we are not only completing the first arg # 217|-> if [[ ! ${arg} =~ "..." ]] || [[ i -gt 1 ]]; then # 218| break # 219| fi Error: SHELLCHECK_WARNING: [#def549] /usr/share/podman/test/system/600-completion.bats:226:32: warning[SC2076]: Remove quotes from right-hand side of =~ to match as a regex rather than literally. # 224| # 225| # If the command takes no more parameters make sure we are getting no completion # 226|-> if [[ ! ${args##* } =~ "..." ]]; then # 227| run_completion "$@" $cmd "${extra_args[@]}" "" # 228| _check_completion_end NoFileComp Error: SHELLCHECK_WARNING (CWE-398): [#def550] /usr/share/podman/test/system/610-format.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # PR #15673: For all commands that accept --format '{{.GoTemplate}}', Error: SHELLCHECK_WARNING (CWE-398): [#def551] /usr/share/podman/test/system/610-format.bats:88:19: warning[SC2184]: Quote arguments to unset so they're not glob expanded. # 86| if [[ -n "$extra" ]]; then # 87| # Cross off our list # 88|-> unset extra_args["$command_string"] # 89| fi # 90| Error: SHELLCHECK_WARNING (CWE-569): [#def552] /usr/share/podman/test/system/610-format.bats:207:21: warning[SC2124]: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate. # 205| # indicate a typo in the table, or a flaw in our logic such that # 206| # we're not actually recursing. # 207|-> local leftovers="${!extra_args[@]}" # 208| assert "$leftovers" = "" "Did not find (or test) subcommands:" # 209| } Error: SHELLCHECK_WARNING (CWE-398): [#def553] /usr/share/podman/test/system/620-option-conflicts.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # options that cannot be set together Error: SHELLCHECK_WARNING (CWE-398): [#def554] /usr/share/podman/test/system/700-play.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Test podman play Error: SHELLCHECK_WARNING (CWE-571): [#def555] /usr/share/podman/test/system/700-play.bats:26:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 24| for i;do # 25| # This will error on 'foo=' (no value). That's totally OK. # 26|-> local value=$(expr "$i" : '[^=]*=\(.*\)') # 27| case "$i" in # 28| annotations=*) annotations="$value" ;; Error: SHELLCHECK_WARNING (CWE-156): [#def556] /usr/share/podman/test/system/700-play.bats:124:29: warning[SC2046]: Quote this to prevent word splitting. # 122| run_podman 1 image exists k8s.gcr.io/pause # 123| run_podman 1 image exists registry.k8s.io/pause # 124|-> run_podman image exists $(pause_image) # 125| # 126| run_podman pod rm -t 0 -f $PODNAME Error: SHELLCHECK_WARNING (CWE-569): [#def557] /usr/share/podman/test/system/700-play.bats:237:41: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 235| if has_slirp4netns; then # 236| run_podman kube play --network slirp4netns:port_handler=slirp4netns $TESTYAML # 237|-> run_podman pod inspect --format {{.InfraContainerID}} "${lines[1]}" # 238| infraID="$output" # 239| run_podman container inspect --format "{{.HostConfig.NetworkMode}}" $infraID Error: SHELLCHECK_WARNING (CWE-569): [#def558] /usr/share/podman/test/system/700-play.bats:237:42: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 235| if has_slirp4netns; then # 236| run_podman kube play --network slirp4netns:port_handler=slirp4netns $TESTYAML # 237|-> run_podman pod inspect --format {{.InfraContainerID}} "${lines[1]}" # 238| infraID="$output" # 239| run_podman container inspect --format "{{.HostConfig.NetworkMode}}" $infraID Error: SHELLCHECK_WARNING (CWE-569): [#def559] /usr/share/podman/test/system/700-play.bats:237:60: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 235| if has_slirp4netns; then # 236| run_podman kube play --network slirp4netns:port_handler=slirp4netns $TESTYAML # 237|-> run_podman pod inspect --format {{.InfraContainerID}} "${lines[1]}" # 238| infraID="$output" # 239| run_podman container inspect --format "{{.HostConfig.NetworkMode}}" $infraID Error: SHELLCHECK_WARNING (CWE-569): [#def560] /usr/share/podman/test/system/700-play.bats:237:61: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 235| if has_slirp4netns; then # 236| run_podman kube play --network slirp4netns:port_handler=slirp4netns $TESTYAML # 237|-> run_podman pod inspect --format {{.InfraContainerID}} "${lines[1]}" # 238| infraID="$output" # 239| run_podman container inspect --format "{{.HostConfig.NetworkMode}}" $infraID Error: SHELLCHECK_WARNING (CWE-569): [#def561] /usr/share/podman/test/system/700-play.bats:246:37: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 244| # 245| run_podman kube play --network none $TESTYAML # 246|-> run_podman pod inspect --format {{.InfraContainerID}} "${lines[1]}" # 247| infraID="$output" # 248| run_podman container inspect --format "{{.HostConfig.NetworkMode}}" $infraID Error: SHELLCHECK_WARNING (CWE-569): [#def562] /usr/share/podman/test/system/700-play.bats:246:38: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 244| # 245| run_podman kube play --network none $TESTYAML # 246|-> run_podman pod inspect --format {{.InfraContainerID}} "${lines[1]}" # 247| infraID="$output" # 248| run_podman container inspect --format "{{.HostConfig.NetworkMode}}" $infraID Error: SHELLCHECK_WARNING (CWE-569): [#def563] /usr/share/podman/test/system/700-play.bats:246:56: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 244| # 245| run_podman kube play --network none $TESTYAML # 246|-> run_podman pod inspect --format {{.InfraContainerID}} "${lines[1]}" # 247| infraID="$output" # 248| run_podman container inspect --format "{{.HostConfig.NetworkMode}}" $infraID Error: SHELLCHECK_WARNING (CWE-569): [#def564] /usr/share/podman/test/system/700-play.bats:246:57: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 244| # 245| run_podman kube play --network none $TESTYAML # 246|-> run_podman pod inspect --format {{.InfraContainerID}} "${lines[1]}" # 247| infraID="$output" # 248| run_podman container inspect --format "{{.HostConfig.NetworkMode}}" $infraID Error: SHELLCHECK_WARNING (CWE-563): [#def565] /usr/share/podman/test/system/700-play.bats:674:5: warning[SC2034]: try appears unused. Verify use (or export if used externally). # 672| local kidpid=$! # 673| # 674|-> for try in {1..10}; do # 675| run_podman '?' container inspect --format '{{.State.Running}}' "$podname-$ctrname" # 676| if [[ $status -eq 0 ]] && [[ "$output" = "true" ]]; then Error: SHELLCHECK_WARNING: [#def566] /usr/share/podman/test/system/700-play.bats:939:32: warning[SC2076]: Remove quotes from right-hand side of =~ to match as a regex rather than literally. # 937| run_podman inspect $ctrName --format "$i-{{.State.Health.Status}}" # 938| full_log+=" $output" # 939|-> if [[ "$output" =~ "-$want" ]]; then # 940| break # 941| fi Error: SHELLCHECK_WARNING (CWE-571): [#def567] /usr/share/podman/test/system/700-play.bats:979:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 977| # 978| local registry=localhost:${PODMAN_LOGIN_REGISTRY_PORT} # 979|-> local from_image=$registry/quadlet_image_test-$(safename):$(random_string) # 980| local authfile=$PODMAN_TMPDIR/authfile.json # 981| Error: SHELLCHECK_WARNING (CWE-569): [#def568] /usr/share/podman/test/system/700-play.bats:1264:37: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 1262| run_podman create --pod $podname $IMAGE true # 1263| # 1264|-> run_podman pod inspect --format {{.InfraContainerID}} $podname # 1265| infraID="$output" # 1266| Error: SHELLCHECK_WARNING (CWE-569): [#def569] /usr/share/podman/test/system/700-play.bats:1264:38: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 1262| run_podman create --pod $podname $IMAGE true # 1263| # 1264|-> run_podman pod inspect --format {{.InfraContainerID}} $podname # 1265| infraID="$output" # 1266| Error: SHELLCHECK_WARNING (CWE-569): [#def570] /usr/share/podman/test/system/700-play.bats:1264:56: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 1262| run_podman create --pod $podname $IMAGE true # 1263| # 1264|-> run_podman pod inspect --format {{.InfraContainerID}} $podname # 1265| infraID="$output" # 1266| Error: SHELLCHECK_WARNING (CWE-569): [#def571] /usr/share/podman/test/system/700-play.bats:1264:57: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 1262| run_podman create --pod $podname $IMAGE true # 1263| # 1264|-> run_podman pod inspect --format {{.InfraContainerID}} $podname # 1265| infraID="$output" # 1266| Error: SHELLCHECK_WARNING (CWE-569): [#def572] /usr/share/podman/test/system/700-play.bats:1277:37: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 1275| run_podman kube play --replace $YAML # 1276| # 1277|-> run_podman pod inspect --format {{.InfraContainerID}} $podname # 1278| infraID="$output" # 1279| Error: SHELLCHECK_WARNING (CWE-569): [#def573] /usr/share/podman/test/system/700-play.bats:1277:38: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 1275| run_podman kube play --replace $YAML # 1276| # 1277|-> run_podman pod inspect --format {{.InfraContainerID}} $podname # 1278| infraID="$output" # 1279| Error: SHELLCHECK_WARNING (CWE-569): [#def574] /usr/share/podman/test/system/700-play.bats:1277:56: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 1275| run_podman kube play --replace $YAML # 1276| # 1277|-> run_podman pod inspect --format {{.InfraContainerID}} $podname # 1278| infraID="$output" # 1279| Error: SHELLCHECK_WARNING (CWE-569): [#def575] /usr/share/podman/test/system/700-play.bats:1277:57: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 1275| run_podman kube play --replace $YAML # 1276| # 1277|-> run_podman pod inspect --format {{.InfraContainerID}} $podname # 1278| infraID="$output" # 1279| Error: SHELLCHECK_WARNING (CWE-398): [#def576] /usr/share/podman/test/system/710-kube.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Test podman kube generate Error: SHELLCHECK_WARNING (CWE-571): [#def577] /usr/share/podman/test/system/710-kube.bats:98:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 96| # 97| @test "podman kube generate - pod" { # 98|-> local pname=p-$(safename) # 99| local cname1=c1-$(safename) # 100| local cname2=c2-$(safename) Error: SHELLCHECK_WARNING (CWE-571): [#def578] /usr/share/podman/test/system/710-kube.bats:99:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 97| @test "podman kube generate - pod" { # 98| local pname=p-$(safename) # 99|-> local cname1=c1-$(safename) # 100| local cname2=c2-$(safename) # 101| Error: SHELLCHECK_WARNING (CWE-571): [#def579] /usr/share/podman/test/system/710-kube.bats:100:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 98| local pname=p-$(safename) # 99| local cname1=c1-$(safename) # 100|-> local cname2=c2-$(safename) # 101| # 102| port=$(random_free_port) Error: SHELLCHECK_WARNING (CWE-571): [#def580] /usr/share/podman/test/system/710-kube.bats:159:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 157| @test "podman kube generate - deployment" { # 158| skip_if_remote "containersconf needs to be set on server side" # 159|-> local pname=p-$(safename) # 160| local cname1=c1-$(safename) # 161| local cname2=c2-$(safename) Error: SHELLCHECK_WARNING (CWE-571): [#def581] /usr/share/podman/test/system/710-kube.bats:160:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 158| skip_if_remote "containersconf needs to be set on server side" # 159| local pname=p-$(safename) # 160|-> local cname1=c1-$(safename) # 161| local cname2=c2-$(safename) # 162| Error: SHELLCHECK_WARNING (CWE-571): [#def582] /usr/share/podman/test/system/710-kube.bats:161:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 159| local pname=p-$(safename) # 160| local cname1=c1-$(safename) # 161|-> local cname2=c2-$(safename) # 162| # 163| run_podman pod create --name $pname Error: SHELLCHECK_WARNING (CWE-571): [#def583] /usr/share/podman/test/system/710-kube.bats:199:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 197| @test "podman kube generate - job" { # 198| skip_if_remote "containersconf needs to be set on server side" # 199|-> local pname=p-$(safename) # 200| local cname1=c1-$(safename) # 201| local cname2=c2-$(safename) Error: SHELLCHECK_WARNING (CWE-571): [#def584] /usr/share/podman/test/system/710-kube.bats:200:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 198| skip_if_remote "containersconf needs to be set on server side" # 199| local pname=p-$(safename) # 200|-> local cname1=c1-$(safename) # 201| local cname2=c2-$(safename) # 202| Error: SHELLCHECK_WARNING (CWE-571): [#def585] /usr/share/podman/test/system/710-kube.bats:201:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 199| local pname=p-$(safename) # 200| local cname1=c1-$(safename) # 201|-> local cname2=c2-$(safename) # 202| # 203| run_podman pod create --name $pname Error: SHELLCHECK_WARNING (CWE-398): [#def586] /usr/share/podman/test/system/750-trust.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # tests for podman image trust Error: SHELLCHECK_WARNING (CWE-398): [#def587] /usr/share/podman/test/system/760-system-renumber.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # tests for podman system renumber Error: SHELLCHECK_WARNING (CWE-398): [#def588] /usr/share/podman/test/system/800-config.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Test specific configuration options and overrides Error: SHELLCHECK_WARNING (CWE-398): [#def589] /usr/share/podman/test/system/850-compose.bats:1:1: error[SC2096]: On most OS, shebangs can only specify a single parameter. # 1|-> #!/usr/bin/env bats -*- bats -*- # 2| # # 3| # Smoke tests for the podman-compose command. test/compose takes care of functional tests. Error: SHELLCHECK_WARNING (CWE-156): [#def590] /usr/share/podman/test/system/build-systemd-image:16:20: warning[SC2046]: Quote this to prevent word splitting. # 14| # 15| # git-relative path to this script # 16|-> create_script=$(cd $(dirname $0) && git ls-files --full-name $(basename $0)) # 17| if [ -z "$create_script" ]; then # 18| create_script=$0 Error: SHELLCHECK_WARNING (CWE-156): [#def591] /usr/share/podman/test/system/build-systemd-image:16:62: warning[SC2046]: Quote this to prevent word splitting. # 14| # 15| # git-relative path to this script # 16|-> create_script=$(cd $(dirname $0) && git ls-files --full-name $(basename $0)) # 17| if [ -z "$create_script" ]; then # 18| create_script=$0 Error: SHELLCHECK_WARNING (CWE-156): [#def592] /usr/share/podman/test/system/build-systemd-image:29:23: warning[SC2046]: Quote this to prevent word splitting. # 27| # 28| # We'll need to create a Containerfile plus various other files to add in # 29|-> tmpdir=$(mktemp -t -d $(basename $0).tmp.XXXXXXX) # 30| cd $tmpdir # 31| echo $YMD >testimage-id Error: SHELLCHECK_WARNING (CWE-156): [#def593] /usr/share/podman/test/system/build-testimage:22:20: warning[SC2046]: Quote this to prevent word splitting. # 20| # 21| # git-relative path to this script # 22|-> create_script=$(cd $(dirname $0) && git ls-files --full-name $(basename $0)) # 23| if [ -z "$create_script" ]; then # 24| create_script=$0 Error: SHELLCHECK_WARNING (CWE-156): [#def594] /usr/share/podman/test/system/build-testimage:22:62: warning[SC2046]: Quote this to prevent word splitting. # 20| # 21| # git-relative path to this script # 22|-> create_script=$(cd $(dirname $0) && git ls-files --full-name $(basename $0)) # 23| if [ -z "$create_script" ]; then # 24| create_script=$0 Error: SHELLCHECK_WARNING (CWE-156): [#def595] /usr/share/podman/test/system/build-testimage:36:23: warning[SC2046]: Quote this to prevent word splitting. # 34| # # 35| # Please document the reason for all flags, apk's, and anything non-obvious # 36|-> tmpdir=$(mktemp -t -d $(basename $0).tmp.XXXXXXX) # 37| cd $tmpdir # 38| Error: SHELLCHECK_WARNING (CWE-670): [#def596] /usr/share/podman/test/system/helpers.bash:8:44: warning[SC2128]: Expanding an array without an index only gives the first element. # 6| # 7| # Podman testing helper used in 331-system-check tests # 8|-> PODMAN_TESTING=${PODMAN_TESTING:-$(dirname ${BASH_SOURCE})/../../bin/podman-testing} # 9| # 10| # crun or runc, unlikely to change. Cache, because it's expensive to determine. Error: SHELLCHECK_WARNING (CWE-563): [#def597] /usr/share/podman/test/system/helpers.bash:29:1: warning[SC2034]: PODMAN_NONLOCAL_IMAGE_FQN appears unused. Verify use (or export if used externally). # 27| # multiarch to work. It should change only very rarely. # 28| PODMAN_NONLOCAL_IMAGE_TAG=${PODMAN_NONLOCAL_IMAGE_TAG:-"00000004"} # 29|-> PODMAN_NONLOCAL_IMAGE_FQN="$PODMAN_TEST_IMAGE_REGISTRY/$PODMAN_TEST_IMAGE_USER/$PODMAN_TEST_IMAGE_NAME:$PODMAN_NONLOCAL_IMAGE_TAG" # 30| # 31| # Because who wants to spell that out each time? Error: SHELLCHECK_WARNING (CWE-563): [#def598] /usr/share/podman/test/system/helpers.bash:33:1: warning[SC2034]: SYSTEMD_IMAGE appears unused. Verify use (or export if used externally). # 31| # Because who wants to spell that out each time? # 32| IMAGE=$PODMAN_TEST_IMAGE_FQN # 33|-> SYSTEMD_IMAGE=$PODMAN_SYSTEMD_IMAGE_FQN # 34| # 35| # Default timeout for a podman command. Error: SHELLCHECK_WARNING (CWE-156): [#def599] /usr/share/podman/test/system/helpers.bash:40:6: warning[SC2046]: Quote this to prevent word splitting. # 38| # Prompt to display when logging podman commands; distinguish root/rootless # 39| _LOG_PROMPT='$' # 40|-> if [ $(id -u) -eq 0 ]; then # 41| _LOG_PROMPT='#' # 42| fi Error: SHELLCHECK_WARNING (CWE-571): [#def600] /usr/share/podman/test/system/helpers.bash:51:12: warning[SC2155]: Declare and assign separately to avoid masking return values. # 49| # tools. # 50| if [[ -z "$XDG_RUNTIME_DIR" ]] && [[ "$(id -u)" -ne 0 ]]; then # 51|-> export XDG_RUNTIME_DIR=/run/user/$(id -u) # 52| fi # 53| Error: SHELLCHECK_WARNING (CWE-571): [#def601] /usr/share/podman/test/system/helpers.bash:65:8: warning[SC2155]: Declare and assign separately to avoid masking return values. # 63| # Store in a semipermanent location. Not important for CI, but nice for # 64| # developers so test restarts don't hang fetching images. # 65|-> export PODMAN_IMAGECACHE=${BATS_TMPDIR:-/tmp}/podman-systest-imagecache-$(id -u) # 66| mkdir -p ${PODMAN_IMAGECACHE} # 67| Error: SHELLCHECK_WARNING (CWE-457): [#def602] /usr/share/podman/test/system/helpers.bash:73:12: warning[SC2154]: status is referenced but not assigned. # 71| # Do we already have it in image store? # 72| run_podman '?' image exists "$want" # 73|-> if [[ $status -eq 0 ]]; then # 74| return # 75| fi Error: SHELLCHECK_WARNING (CWE-571): [#def603] /usr/share/podman/test/system/helpers.bash:78:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 76| # 77| # No image. Do we have it already cached? (Replace / and : with --) # 78|-> local cachename=$(sed -e 's;[/:];--;g' <<<"$want") # 79| local cachepath="${PODMAN_IMAGECACHE}/${cachename}.tar" # 80| if [[ ! -e "$cachepath" ]]; then Error: SHELLCHECK_WARNING (CWE-563): [#def604] /usr/share/podman/test/system/helpers.bash:162:9: warning[SC2034]: BATS_TEST_NAME_PREFIX appears unused. Verify use (or export if used externally). # 160| BATS_TEST_NAME_PREFIX="|${output}| " # 161| else # 162|-> BATS_TEST_NAME_PREFIX="[${output}] " # 163| fi # 164| Error: SHELLCHECK_WARNING: [#def605] /usr/share/podman/test/system/helpers.bash:390:25: error[SC2066]: Since you double quoted this, it will not word split, and the loop will only run once. # 388| if [[ $status -ne 0 ]]; then # 389| echo "# [teardown] $_LOG_PROMPT podman $action" >&3 # 390|-> for line in "${lines[*]}"; do # 391| echo "# $line" >&3 # 392| done Error: SHELLCHECK_WARNING: [#def606] /usr/share/podman/test/system/helpers.bash:398:29: error[SC2066]: Since you double quoted this, it will not word split, and the loop will only run once. # 396| echo "# [teardown] $_LOG_PROMPT podman system locks" >&3 # 397| run $PODMAN system locks # 398|-> for line in "${lines[*]}"; do # 399| echo "# $line" >&3 # 400| done Error: SHELLCHECK_WARNING (CWE-571): [#def607] /usr/share/podman/test/system/helpers.bash:882:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 880| function skip_if_no_ssh() { # 881| if no_ssh; then # 882|-> local msg=$(_add_label_if_missing "$1" "ssh") # 883| skip "${msg:-not applicable with no ssh binary}" # 884| fi Error: SHELLCHECK_WARNING (CWE-571): [#def608] /usr/share/podman/test/system/helpers.bash:892:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 890| function skip_if_rootless() { # 891| if is_rootless; then # 892|-> local msg=$(_add_label_if_missing "$1" "rootless") # 893| skip "${msg:-not applicable under rootless podman}" # 894| fi Error: SHELLCHECK_WARNING (CWE-571): [#def609] /usr/share/podman/test/system/helpers.bash:902:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 900| function skip_if_not_rootless() { # 901| if ! is_rootless; then # 902|-> local msg=$(_add_label_if_missing "$1" "rootful") # 903| skip "${msg:-not applicable under rootlfull podman}" # 904| fi Error: SHELLCHECK_WARNING (CWE-571): [#def610] /usr/share/podman/test/system/helpers.bash:912:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 910| function skip_if_remote() { # 911| if is_remote; then # 912|-> local msg=$(_add_label_if_missing "$1" "remote") # 913| skip "${msg:-test does not work with podman-remote}" # 914| fi Error: SHELLCHECK_WARNING (CWE-571): [#def611] /usr/share/podman/test/system/helpers.bash:952:19: warning[SC2155]: Declare and assign separately to avoid masking return values. # 950| if is_rootless; then # 951| if ! is_cgroupsv2; then # 952|-> local msg=$(_add_label_if_missing "$1" "rootless cgroupvs1") # 953| skip "${msg:-not supported as rootless under cgroupsv1}" # 954| fi Error: SHELLCHECK_WARNING (CWE-571): [#def612] /usr/share/podman/test/system/helpers.bash:1076:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1074| local -a expect_split_q # 1075| for line in "${expect_split[@]}"; do # 1076|-> local q=$(printf "%q" "$line" | sed -e 's/\\ / /g') # 1077| expect_split_q+=("$q") # 1078| done Error: SHELLCHECK_WARNING (CWE-571): [#def613] /usr/share/podman/test/system/helpers.bash:1081:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 1079| local -a actual_split_q # 1080| for line in "${actual_split[@]}"; do # 1081|-> local q=$(printf "%q" "$line" | sed -e 's/\\ / /g') # 1082| actual_split_q+=("$q") # 1083| done Error: SHELLCHECK_WARNING (CWE-156): [#def614] /usr/share/podman/test/system/helpers.bash:1340:13: warning[SC2046]: Quote this to prevent word splitting. # 1338| # 1339| function sleep_to_next_second() { # 1340|-> sleep 0.$(printf '%04d' $((10000 - 10#$(date +%4N)))) # 1341| } # 1342| Error: SHELLCHECK_WARNING (CWE-571): [#def615] /usr/share/podman/test/system/helpers.network.bash:22:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 20| function skip_if_no_ipv4() { # 21| if ! has_ipv4; then # 22|-> local msg=$(_add_label_if_missing "$1" "IPv4") # 23| skip "${msg:-not applicable with no routable IPv4}" # 24| fi Error: SHELLCHECK_WARNING (CWE-571): [#def616] /usr/share/podman/test/system/helpers.network.bash:31:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 29| function skip_if_no_ipv6() { # 30| if ! has_ipv6; then # 31|-> local msg=$(_add_label_if_missing "$1" "IPv6") # 32| skip "${msg:-not applicable with no routable IPv6}" # 33| fi Error: SHELLCHECK_WARNING (CWE-571): [#def617] /usr/share/podman/test/system/helpers.network.bash:64:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 62| function skip_if_no_pasta() { # 63| if ! has_pasta; then # 64|-> local msg=$(_add_label_if_missing "$1" "pasta") # 65| skip "${msg:-not applicable with no pasta binary}" # 66| fi Error: SHELLCHECK_WARNING (CWE-569): [#def618] /usr/share/podman/test/system/helpers.network.bash:226:36: warning[SC2048]: Use "$@" (with quotes) to prevent whitespace problems. # 224| # # 225| # I'm so sorry for the ugliness. # 226|-> ip route list | $subnet_script $* # 227| } # 228| Error: SHELLCHECK_WARNING: [#def619] /usr/share/podman/test/system/helpers.network.bash:299:5: warning[SC2215]: This flag is used as a command name. Bad line break or missing [ .. ]? # 297| # 298| local lockfile=$PORT_LOCK_DIR/$port # 299|-> -e $lockfile || die "Cannot unreserve non-reserved port $port" # 300| assert "$(< $lockfile)" = "$BATS_SUITE_TEST_NUMBER" \ # 301| "Port $port is not reserved by this test" Error: SHELLCHECK_WARNING (CWE-685): [#def620] /usr/share/podman/test/system/helpers.network.bash:310:1: warning[SC2120]: random_free_port references arguments, but none are ever passed. # 308| # $2: Optional binding address, any IPv4 address by default # 309| # $3: Optional protocol, tcp or udp # 310|-> function random_free_port() { # 311| local range=${1:-5000-5999} # 312| local address=${2:-0.0.0.0} Error: SHELLCHECK_WARNING (CWE-571): [#def621] /usr/share/podman/test/system/helpers.network.bash:342:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 340| local maxtries=10 # 341| while [[ $maxtries -gt 0 ]]; do # 342|-> local firstport=$(random_free_port) # 343| local lastport= # 344| for i in $(seq 1 $((size - 1))); do Error: SHELLCHECK_WARNING (CWE-88): [#def622] /usr/share/podman/test/system/helpers.network.bash:421:21: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 419| # $3: Optional IPv4 or IPv6 address, or optional protocol, default: any # 420| function port_is_free() { # 421|-> ! port_is_bound ${@} # 422| } # 423| Error: SHELLCHECK_WARNING (CWE-563): [#def623] /usr/share/podman/test/system/helpers.registry.bash:85:5: warning[SC2034]: cid appears unused. Verify use (or export if used externally). # 83| -e REGISTRY_HTTP_TLS_KEY="/auth/domain.key" \ # 84| $REGISTRY_IMAGE # 85|-> cid="$output" # 86| # 87| wait_for_port 127.0.0.1 ${PODMAN_LOGIN_REGISTRY_PORT} Error: SHELLCHECK_WARNING (CWE-457): [#def624] /usr/share/podman/test/system/helpers.registry.bash:85:10: warning[SC2154]: output is referenced but not assigned. # 83| -e REGISTRY_HTTP_TLS_KEY="/auth/domain.key" \ # 84| $REGISTRY_IMAGE # 85|-> cid="$output" # 86| # 87| wait_for_port 127.0.0.1 ${PODMAN_LOGIN_REGISTRY_PORT} Error: SHELLCHECK_WARNING (CWE-398): [#def625] /usr/share/podman/test/system/helpers.registry.bash:115:20: warning[SC2115]: Use "${var:?}" to ensure this never expands to /* . # 113| # 114| if [[ $(id -u) -eq 0 ]]; then # 115|-> rm -rf ${PODMAN_LOGIN_WORKDIR}/* # 116| else # 117| # rootless image data is owned by a subuid Error: SHELLCHECK_WARNING (CWE-563): [#def626] /usr/share/podman/test/system/helpers.sig-proxy.bash:7:1: warning[SC2034]: SLEEPLOOP appears unused. Verify use (or export if used externally). # 5| # 6| # Command to run in each of the tests. # 7|-> SLEEPLOOP='trap "echo BYE;exit 0" INT;echo READY;while :;do sleep 0.1;done' # 8| # 9| # Main test code: wait for container to exist and be ready, send it a Error: SHELLCHECK_WARNING (CWE-457): [#def627] /usr/share/podman/test/system/helpers.sig-proxy.bash:20:17: warning[SC2154]: status is referenced but not assigned. # 18| sleep 0.5 # 19| run_podman '?' container exists $cname # 20|-> if [[ $status -eq 0 ]]; then # 21| break # 22| fi Error: SHELLCHECK_WARNING (CWE-457): [#def628] /usr/share/podman/test/system/helpers.sig-proxy.bash:39:18: warning[SC2154]: output is referenced but not assigned. # 37| sleep 0.5 # 38| run_podman logs $cname # 39|-> if [[ "$output" =~ BYE ]]; then # 40| break # 41| fi Error: SHELLCHECK_WARNING (CWE-457): [#def629] /usr/share/podman/test/system/helpers.systemd.bash:45:11: warning[SC2154]: output is referenced but not assigned. # 43| echo "$_LOG_PROMPT systemctl $wait start $unit" # 44| run systemctl $wait start "$unit" # 45|-> echo "$output" # 46| if [[ $status -eq 0 ]]; then # 47| return Error: SHELLCHECK_WARNING (CWE-457): [#def630] /usr/share/podman/test/system/helpers.systemd.bash:46:11: warning[SC2154]: status is referenced but not assigned. # 44| run systemctl $wait start "$unit" # 45| echo "$output" # 46|-> if [[ $status -eq 0 ]]; then # 47| return # 48| fi Error: SHELLCHECK_WARNING (CWE-571): [#def631] /usr/share/podman/test/system/helpers.systemd.bash:84:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 82| # 83| quadlet_to_service_name() { # 84|-> local filename=$(basename -- "$1") # 85| local extension="${filename##*.}" # 86| local filename="${filename%.*}" Error: SHELLCHECK_WARNING (CWE-563): [#def632] /usr/share/podman/test/system/helpers.t:26:1: warning[SC2034]: PORT_LOCK_DIR appears unused. Verify use (or export if used externally). # 24| # 25| # Used by random_free_port. # 26|-> PORT_LOCK_DIR=$PODMAN_TMPDIR/reserved-ports # 27| # 28| ############################################################################### Error: SHELLCHECK_WARNING (CWE-156): [#def633] /usr/share/podman/test/system/helpers.t:35:14: warning[SC2046]: Quote this to prevent word splitting. # 33| if [ "$1" = "$2" ]; then # 34| # Multi-level echo flattens newlines, makes success messages readable # 35|-> echo $(echo "ok $testnum $3 = $1") # 36| else # 37| echo "not ok $testnum $3" Error: SHELLCHECK_WARNING (CWE-563): [#def634] /usr/share/podman/test/system/helpers.t:150:5: warning[SC2034]: PODMAN_TEST_DEBUG appears unused. Verify use (or export if used externally). # 148| while read var expect name; do # 149| random_string=$(random_string 20) # 150|-> PODMAN_TEST_DEBUG="$var" result=$(dprint_test_1 "$random_string" 3>&1) # 151| expect_full="" # 152| if [ -n "$expect" -a "$expect" != "''" ]; then Error: SHELLCHECK_WARNING (CWE-477): [#def635] /usr/share/podman/test/system/helpers.t:152:23: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 150| PODMAN_TEST_DEBUG="$var" result=$(dprint_test_1 "$random_string" 3>&1) # 151| expect_full="" # 152|-> if [ -n "$expect" -a "$expect" != "''" ]; then # 153| expect_full="# dprint_test_1() : $random_string" # 154| fi Error: SHELLCHECK_WARNING (CWE-457): [#def636] /usr/share/podman/test/system/helpers.t:185:19: warning[SC2154]: output is referenced but not assigned. # 183| # 184| # ...and the possibly-multi-line $output # 185|-> check_result "$output" "${expect_output%%$nl}" "$testname: output" # 186| } # 187| Error: SHELLCHECK_WARNING (CWE-571): [#def637] /usr/share/podman/test/system/setup_suite.bash:23:12: warning[SC2155]: Declare and assign separately to avoid masking return values. # 21| mkdir "$PODMAN_LOGIN_WORKDIR" # 22| # 23|-> export PODMAN_LOGIN_USER="user$(random_string 4)" # 24| export PODMAN_LOGIN_PASS="pw$(random_string 15)" # 25| Error: SHELLCHECK_WARNING (CWE-571): [#def638] /usr/share/podman/test/system/setup_suite.bash:24:12: warning[SC2155]: Declare and assign separately to avoid masking return values. # 22| # 23| export PODMAN_LOGIN_USER="user$(random_string 4)" # 24|-> export PODMAN_LOGIN_PASS="pw$(random_string 15)" # 25| # 26| # FIXME: racy! It could be many minutes between now and when we start it. Error: SHELLCHECK_WARNING (CWE-571): [#def639] /usr/share/podman/test/system/setup_suite.bash:28:12: warning[SC2155]: Declare and assign separately to avoid masking return values. # 26| # FIXME: racy! It could be many minutes between now and when we start it. # 27| # To mitigate, we use a range not used anywhere else in system tests. # 28|-> export PODMAN_LOGIN_REGISTRY_PORT=$(random_free_port 27000-27999) # 29| # 30| # The above does not handle errors. Do a final confirmation. Error: GCC_ANALYZER_WARNING (CWE-1341): [#def640] podman-5.4.0_dev-build/podman-5.4.0-dev/pkg/rootless/rootless_linux.c:4: included_from: Included from here. podman-5.4.0_dev-build/podman-5.4.0-dev/pkg/rootless/rootless_linux.c: scope_hint: In function ‘cleanup_closep.part.0’ podman-5.4.0_dev-build/podman-5.4.0-dev/pkg/rootless/rootless_linux.c:51:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘*(void *)p’ # 49| int *pp = p; # 50| if (*pp >= 0) # 51|-> TEMP_FAILURE_RETRY (close (*pp)); # 52| } # 53| Error: GCC_ANALYZER_WARNING (CWE-1341): [#def641] podman-5.4.0_dev-build/podman-5.4.0-dev/pkg/rootless/rootless_linux.c:51:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘fd’ podman-5.4.0_dev-build/podman-5.4.0-dev/pkg/rootless/rootless_linux.c: scope_hint: In function ‘cleanup_closep.part.0’ # 49| int *pp = p; # 50| if (*pp >= 0) # 51|-> TEMP_FAILURE_RETRY (close (*pp)); # 52| } # 53| Error: GCC_ANALYZER_WARNING (CWE-775): [#def642] podman-5.4.0_dev-build/podman-5.4.0-dev/pkg/rootless/rootless_linux.c: scope_hint: In function ‘get_cmd_line_args’ podman-5.4.0_dev-build/podman-5.4.0-dev/pkg/rootless/rootless_linux.c:308:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/proc/self/cmdline", 0)’ # 306| char **argv; # 307| # 308|-> fd = open ("/proc/self/cmdline", O_RDONLY); # 309| if (fd < 0) # 310| return NULL; Error: GCC_ANALYZER_WARNING (CWE-401): [#def643] podman-5.4.0_dev-build/podman-5.4.0-dev/pkg/rootless/rootless_linux.c: scope_hint: In function ‘init’ podman-5.4.0_dev-build/podman-5.4.0-dev/pkg/rootless/rootless_linux.c:453:7: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/proc/self/fd")’ # 451| # 452| /* Store how many FDs were open before the Go runtime kicked in. */ # 453|-> d = opendir ("/proc/self/fd"); # 454| if (d) # 455| { Error: GCC_ANALYZER_WARNING (CWE-775): [#def644] podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/containers/storage/pkg/unshare/unshare.c: scope_hint: In function ‘parse_proc_stringlist’ podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/containers/storage/pkg/unshare/unshare.c:118:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(list, 0)’ # 116| new_size = used + BUFSTEP; # 117| new_buf = realloc(buf, new_size); # 118|-> if (new_buf == NULL) { # 119| free(buf); # 120| fprintf(stderr, "realloc(%ld): out of memory\n", (long)(size + BUFSTEP)); Error: GCC_ANALYZER_WARNING (CWE-775): [#def645] podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/containers/storage/pkg/unshare/unshare.c:125:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(list, 0)’ # 123| buf = new_buf; # 124| size = new_size; # 125|-> memset(buf + used, '\0', size - used); # 126| n = read(fd, buf + used, size - used - 1); # 127| if (n < 0) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def646] podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/containers/storage/pkg/unshare/unshare.c: scope_hint: In function ‘containers_reexec’ podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/containers/storage/pkg/unshare/unshare.c:125:28: warning[-Wanalyzer-malloc-leak]: leak of ‘parse_proc_stringlist("/proc/self/cmdline")’ # 123| buf = new_buf; # 124| size = new_size; # 125|-> memset(buf + used, '\0', size - used); # 126| n = read(fd, buf + used, size - used - 1); # 127| if (n < 0) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def647] podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/containers/storage/pkg/unshare/unshare.c:128:25: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ # 126| n = read(fd, buf + used, size - used - 1); # 127| if (n < 0) { # 128|-> fprintf(stderr, "read(): %m\n"); # 129| return NULL; # 130| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def648] podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/containers/storage/pkg/unshare/unshare.c: scope_hint: In function ‘parse_proc_stringlist’ podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/containers/storage/pkg/unshare/unshare.c:128:25: warning[-Wanalyzer-malloc-leak]: leak of ‘new_buf’ # 126| n = read(fd, buf + used, size - used - 1); # 127| if (n < 0) { # 128|-> fprintf(stderr, "read(): %m\n"); # 129| return NULL; # 130| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def649] podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/containers/storage/pkg/unshare/unshare.c:154:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ # 152| } # 153| } # 154|-> ret[i] = NULL; # 155| return ret; # 156| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def650] podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/containers/storage/pkg/unshare/unshare.c:154:16: warning[-Wanalyzer-malloc-leak]: leak of ‘new_buf’ # 152| } # 153| } # 154|-> ret[i] = NULL; # 155| return ret; # 156| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def651] podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/containers/storage/pkg/unshare/unshare.c: scope_hint: In function ‘containers_reexec’ podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/containers/storage/pkg/unshare/unshare.c:291:12: warning[-Wanalyzer-malloc-leak]: leak of ‘parse_proc_stringlist("/proc/self/cmdline")’ podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/containers/storage/pkg/unshare/unshare.c:18: included_from: Included from here. # 289| return fd; # 290| # 291|-> if (fexecve(fd, argv, environ) == -1) { # 292| close(fd); # 293| fprintf(stderr, "Error during reexec(...): %m\n"); Error: COMPILER_WARNING (CWE-1164): [#def652] podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/mattn/go-sqlite3/sqlite3.go:85:1: warning[-Wunused-function]: ‘_sqlite3_exec’ defined but not used # 85 | _sqlite3_exec(sqlite3* db, const char* pcmd, long long* rowid, long long* changes) # | ^~~~~~~~~~~~~ # 83| # 84| static int # 85|-> _sqlite3_exec(sqlite3* db, const char* pcmd, long long* rowid, long long* changes) # 86| { # 87| int rv = sqlite3_exec(db, pcmd, 0, 0, 0); Error: GCC_ANALYZER_WARNING (CWE-476): [#def653] podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/miekg/pkcs11/pkcs11.go: scope_hint: In function 'New' podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/miekg/pkcs11/pkcs11.go:77:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'c' # 75| CK_C_GetFunctionList list; # 76| struct ctx *c = calloc(1, sizeof(struct ctx)); # 77|-> c->handle = dlopen(module, RTLD_LAZY); # 78| if (c->handle == NULL) { # 79| free(c); Error: GCC_ANALYZER_WARNING (CWE-476): [#def654] podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/miekg/pkcs11/pkcs11.go: scope_hint: In function ‘New’ podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/miekg/pkcs11/pkcs11.go:77:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘c’ # 75| CK_C_GetFunctionList list; # 76| struct ctx *c = calloc(1, sizeof(struct ctx)); # 77|-> c->handle = dlopen(module, RTLD_LAZY); # 78| if (c->handle == NULL) { # 79| free(c); Error: GCC_ANALYZER_WARNING (CWE-401): [#def655] podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/miekg/pkcs11/pkcs11.go: scope_hint: In function ‘GetAttributeValue.part.0’ podman-5.4.0_dev-build/podman-5.4.0-dev/vendor/github.com/miekg/pkcs11/pkcs11.go:316:32: warning[-Wanalyzer-malloc-leak]: leak of ‘*((CK_ATTRIBUTE *)temp).pValue’ # 314| continue; # 315| } # 316|-> temp[i].pValue = calloc(temp[i].ulValueLen, sizeof(CK_BYTE)); # 317| } # 318| return c->sym->C_GetAttributeValue(session, object, temp, templen);
analyzer-version-clippy | 1.82.0 |
analyzer-version-cppcheck | 2.16.0 |
analyzer-version-gcc | 14.2.1 |
analyzer-version-gcc-analyzer | 14.2.1 |
analyzer-version-shellcheck | 0.10.0 |
analyzer-version-unicontrol | 0.0.2 |
enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
exit-code | 0 |
host | ip-172-16-1-117.us-west-2.compute.internal |
mock-config | fedora-rawhide-x86_64 |
project-name | podman-5.4.0~dev-1.20241114112933318402.pr24561.193.2e22ab3bc |
store-results-to | /tmp/tmp6rdf8zl4/podman-5.4.0~dev-1.20241114112933318402.pr24561.193.2e22ab3bc.tar.xz |
time-created | 2024-11-14 11:57:53 |
time-finished | 2024-11-14 12:09:27 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmp6rdf8zl4/podman-5.4.0~dev-1.20241114112933318402.pr24561.193.2e22ab3bc.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '/tmp/tmp6rdf8zl4/podman-5.4.0~dev-1.20241114112933318402.pr24561.193.2e22ab3bc.src.rpm' |
tool-version | csmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9 |