ztest: Fix ztest_run_zdb() failure

It's possible for ztest to be killed while the pool is exported
which results in an empty cache file.  This is a valid state to
test, but the validation check performed by ztest_run_zdb()
depends on the pool being in the cache file.  If it's not the
following error is printed.

    zdb -bccsv -G -d -Y -U /tmp/zloop-run/zpool.cache ztest
    zdb: can't open '/tmp/zloop-run': No such file or directory

Resolve these failures by removing the dependency on the cache
file.  Functionally, we only care that the pool can be imported
and that the zdb verification passes.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #10385
This commit is contained in:
Brian Behlendorf 2020-05-29 21:14:10 -07:00 committed by GitHub
parent 4d829ad9c1
commit 3d93161b01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -6457,11 +6457,11 @@ ztest_run_zdb(char *pool)
ztest_get_zdb_bin(bin, len); ztest_get_zdb_bin(bin, len);
(void) sprintf(zdb, (void) sprintf(zdb,
"%s -bcc%s%s -G -d -Y -U %s %s", "%s -bcc%s%s -G -d -Y -e -p %s %s",
bin, bin,
ztest_opts.zo_verbose >= 3 ? "s" : "", ztest_opts.zo_verbose >= 3 ? "s" : "",
ztest_opts.zo_verbose >= 4 ? "v" : "", ztest_opts.zo_verbose >= 4 ? "v" : "",
spa_config_path, ztest_opts.zo_dir,
pool); pool);
if (ztest_opts.zo_verbose >= 5) if (ztest_opts.zo_verbose >= 5)