Commit 5bbdf39f authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Added missing "wait" statements. Test lock files created by a remote system.

parent f9f7baf0
......@@ -47,7 +47,7 @@ expect {
send "\n"
set test "read-only dbck died"
expect {
eof { pass "$test" }
eof { pass "$test"; wait }
}
unset test
......@@ -66,7 +66,7 @@ expect {
send "\n"
set test "read-write dbck died"
expect {
eof { pass "$test" }
eof { pass "$test"; wait }
}
unset test
......@@ -85,7 +85,7 @@ expect {
send "\n"
set test "read-write lyskomd died"
expect {
eof { pass "$test" }
eof { pass "$test"; wait }
}
unset test
......@@ -100,29 +100,50 @@ lyskomd_start
system "kill -KILL $lyskomd_pid"
set test "lyskomd was killed"
expect {
eof { pass "$test" }
eof { pass "$test"; wait }
}
# Start a new lyskomd. Check that it removes the stale lock file.
set new_pid [spawn ../lyskomd -d config/lyskomd-config]
set test "stale lock file removed"
expect {
-re "Stale lock file left by $any*:$lyskomd_pid removed\.$nl" {
-re " $new_pid Stale lock file left by $any*:$lyskomd_pid removed\.$nl" {
pass "$test"
}
}
system "kill -HUP $lyskomd_pid"
system "kill -HUP $new_pid"
set test "non-stale lyskomd sent final line"
expect {
-re "^\[0-9 :\]* Press enter to terminate lyskomd$nl" {
-re "^\[0-9 :\]* $new_pid Press enter to terminate lyskomd$nl" {
pass "$test"
}
}
send "\n"
set test "non-stale lyskomd died"
expect {
eof { pass "$test" }
eof { pass "$test"; wait }
}
unset test
# Start a new lyskomd while a lock file for a remote system exists.
system "ln -s inet.lysator.liu.se:4711 db/lyskomd-lock"
spawn ../lyskomd -d config/lyskomd-config
set test "remote lock file found"
expect {
-re "Database locked by inet\.lysator\.liu\.se:4711$nl" {
pass "$test"
}
}
set test "local lyskomd sent final line"
expect {
-re "^\[0-9 :\]* Press enter to terminate lyskomd$nl" {
pass "$test"
}
}
send "\n"
set test "local lyskomd died"
expect {
eof { pass "$test"; wait }
}
unset test
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment