def run_once(self): logging.info("In run_once function.. ") logging.info("Here we will create the pool..") disks = libzfs_common.get_free_disks() status = libzpool.create(TESTPOOL, disks[0]) if status != SUCCESS: raise error.TestFail("zpool create failed..") logging.info("Create a file system and set its mount point....") utils.system("mkdir -p " + TESTDIR) libzfs.create(TESTPOOL, fs1) libzfs.set_property(TESTPOOL, fs1, "mountpoint", TESTDIR) logging.info("Create nested file system..") libzfs.create(TESTPOOL, fs2) status = libzfs.destroy(TESTPOOL, fs1) if status == SUCCESS: raise error.TestFail("Parent file system destroyed..") logging.info("The nestedfs test passed successfully..") return SUCCESS
def run_once(self): logging.info("In run_once function.. ") logging.info("Here we will create the pool..") disks = "/dev/sda1" libzpool.create(TESTPOOL, disks) logging.info("Create a file system with mount point, so it will mount automatically..") utils.system("mkdir -p " + TESTDIR) fs = TESTPOOL + "/" + TESTFS libzfs.create(fs) libzfs.set_mount_point(TESTDIR,fs) status = libzfs.is_mounted(fs) if status != SUCCESS : raise error.TestFail("File system " + TESTFS +" is not mounted..") logging.info("Unmount the file system..") libzfs.unmount(fs) logging.info("Make sure file system " + fs + " is unmounted..") status = libzfs.is_mounted(fs) if status == SUCCESS : raise error.TestFail("File system " + fs +" is mounted..") logging.info("File system " + fs +" is unmounted..") logging.info("Here we will mount the file system..") fs = TESTPOOL + "/" + TESTFS libzfs.mount(fs) logging.info("Make sure the file system is mounted..") status = libzfs.is_mounted(fs) if status != SUCCESS : raise error.TestFail("File system " + TESTFS +" is not mounted..") logging.info("Unmount the file system..") libzfs.unmount(fs) logging.info("Make sure the file system is unmounted..") status = libzfs.is_mounted(fs) if status == SUCCESS : raise error.TestFail("File system " + TESTFS +" is mounted..") logging.info("Mount test passed successfully..") return SUCCESS