1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

test: insert space in for loop

This commit is contained in:
Yu Watanabe 2022-06-14 21:05:10 +09:00
parent 47ba157cc0
commit 2f34ee3329
5 changed files with 12 additions and 12 deletions

View File

@ -18,18 +18,18 @@ function check_validity() {
function check() { function check() {
local i j local i j
for ((i=0;i<2;i++)); do for ((i = 0; i < 2; i++)); do
systemctl restart systemd-udevd.service systemctl restart systemd-udevd.service
udevadm control --ping udevadm control --ping
udevadm settle udevadm settle
check_validity check_validity
for ((j=0;j<2;j++)); do for ((j = 0; j < 2; j++)); do
udevadm trigger -w --action add --subsystem-match=block udevadm trigger -w --action add --subsystem-match=block
check_validity check_validity
done done
for ((j=0;j<2;j++)); do for ((j = 0; j < 2; j++)); do
udevadm trigger -w --action change --subsystem-match=block udevadm trigger -w --action change --subsystem-match=block
check_validity check_validity
done done

View File

@ -149,7 +149,7 @@ EOF
evemu-device /run/lidswitch.evemu & evemu-device /run/lidswitch.evemu &
KILL_PID="$!" KILL_PID="$!"
for ((i=0;i<20;i++)); do for ((i = 0; i < 20; i++)); do
if (( i != 0 )); then sleep .5; fi if (( i != 0 )); then sleep .5; fi
INPUT_NAME=$(grep -l '^Fake Lid Switch' /sys/class/input/*/device/name || :) INPUT_NAME=$(grep -l '^Fake Lid Switch' /sys/class/input/*/device/name || :)
@ -287,7 +287,7 @@ EOF
# check session # check session
ret=1 ret=1
for ((i=0;i<30;i++)); do for ((i = 0; i < 30; i++)); do
if (( i != 0)); then sleep 1; fi if (( i != 0)); then sleep 1; fi
if check_session; then if check_session; then
ret=0 ret=0
@ -315,7 +315,7 @@ EOF
# coldplug: logind started with existing device # coldplug: logind started with existing device
systemctl stop systemd-logind.service systemctl stop systemd-logind.service
modprobe scsi_debug modprobe scsi_debug
for ((i=0;i<30;i++)); do for ((i = 0; i < 30; i++)); do
if (( i != 0)); then sleep 1; fi if (( i != 0)); then sleep 1; fi
if dev=/dev/$(ls /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/*:*/block 2>/dev/null); then if dev=/dev/$(ls /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/*:*/block 2>/dev/null); then
break break
@ -342,7 +342,7 @@ EOF
# hotplug: new device appears while logind is running # hotplug: new device appears while logind is running
rmmod scsi_debug rmmod scsi_debug
modprobe scsi_debug modprobe scsi_debug
for ((i=0;i<30;i++)); do for ((i = 0; i < 30; i++)); do
if (( i != 0)); then sleep 1; fi if (( i != 0)); then sleep 1; fi
if dev=/dev/$(ls /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/*:*/block 2>/dev/null); then if dev=/dev/$(ls /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/*:*/block 2>/dev/null); then
break break

View File

@ -197,7 +197,7 @@ start_mon() {
} }
wait_mon() { wait_mon() {
for ((i=0;i<10;i++)); do for ((i = 0; i < 10; i++)); do
if (( i != 0 )); then sleep 1; fi if (( i != 0 )); then sleep 1; fi
if grep -q "$1" "$mon"; then break; fi if grep -q "$1" "$mon"; then break; fi
done done
@ -228,7 +228,7 @@ EOF
echo 'disable NTP' echo 'disable NTP'
timedatectl set-ntp false timedatectl set-ntp false
for ((i=0;i<10;i++)); do for ((i = 0; i < 10; i++)); do
if (( i != 0 )); then sleep 1; fi if (( i != 0 )); then sleep 1; fi
if [[ "$(systemctl show systemd-timesyncd --property ActiveState)" == "ActiveState=inactive" ]]; then if [[ "$(systemctl show systemd-timesyncd --property ActiveState)" == "ActiveState=inactive" ]]; then
break; break;
@ -243,7 +243,7 @@ EOF
timedatectl set-ntp true timedatectl set-ntp true
wait_mon "NTP" "BOOLEAN true" wait_mon "NTP" "BOOLEAN true"
assert_ntp "true" assert_ntp "true"
for ((i=0;i<10;i++)); do for ((i = 0; i < 10; i++)); do
if (( i != 0 )); then sleep 1; fi if (( i != 0 )); then sleep 1; fi
if [[ "$(systemctl show systemd-timesyncd --property ActiveState)" == "ActiveState=active" ]]; then if [[ "$(systemctl show systemd-timesyncd --property ActiveState)" == "ActiveState=active" ]]; then
break; break;

View File

@ -27,7 +27,7 @@ inspect() {
} }
wait_for_state() { wait_for_state() {
for ((i=0;i<10;i++)) ; do for ((i = 0; i < 10; i++)) ; do
homectl inspect "$1" | grep -qF "State: $2" && break homectl inspect "$1" | grep -qF "State: $2" && break
sleep .5 sleep .5
done done

View File

@ -32,7 +32,7 @@ EOF
# Trigger the mount ratelimiting # Trigger the mount ratelimiting
cd "$(mktemp -d)" cd "$(mktemp -d)"
mkdir foo mkdir foo
for ((i=0;i<50;++i)); do for ((i = 0; i < 50; i++)); do
mount --bind foo foo mount --bind foo foo
umount foo umount foo
done done