mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-08-04 07:43:23 +00:00
test/others/crit/test.sh: use bash array
In fact an array (aptly named array) is already used in run_test2, so let's just make it an array right from the start. While at it, remove ls invocation. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
parent
ebe8770431
commit
6128eb6185
1 changed files with 5 additions and 7 deletions
|
|
@ -6,7 +6,7 @@ set -x
|
|||
# shellcheck source=test/others/env.sh
|
||||
source ../env.sh
|
||||
|
||||
images_list=""
|
||||
images_list=()
|
||||
|
||||
function gen_imgs {
|
||||
PID=$(../loop)
|
||||
|
|
@ -17,15 +17,15 @@ function gen_imgs {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
images_list=$(ls -1 ./*.img)
|
||||
if [ -z "$images_list" ]; then
|
||||
images_list=(./*.img)
|
||||
if [ "${#images_list[@]}" -eq 0 ]; then
|
||||
echo "Failed to generate images"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function run_test1 {
|
||||
for x in $images_list
|
||||
for x in "${images_list[@]}"
|
||||
do
|
||||
echo "=== $x"
|
||||
if [[ $x == *pages* ]]; then
|
||||
|
|
@ -46,9 +46,7 @@ function run_test1 {
|
|||
|
||||
|
||||
function run_test2 {
|
||||
mapfile -t array <<< "$images_list"
|
||||
|
||||
PROTO_IN=${array[0]}
|
||||
PROTO_IN="${images_list[0]}"
|
||||
JSON_IN=$(mktemp -p ./ tmp.XXXXXXXXXX.json)
|
||||
OUT=$(mktemp -p ./ tmp.XXXXXXXXXX.log)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue