diff --git a/tests/zfs-tests/cmd/xattrtest/xattrtest.c b/tests/zfs-tests/cmd/xattrtest/xattrtest.c index 22f798db26..6b07d141ae 100644 --- a/tests/zfs-tests/cmd/xattrtest/xattrtest.c +++ b/tests/zfs-tests/cmd/xattrtest/xattrtest.c @@ -51,7 +51,7 @@ extern char *program_invocation_short_name; program_invocation_short_name, __FILE__, __LINE__, \ __func__, ## __VA_ARGS__); -static const char shortopts[] = "hvycdn:f:x:s:p:t:e:rRk"; +static const char shortopts[] = "hvycdn:f:x:s:p:t:e:rRko:"; static const struct option longopts[] = { { "help", no_argument, 0, 'h' }, { "verbose", no_argument, 0, 'v' }, @@ -68,9 +68,19 @@ static const struct option longopts[] = { { "random", no_argument, 0, 'r' }, { "randomvalue", no_argument, 0, 'R' }, { "keep", no_argument, 0, 'k' }, + { "only", required_argument, 0, 'o' }, { 0, 0, 0, 0 } }; +enum phases { + PHASE_ALL = 0, + PHASE_CREATE, + PHASE_SETXATTR, + PHASE_GETXATTR, + PHASE_UNLINK, + PHASE_INVAL +}; + static int verbose = 0; static int verify = 0; static int synccaches = 0; @@ -78,18 +88,22 @@ static int dropcaches = 0; static int nth = 0; static int files = 1000; static int xattrs = 1; -static int size = 1; +static int size = 6; static int size_is_random = 0; static int value_is_random = 0; static int keep_files = 0; +static int phase = PHASE_ALL; static char path[PATH_MAX] = "/tmp/xattrtest"; static char script[PATH_MAX] = "/bin/true"; +static char xattrbytes[XATTR_SIZE_MAX]; static int usage(int argc, char **argv) { fprintf(stderr, "usage: %s [-hvycdrRk] [-n ] [-f ] [-x ]\n" - " [-s ] [-p ] [-t