| sed 's/-$//g')
for off in $sessions; do
ts_init_subtest $name-$off
- $TS_CMD_BLKID --probe --output udev $outimg --hint session_offset=$(( $off * 2048 )) \
+ $TS_CMD_BLKID --probe --output udev $outimg --hint session_offset=$(( off * 2048 )) \
2> "$TS_ERRLOG" | sort > "$TS_OUTPUT"
ts_finalize_subtest
done
create_file
echo "offset: $(( 2 * $BS ))"
- "$TS_CMD_FADVISE" --offset $(( 2 * $BS )) "$FILE"
+ "$TS_CMD_FADVISE" --offset $(( 2 * BS )) "$FILE"
echo status: $?
do_fincore
echo
create_file
echo "length: $(( 4 * $BS ))"
- "$TS_CMD_FADVISE" --length $(( 4 * $BS )) "$FILE"
+ "$TS_CMD_FADVISE" --length $(( 4 * BS )) "$FILE"
echo status: $?
do_fincore
echo
create_file
echo "offset: $(( 2 * $BS )), length: $(( 4 * $BS )) fd: 42"
- "$TS_CMD_FADVISE" --offset $(( 2 * $BS )) --length $(( 4 * $BS )) --fd 42 42<"$FILE"
+ "$TS_CMD_FADVISE" --offset $(( 2 * BS )) --length $(( 4 * BS )) --fd 42 42<"$FILE"
echo status: $?
do_fincore
echo
# inmterval <3,5>.
#
ts_init_subtest "${subtest_prefix}time-check"
- TIMEDIFF=$(( $END - $START ))
+ TIMEDIFF=$(( END - START ))
if [ $TIMEDIFF -lt 3 ]; then
ts_log "general lock failed [$TIMEDIFF sec]"
elif [ $TIMEDIFF -gt 5 ]; then
ts_log "load original values"
for i in $IPCS_IDX; do
- SHM_ORG[$i]=$(cat ${IPCS_PROCFILES[$i]})
+ SHM_ORG[i]=$(cat ${IPCS_PROCFILES[i]})
done >> "$TS_OUTPUT"
ts_log "maximize kernel setting"
for i in $IPCS_IDX; do
- echo ${IPCS_LIMITS[$i]} >> ${IPCS_PROCFILES[$i]}
+ echo ${IPCS_LIMITS[i]} >> ${IPCS_PROCFILES[i]}
done >> "$TS_OUTPUT"
ts_log "check for difference between kernel and IPC"
ts_log "write original values to kernel"
for i in $IPCS_IDX; do
- echo ${SHM_ORG[$i]} >> ${IPCS_PROCFILES[$i]}
+ echo ${SHM_ORG[i]} >> ${IPCS_PROCFILES[i]}
done >> "$TS_OUTPUT"
ts_finalize
echo 0 > "$TS_OUTPUT"
SYNCTIME=$(( $(date +%s) + 5 ))
-for id in $(seq 0 $(( $NPROCESSES - 1 ))); do
+for id in $(seq 0 $(( NPROCESSES - 1 ))); do
ts_run $TESTPROG --lock --synctime $SYNCTIME "$TS_OUTPUT" $NLOOPS >> "$TS_OUTPUT".debug 2>&1 &
done
truncate -s $(( 4096 * 10 )) "$outimg" > "$TS_ERRLOG" 2>&1
rm -f "$outimg.offset"
-truncate -s $(( 4096 * 10 + $offset )) "$outimg.offset" > "$TS_ERRLOG" 2>&1
+truncate -s $(( 4096 * 10 + offset )) "$outimg.offset" > "$TS_ERRLOG" 2>&1
"$TS_CMD_MKSWAP" -q -U "$UUID" -p 4096 "$outimg" \
>> "$TS_OUTPUT" 2>/dev/null \
for idx in $(seq 0 $(( ${#COMM[*]} - 1 ))); do
- cmd=${COMM[$idx]}
- name=${NAME[$idx]}
+ cmd=${COMM[idx]}
+ name=${NAME[idx]}
ts_init_subtest "$label-$idx-$name"
echo -e "$cmd\n" >> "$TS_OUTPUT"
echo ',10M,L' | $TS_CMD_SFDISK --no-reread --append ${TS_DEVICE} &> /dev/null
udevadm settle
- idx=$(( $idx + 1 ))
+ idx=$(( idx + 1 ))
ts_init_subtest "$label-$idx-reduce-midle"
cmd=',-5M'
echo -e "$cmd\n" >> "$TS_OUTPUT"
udevadm settle
ts_finalize_subtest
- idx=$(( $idx + 1 ))
+ idx=$(( idx + 1 ))
ts_init_subtest "$label-$idx-max-last"
cmd='-5M,+'
echo -e "$cmd\n" >> "$TS_OUTPUT"
IMAGE=${TS_OUTDIR}/${TS_TESTNAME}.file
PAGE_SIZE=$($TS_HELPER_SYSINFO pagesize)
-PAGE_SIZE_KB=$(( $PAGE_SIZE / 1024 ))
-MIN_SWAP_SIZE=$(( 10 * $PAGE_SIZE ))
+PAGE_SIZE_KB=$(( PAGE_SIZE / 1024 ))
+MIN_SWAP_SIZE=$(( 10 * PAGE_SIZE ))
MIN_SWAP_SIZE_KB=$(( MIN_SWAP_SIZE / 1024 ))
rm -f $IMAGE
-$TS_CMD_FALLOCATE --posix --length $(( $MIN_SWAP_SIZE - 1 )) $IMAGE 2> /dev/null
+$TS_CMD_FALLOCATE --posix --length $(( MIN_SWAP_SIZE - 1 )) $IMAGE 2> /dev/null
$TS_CMD_MKSWAP \
--label 1234567890abcdef \
--uuid 12345678-abcd-abcd-abcd-1234567890ab \
--uuid 12345678-abcd-abcd-abcd-1234567890ab \
$IMAGE >> "$TS_OUTPUT" 2>> "$TS_ERRLOG"
-sed -i -e "s/ $(( $MIN_SWAP_SIZE_KB - $PAGE_SIZE_KB )) KiB/ 9 pages/" \
- -e "s/($(( $MIN_SWAP_SIZE - $PAGE_SIZE )) bytes)/(9xPGSZ bytes)/" \
+sed -i -e "s/ $(( MIN_SWAP_SIZE_KB - PAGE_SIZE_KB )) KiB/ 9 pages/" \
+ -e "s/($(( MIN_SWAP_SIZE - PAGE_SIZE )) bytes)/(9xPGSZ bytes)/" \
-e "s:$IMAGE:<swapfile>:g" \
-e "s/insecure permissions [0-9]*/insecure permissions <perm>/g" \
"$TS_OUTPUT" "$TS_ERRLOG"
#
echo "S2SUSPEND " > "$TS_OUTPUT".signature
dd if="$TS_OUTPUT".signature of=$DEVICE \
- seek=$(( $PAGESIZE - 10 )) count=10 bs=1 conv=notrunc &> /dev/null
+ seek=$(( PAGESIZE - 10 )) count=10 bs=1 conv=notrunc &> /dev/null
ts_device_has "TYPE" "swsuspend" $DEVICE || ts_die "Cannot find swsuspend on $DEVICE"
#there should be just one magic string/backup file in this case
INFILE=$(find "$backups/" -iname "wipefs-$(basename "${img}")-*.bak")
OFFT=$(echo $INFILE | sed 's/^.*-\(.*\).bak$/\1/')
-dd if=$INFILE of=$img bs=1 conv=notrunc seek=$(($OFFT)) &>/dev/null
+dd if=$INFILE of=$img bs=1 conv=notrunc seek=$((OFFT)) &>/dev/null
#the bytes should be copied back, check if wipefs can recognize it
$TS_CMD_WIPEFS -a ${img} > $TS_OUTDIR/out 2>/dev/null