A previous commit changed the plaintext_name to a unique per-test name,
so there is no need to match the ask_password content on 'scsi_debug' now,
since just matching the plaintext_name should be unique.
This removes the systemctl start, as the service should already be
running (or starting, or failed). Instead, just wait for the service
to actually reach 'active' or 'failed' state. Then, only stop the
service if its state is 'active'.
Previous attempts to fix hung or flaky test runs included adding a start
before the stop, but the start-the-stop calls can lead to cancelled jobs
instead of a properly stopped service, which is again flaky.
Setting the plaintext name to include the testname makes debugging failures
easier.
Also for convenience, create service_name field in setup method, for use
in tests and/or teardown method.
On fast ppc64el machines, cryptsetup start job may not complete by the time
tearDown is executed. In that case stop, causes to simply cancel the start job
without actually cleaning up the dmsetup node. This leads to failing subsequent
test as it no longer starts with a clean device. Thus ensure the
systemd-cryptsetup unit is started, before stopping it.
Also rmmod scsi_debug module at the end, to allow re-running the test in a
loop.