Commit d78bef37 authored by Julius Roob's avatar Julius Roob Committed by Bernd Lietzow

mgmtd: Test recovery from missing target states and warning logs.

parent 5cee708b
# The mgmtd should recover from an erroneous empty map in the targetStates file.
on node do
shutdown_daemon_soft(node, "mgmtd")
# Four zero bytes are what the serializer produces for an empty std::map.
# (32-bit length + entries)
shell "echo -en '\\x00\\x00\\x00\\x00'"\
"> #{node.properties["mgmtd"]["config"]["storeMgmtdDirectory"]}/targetStates"
startup_daemon(node, "mgmtd", node.properties["mgmtd"]["config"])
# The mgmtd should recognize the missing state on loading and warn the user.
wait_daemon_log(node, "mgmtd",
"Storage target [0-9]+ missing in targetStates. Consistency state is lost", 30)
restart_daemon_soft(node, "storage", "store0")
# Should appear almost instantaneously, but give it 30 seconds before failing.
wait_daemon_log(node, "store0", "Registration and management info download complete.", 30)
result = shell? "echo -en '\\x00\\x00\\x00\\x00'"\
"| cmp - "\
"#{node.properties["mgmtd"]["config"]["storeMgmtdDirectory"]}/targetStates"
raise "The targetStates is still an empty map (serialized to 0x00000000)." if result
end
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