Default to /tmp for scenario (create|get)_timestamp()
Long ago, the (create|get)_timestamp() calls wrote to and read from
/tmp by default but were changed to default to /mnt in change
I527557a3cf3618ffa6589dbd1dbc92f2268ed50e, when the dev_name kwarg
was added.
This makes sense if dev_name was passed and the device is mounted to
mount_path, but if dev_name was not specified, writing the timestamp to
a mount_path of /mnt can cause issues in some scenario tests when
servers have an ephemeral disk and a CirrOS image is used.
CirrOS mounts the first ephemeral disk to /mnt if one is found:
https://github.com/cirros-dev/cirros/blob/0322c12289d32f825b176d5f46cd88a78b8461a3/src/sbin/cirros-apply#L90
So if a flavor with ephemeral=1 is configured in tempest.conf, scenario
tests that create a server, write a timestamp file, snapshot the
server, create another server from the snapshot, and then try to read
the timestamp back from the second server, will incorrectly fail because
the /mnt/timestamp file was on the ephemeral disk which will not be
copied over during a snapshot or shelve offload..
This changes (create|get)_timestamp() to write/read from /tmp by default
and only use mount_path if a dev_name to mount was supplied.
Change-Id: Iec41ff7cba616fd469de0019f76ab54072f6fc28
1 file changed