aio: fix the tests when ZFS is not available

Don't try to cleanup the zpool if we couldn't create a zpool in the
first place.

Submitted by:	tmunro
MFC-with:	022ca2fc7f
This commit is contained in:
Alan Somers 2021-01-09 17:14:55 -07:00
parent 408c514f73
commit 19cca0b961
2 changed files with 5 additions and 0 deletions

View File

@ -3263,6 +3263,7 @@ vdev_load(vdev_t *vd)
/*
* Recursively load all children.
* TODO: parallelize.
*/
for (int c = 0; c < vd->vdev_children; c++) {
error = vdev_load(vd->vdev_child[c]);

View File

@ -943,6 +943,10 @@ aio_zvol_cleanup(void)
char cmd[160];
pidfile = fopen("pidfile", "r");
if (pidfile == NULL && errno == ENOENT) {
/* Setup probably failed */
return;
}
ATF_REQUIRE_MSG(NULL != pidfile, "fopen: %s", strerror(errno));
ATF_REQUIRE_EQ(1, fscanf(pidfile, "%d", &testpid));
fclose(pidfile);