def run_once(self): logging.info("In run_once function.. ") logging.info("create pool..") disks = libzfs_common.get_free_disks() version = "1" status = libzpool.create(TESTPOOL, disks[0]) if status != SUCCESS: raise error.TestFail("zpool create failed.. ") logging.info("create zvol on pool..") status = libzfs.create_zvol(TESTPOOL, "2G", TESTVOL) if status != SUCCESS: raise error.TestFail("cannot create zvol..") list_args = ["list", "list -r", "list "+TESTPOOL+"/"+TESTVOL, "list -r "+TESTPOOL+"/"+TESTVOL, "list -H "+TESTPOOL+"/"+TESTVOL, "list -Hr "+TESTPOOL+"/"+TESTVOL, "list -rH "+TESTPOOL+"/"+TESTVOL, "list -o name "+TESTPOOL+"/"+TESTVOL, "list -r -o name "+TESTPOOL+"/"+TESTVOL, "list -H -o name "+TESTPOOL+"/"+TESTVOL, "list -rH -o name "+TESTPOOL+"/"+TESTVOL] logging.info("Executing well-formed 'zfs list' commands") for i in list_args: utils.system("zfs " + i + " > /dev/null") logging.info("Executing zfs list on volume works as expected")
def run_once(self): logging.info("In run_once function.. ") logging.info("create pool of version 1.. ") disks = libzfs_common.get_free_disks() version = "1" status = libzpool.create(TESTPOOL, disks[0]) if status != SUCCESS: raise error.TestFail("zpool create failed.. ") logging.info("create zvol on pool..") status = libzfs.create_zvol(TESTPOOL, "2G", TESTVOL) if status != SUCCESS: raise error.TestFail("cannot create zvol..") list_args = ["", "create -V", "create -V " + TESTPOOL, "create -V " + TESTPOOL + "/" + TESTVOL + "@", "create -V blah", "destroy"] logging.info("Try each ZFS volume sub-command without parameters to\ make sure it returns an error.") for i in list_args: try: status = SUCCESS utils.system_output("zfs " + i) except: status = FAIL if status == FAIL: logging.info("Badly formed ZFS volume sub-commands fail as expected.") else: raise error.TestFail("ZFS volume sub-commands succeeded unexpectedly.")
def run_once(self): logging.info("In run_once function.. ") logging.info("create pool of version 1.. ") disks = libzfs_common.get_free_disks() version = "1" status = libzpool.create(TESTPOOL, disks[0]) if status != SUCCESS: raise error.TestFail("zpool create failed.. ") logging.info("Creating a volume a 50 letter name should work..") status = libzfs.create_zvol(TESTPOOL, "2G", LONGVOLNAME) if status != SUCCESS: raise error.TestFail("failed to create zvol..") status = libzfs.dataset_exists(TESTPOOL + "/" + LONGVOLNAME) if status != SUCCESS: raise error.TestFail("Couldn't find long volume name") logging.info("Created a 50-letter zvol volume name")