Whamcloud - gitweb
EX-4539 lipe: lipe_find3 print updates
authorJohn L. Hammond <jhammond@whamcloud.com>
Fri, 25 Feb 2022 23:12:54 +0000 (17:12 -0600)
committerJohn L. Hammond <jhammond@whamcloud.com>
Thu, 10 Mar 2022 17:27:09 +0000 (17:27 +0000)
Change -print-json to accept a comma separated list of
attributes. Optional attributes may be specified by placing them
inside brackets. For example "lipe_find3 DEVICE -print-json
'uid,gid,som,[size,blocks]' will only print JSON for inodes with a
valid UID, GID, and SoM atrribute. If in addition the size and blocks
attributes of the inode are valid then they will be included in the
object as well. Support a pass-through --list-json-attrs option.

Change the default action to print to relative path. Adjust
sanity-lipe-find3 accordingly.

Test-Parameters: trivial testlist=sanity-lipe-find3 serverextra_install_params="--packages lipe-scan"
Test-Parameters: trivial testlist=sanity-lipe-scan3 serverextra_install_params="--packages lipe-scan" facet=mds1
Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: Id380ca21e2b1aabf30f65fd3e14b7e2f7808d0a6
Reviewed-on: https://review.whamcloud.com/46630
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lipe/src/lipe_find3/NOTES
lipe/src/lipe_find3/lf3_lexer.l
lipe/src/lipe_find3/lf3_parse.y
lipe/src/lipe_find3/lipe/find.scm
lipe/src/lipe_scan3/ls3_main.c
lipe/src/lipe_scan3/ls3_object_attrs.c
lipe/src/lipe_scan3/ls3_object_attrs.h
lustre/tests/sanity-lipe-find3.sh
lustre/tests/sanity-lipe-scan3.sh

index abc5356..043e182 100644 (file)
@@ -1,15 +1,12 @@
 TODO "{fid}" in exec?
 TODO dev, rdev
 TODO -empty
-TODO Check that format is MT safe.
 TODO Check that system* is MT safe.
 TODO dynamic-wind and MT.
 TODO scm exceptions generate errors with no progname prefix.
 TODO scanning and encryption
 TODO xargs batch limits needed?
-TODO crtime?
 TODO symlinks need readlink in lipe_scan3
-TODO print-json attrs --list-json-attrs
 
 TODO fprintf
        \a \b \f \n \r \t \v \0 \\
index 31c6812..5354b49 100644 (file)
@@ -45,7 +45,7 @@ static int expr_arg_type;
 
 %% /* rules */
 
--(delete|print|print0|print-file-fid|print-self-fid|print-absolute-path|print-relative-path|print-json|quit)\0 {
+-(delete|print|print0|print-file-fid|print-self-fid|print-absolute-path|print-relative-path|quit)\0 {
        LF3_DEBUG("nullary '%s'\n", yytext);
        yylval.u_range[0] = lf3_arg_index;
        yylval.u_range[1] = lf3_arg_index + 1;
@@ -67,7 +67,7 @@ static int expr_arg_type;
        BEGIN ARG;
 }
 
--(fprint|fprint0|printf)\0 {
+-(fprint|fprint0|print-json|printf)\0 {
        LF3_DEBUG("unary '%s'\n", yytext);
        expr_arg_begin = lf3_arg_index;
        expr_arg_end = lf3_arg_index + 2;
index 2e38c6b..acdc728 100644 (file)
@@ -1044,6 +1044,18 @@ static char *lf3_fprintf_expr(int begin, int end)
        return lf3_fprintf_expr2(file, begin + 2, fmt);
 }
 
+static char *lf3_print_json_expr(int begin, int end)
+{
+       const char *attrs = lf3_arg[begin + 1];
+       const char *v_printer;
+
+       assert(begin + 2 == end);
+
+       v_printer = LF3_GENVARF("print-json", "(make-json-printer %Q)", attrs);
+
+       return xsprintf("(%s)", v_printer);
+}
+
 static char *lf3_delete_expr(int begin, int end)
 {
        const char *v_deleter;
@@ -1117,6 +1129,7 @@ static char *lf3_simple_expr(int begin, int end)
        X2("wholename", lf3_path_expr(begin, end));
        X2("iwholename", lf3_ipath_expr(begin, end));
 
+       X2("print-json", lf3_print_json_expr(begin, end));
        X2("quit", "(lipe-scan-break 0)");
 
 #undef X1
@@ -1256,6 +1269,7 @@ static int yyreport_syntax_error(const yypcontext_t *ctx)
 enum {
        LF3_OPT_DEBUG,
        LF3_OPT_DEBUG_SCAN,
+       LF3_OPT_LIST_JSON_ATTRS,
        LF3_OPT_NOW,
        LF3_OPT_SCAN_COMMAND,
        LF3_OPT_THREAD_COUNT,
@@ -1272,6 +1286,7 @@ static void help(void)
 "Mandatory arguments to long options are mandatory for short options too.\n"
 "  --debug                     enable debugging\n"
 "  --debug-scan                enable scan debugging\n"
+"  --list-json-attrs           list available JSON attribute names and exit\n"
 /* --now=EPOCH                 use EPOCH instead of current time (for testing) */
 /* --scan-command=COMMAND      use 'cat' to print the code we would send to lipe_scan3 */
 "  --thread-count=COUNT        use COUNT scaninng threads\n"
@@ -1283,6 +1298,7 @@ static void help(void)
 static const struct option options[] = {
        { "debug", no_argument, 0, LF3_OPT_DEBUG },
        { "debug-scan", no_argument, 0, LF3_OPT_DEBUG_SCAN },
+       { "list-json-attrs", no_argument, 0, LF3_OPT_LIST_JSON_ATTRS },
        { "now", required_argument, 0, LF3_OPT_NOW },
        { "scan-command", required_argument, 0, LF3_OPT_SCAN_COMMAND },
        { "thread-count", required_argument, 0, LF3_OPT_THREAD_COUNT },
@@ -1316,6 +1332,9 @@ int main(int argc, char *argv[])
                case LF3_OPT_DEBUG_SCAN:
                        debug_scan = true;
                        break;
+               case LF3_OPT_LIST_JSON_ATTRS:
+                       system(LF3_SCAN_PROGRAM " --list-json-attrs");
+                       exit(EXIT_SUCCESS);
                case LF3_OPT_NOW:
                        lf3_now = strtoull(optarg, NULL, 0);
                        break;
@@ -1434,11 +1453,11 @@ int main(int argc, char *argv[])
                lf3_fini_add("#t");
 
        /* find(1) adds an implicit -print action if no action was
-        * specified in the expression. We use -print-file-fid as the
+        * specified in the expression. We use print-relative-path as the
         * implicit action. */
        char *policy_thunk = lf3_policy_body_has_action ?
                xsprintf("(lambda () %s)", lf3_policy_body) :
-               xsprintf("(lambda () (and %s (print-file-fid)))", lf3_policy_body);
+               xsprintf("(lambda () (and %s (print-relative-path)))", lf3_policy_body);
        LF3_DEBUG_S(policy_thunk);
 
        char *scm_code = xsprintf(
index 9fb29f7..6d0901b 100644 (file)
@@ -20,6 +20,7 @@
            make-exec-plus-pipe
            close-exec-plus-pipe
            make-printer
+           make-json-printer
            make-deleter
            close-deleter
            type
        (with-mutex mutex
                    (display str port)))))
 
+(define (make-json-attrs str)
+  (catch #t
+    (lambda ()
+      (lipe-string->json-attrs str))
+    (lambda (sym . args)
+      (format (current-error-port) "~a: FATAL: invalid JSON attributes '~a'\n" "lipe_find3" str) ;; XXX
+      (exit 2))))
+
+(define (make-json-printer str)
+  (let-values (((req opt) (make-json-attrs str)))
+    (lambda ()
+      (print-json req opt))))
+
 (define (make-deleter-pipe)
   (let ((client-mount-path (lipe-scan-client-mount-path)))
     (assert (string? client-mount-path)) ;; FIXME stat
index 94ec4bc..049925e 100644 (file)
@@ -192,7 +192,8 @@ static void ls3_list_attrs(void)
                printf("%s\n", attr_bit_names[i].abn_name);
 }
 
-static enum ls3_json_attr print_json_attrs = LS3_JSON_ATTR_DEFAULT;
+static enum ls3_json_attr print_json_required_attrs = LS3_JSON_ATTR_DEFAULT;
+static enum ls3_json_attr print_json_optional_attrs;
 static const char *print_delim = "\n";
 static bool print_null_delim;
 static bool print_all_paths;
@@ -343,6 +344,29 @@ SCM_DEFINE(ls3_scm_gettid, "lipe-gettid", 0, 0, 0, (), "print caller's thread ID
        return scm_from_ulong(syscall(SYS_gettid));
 }
 
+SCM_SYMBOL(ls3_scm_string_to_json_attrs_error, "*lipe-string->json-attrs-error*");
+
+SCM_DEFINE(ls3_scm_string_to_json_attrs, "lipe-string->json-attrs", 1, 0, 0,
+          (SCM str), "perse JSON attributes")
+#define FUNC_NAME s_ls3_scm_string_to_json_attrs
+{
+       char *c_str = NULL;
+       enum ls3_json_attr required_attrs = 0;
+       enum ls3_json_attr optional_attrs = 0;
+       int rc;
+
+       SCM_VALIDATE_STRING(1, str);
+       c_str = scm_to_latin1_string(str);
+       rc = ls3_json_attrs_parse(c_str, &required_attrs, &optional_attrs);
+       free(c_str);
+
+       if (rc < 0)
+               scm_throw(ls3_scm_string_to_json_attrs_error, scm_list_1(str));
+
+       return scm_values(scm_list_2(scm_from_uint64(required_attrs),
+                                    scm_from_uint64(optional_attrs)));
+}
+#undef FUNC_NAME
 
 SCM_DEFINE(ls3_scm_getopt_device_path, LS3_GETOPT_DEVICE_PATH, 0, 0, 0, (), "return device path from options or #f")
 {
@@ -842,11 +866,12 @@ SCM_DEFINE(ls3_scm_print_self_fid, LS3_PRINT_SELF_FID, 0, 0, 0,
        return SCM_UNSPECIFIED;
 }
 
-SCM_DEFINE(ls3_scm_print_json, LS3_PRINT_JSON, 0, 1, 0,
-          (SCM bits), "print JSON representation of current file")
+SCM_DEFINE(ls3_scm_print_json, LS3_PRINT_JSON, 0, 2, 0,
+          (SCM required_attrs, SCM optional_attrs),
+          "print JSON representation of current file")
 {
        struct ls3_context *lc = ls3_current();
-       unsigned long c_bits;
+       unsigned long c_required_attrs, c_optional_attrs;
        struct json_object *obj;
        const char *str;
        int json_c_to_string_flags = JSON_C_TO_STRING_PLAIN;
@@ -857,16 +882,25 @@ SCM_DEFINE(ls3_scm_print_json, LS3_PRINT_JSON, 0, 1, 0,
        json_c_to_string_flags |= JSON_C_TO_STRING_NOSLASHESCAPE;
 #endif
 
-       if (SCM_UNBNDP(bits))
-               c_bits = print_json_attrs;
+       if (SCM_UNBNDP(required_attrs))
+               c_required_attrs = print_json_required_attrs;
+       else
+               SCM_VALIDATE_ULONG_COPY(1, required_attrs, c_required_attrs);
+
+       if (SCM_UNBNDP(optional_attrs))
+               c_optional_attrs = print_json_optional_attrs;
        else
-               SCM_VALIDATE_ULONG_COPY(1, bits, c_bits);
+               SCM_VALIDATE_ULONG_COPY(2, optional_attrs, c_optional_attrs);
+
+       obj = ls3_object_attrs_to_json(lc->lc_instance, lc->lc_object, lc->lc_attrs,
+                                      c_required_attrs, c_optional_attrs);
+       if (obj == NULL)
+               goto out;
 
-       obj = ls3_object_attrs_to_json(lc->lc_instance, lc->lc_object, lc->lc_attrs, c_bits);
        str = json_object_to_json_string_ext(obj, json_c_to_string_flags);
 
        LS3_PRINT_DELIM("%s", str);
-
+out:
        json_object_put(obj);
 
        return SCM_UNSPECIFIED;
@@ -1158,6 +1192,7 @@ static void ls3_module_init(void *unused)
        "lipe-scan-fsname",
        "lipe-scan-thread-count",
        "lipe-scan-thread-index",
+       "lipe-string->json-attrs",
        "atime",
        "blocks",
        "ctime",
@@ -1237,9 +1272,14 @@ static void ls3_main_scm(void *data, int argc, char *argv[])
                case LS3_OPT_PRINT_JSON:
                        policy = LS3_PRINT_JSON;
                        if (optarg != NULL) {
-                               rc = ls3_json_attrs_parse(optarg, &print_json_attrs);
+                               rc = ls3_json_attrs_parse(optarg,
+                                                         &print_json_required_attrs,
+                                                         &print_json_optional_attrs);
                                if (rc < 0)
                                        TRY_HELP("invalid JSON attrs '%s'\n", optarg);
+
+                               LS3_DEBUG_X(print_json_required_attrs);
+                               LS3_DEBUG_X(print_json_optional_attrs);
                        }
                        break;
                case LS3_OPT_PRINT_ABSOLUTE_PATH:
index 95a47f4..ff1e39b 100644 (file)
@@ -379,44 +379,67 @@ static int ls3_json_attrs_parse1(const char *name, enum ls3_json_attr *pattrs)
        return -EINVAL;
 }
 
-int ls3_json_attrs_parse(const char *str, enum ls3_json_attr *pattrs)
+int ls3_json_attrs_parse(const char *str,
+                        enum ls3_json_attr *p_required_attrs,
+                        enum ls3_json_attr *p_optional_attrs)
 {
-       enum ls3_json_attr attrs = 0;
+       enum ls3_json_attr required_attrs = 0;
+       enum ls3_json_attr optional_attrs = 0;
+       int left_brackets = 0;
+       int right_brackets = 0;
        char *dup = NULL;
        char *pos;
        char *name;
        int rc = 0;
 
-       /* Secret backdoor hex parsing. */
-       if (strncmp(str, "#x", 2) == 0) {
-               errno = 0;
-               attrs = strtoul(str + 2, NULL, 16);
-               if (errno != 0)
+       dup = xstrdup(str);
+       pos = dup;
+
+       while ((name = strsep(&pos, ",")) != NULL) {
+               char *n;
+
+               left_brackets -= right_brackets;
+               right_brackets = 0;
+
+               if (left_brackets < 0) {
                        rc = -EINVAL;
-       } else {
-               dup = strdup(str);
-               if (dup == NULL) {
-                       rc = -ENOMEM;
                        goto out;
                }
 
-               pos = dup;
-               while ((name = strsep(&pos, ",")) != NULL) {
-                       char *n;
+               if (name[0] == '[') {
+                       left_brackets++;
+                       name++;
+               }
 
-                       /* convert name to lower and s/-/_/. */
-                       for (n = name; *n != '\0'; n++) {
-                               *n = tolower(*n);
-                               *n = (*n == '-') ? '_' : *n;
-                       }
+               /* Ignore doubled or trailing commas. */
+               if (strlen(name) == 0)
+                       continue;
 
-                       rc = ls3_json_attrs_parse1(name, &attrs);
-                       if (rc < 0)
-                               goto out;
+               if (name[strlen(name) - 1] == ']') {
+                       right_brackets++;
+                       name[strlen(name) - 1] = '\0';
+               }
+
+               /* ... commas. */
+               if (strlen(name) == 0)
+                       continue;
+
+               /* convert name to lower and replace '-' with '_'. */
+               for (n = name; *n != '\0'; n++) {
+                       *n = tolower(*n);
+                       *n = (*n == '-') ? '_' : *n;
                }
+
+               rc = ls3_json_attrs_parse1(name,
+                                          left_brackets == 0 ?
+                                          &required_attrs :
+                                          &optional_attrs);
+               if (rc < 0)
+                               goto out;
        }
 
-       *pattrs = attrs;
+       *p_required_attrs = required_attrs;
+       *p_optional_attrs = optional_attrs;
 out:
        free(dup);
 
@@ -427,27 +450,44 @@ struct json_object *
 ls3_object_attrs_to_json(struct ls3_instance *li,
                         struct lipe_object *lo,
                         struct ls3_object_attrs *loa,
-                        enum ls3_json_attr json_attrs)
+                        enum ls3_json_attr required_attrs,
+                        enum ls3_json_attr optional_attrs)
 {
        struct json_object *obj = json_object_new_object();
+       struct json_object *res = NULL;
        enum ls3_json_attr bit;
 
        for (bit = 0; bit < ARRAY_SIZE(ls3_json_attr_descs); bit++) {
                const struct ls3_json_attr_desc *jad;
+               bool is_required = (1UL << bit) & required_attrs;
+               bool is_optional = (1UL << bit) & optional_attrs;
+               int rc;
+
+               if (!(is_required || is_optional))
+                       continue;
 
                jad = &ls3_json_attr_descs[bit];
-               if (!((1UL << bit) & json_attrs) ||
-                   jad->jad_name == NULL ||
-                   jad->jad_encode == NULL)
+               if (jad->jad_name == NULL || jad->jad_encode == NULL)
                        continue;
 
-               ls3_read_attrs(li, lo, loa, jad->jad_attr_bits, true /* quit_on_error */);
+               rc = ls3_read_attrs(li, lo, loa, jad->jad_attr_bits, true /* quit_on_error */);
 
-               if (jad->jad_attr_bits == (jad->jad_attr_bits & loa->loa_attr_bits))
-                       json_object_object_add(obj, jad->jad_name, (*jad->jad_encode)(li, loa));
+               if (rc < 0 || jad->jad_attr_bits != (jad->jad_attr_bits & loa->loa_attr_bits)) {
+                       if (is_required)
+                               goto out;
+                       else
+                               continue;
+               }
+
+               json_object_object_add(obj, jad->jad_name, (*jad->jad_encode)(li, loa));
        }
 
-       return obj;
+       res = obj;
+       obj = NULL;
+out:
+       json_object_put(obj);
+
+       return res;
 }
 
 static void lipe_object_attrs_links_fini(struct ls3_object_attrs *attrs)
index e699aa0..1e1ab5e 100644 (file)
@@ -212,13 +212,16 @@ static inline const struct lu_fid *loa_self_fid(const struct ls3_object_attrs *l
 }
 
 void ls3_list_json_attrs(void);
-int ls3_json_attrs_parse(const char *str, enum ls3_json_attr *attrs);
+int ls3_json_attrs_parse(const char *str,
+                        enum ls3_json_attr *p_required_attrs,
+                        enum ls3_json_attr *p_optional_attrs);
 
 struct json_object *
 ls3_object_attrs_to_json(struct ls3_instance *li,
                         struct lipe_object *lo,
                         struct ls3_object_attrs *loa,
-                        enum ls3_json_attr attrs);
+                        enum ls3_json_attr required_attrs,
+                        enum ls3_json_attr optional_attrs);
 
 int lipe_object_attrs_init(struct ls3_object_attrs *attrs);
 void lipe_object_attrs_fini(struct ls3_object_attrs *attrs);
index e703056..f7eb1aa 100644 (file)
@@ -247,8 +247,8 @@ test_100() {
        echo XXX > "$file"
        fid=$($LFS path2fid "$file")
 
-       expect1 "$fid" lipe_find3_facet mds1
-       expect1 "$fid" lipe_find3_facet ost1
+       expect1 "$fid" lipe_find3_facet mds1 -print-file-fid
+       expect1 "$fid" lipe_find3_facet ost1 -print-file-fid
 }
 run_test 100 "lipe_find3 finds a file by MDT and OST"
 
@@ -265,13 +265,13 @@ test_101() {
        fid=$($LFS path2fid "$file")
        chmod 0666 "$file"
 
-       expect1 "$fid" lipe_find3_facet mds1 -perm 0666
-       expect1 "$fid" lipe_find3_facet mds1 -perm -0666
-       expect1 "$fid" lipe_find3_facet mds1 -perm -0600
-       expect1 "$fid" lipe_find3_facet mds1 -perm -0060
-       expect1 "$fid" lipe_find3_facet mds1 -perm -0400
-       expect1 "$fid" lipe_find3_facet mds1 -perm /0777
-       expect1 "$fid" lipe_find3_facet mds1 -perm /0477
+       expect1 "$fid" lipe_find3_facet mds1 -perm 0666 -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -perm -0666 -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -perm -0600 -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -perm -0060 -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -perm -0400 -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -perm /0777 -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -perm /0477 -print-file-fid
 
        expect_empty lipe_find3_facet mds1 -perm 0777
        expect_empty lipe_find3_facet mds1 -perm 0667
@@ -279,12 +279,12 @@ test_101() {
        expect_empty lipe_find3_facet mds1 -perm /0100
        expect_empty lipe_find3_facet mds1 -perm /0111
 
-       expect1 "$fid" lipe_find3_facet mds1 -perm ugo=rw
-       expect1 "$fid" lipe_find3_facet mds1 -perm -ugo=rw
-       expect1 "$fid" lipe_find3_facet mds1 -perm -ug=rw
-       expect1 "$fid" lipe_find3_facet mds1 -perm -u=rw
-       expect1 "$fid" lipe_find3_facet mds1 -perm -ugo=r
-       expect1 "$fid" lipe_find3_facet mds1 -perm -ugo=w
+       expect1 "$fid" lipe_find3_facet mds1 -perm ugo=rw -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -perm -ugo=rw -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -perm -ug=rw -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -perm -u=rw -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -perm -ugo=r -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -perm -ugo=w -print-file-fid
 
        expect_empty lipe_find3_facet mds1 -perm ugo=rwx
        expect_empty lipe_find3_facet mds1 -perm ug=wx,o=rwx
@@ -293,10 +293,10 @@ test_101() {
        expect_empty lipe_find3_facet mds1 -perm ugo=rwx
 
        chmod 0001 "$file"
-       expect1 "$fid" lipe_find3_facet mds1 -perm 0001
-       expect1 "$fid" lipe_find3_facet mds1 -perm o=x
-       expect1 "$fid" lipe_find3_facet mds1 -perm -o=x
-       expect1 "$fid" lipe_find3_facet mds1 -perm /a=x
+       expect1 "$fid" lipe_find3_facet mds1 -perm 0001 -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -perm o=x -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -perm -o=x -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -perm /a=x -print-file-fid
        expect_empty lipe_find3_facet mds1 -perm 0
        expect_empty lipe_find3_facet mds1 -perm 0000
        expect_empty lipe_find3_facet mds1 -perm u=x
@@ -305,8 +305,8 @@ test_101() {
        expect_empty lipe_find3_facet mds1 -perm ugo=
 
        chmod 0000 "$file"
-       expect1 "$fid" lipe_find3_facet mds1 -perm 0000
-       expect1 "$fid" lipe_find3_facet mds1 -perm ugo=
+       expect1 "$fid" lipe_find3_facet mds1 -perm 0000 -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -perm ugo= -print-file-fid
        expect_empty lipe_find3_facet mds1 -perm -o=x
        expect_empty lipe_find3_facet mds1 -perm /a=x
 
@@ -352,30 +352,30 @@ test_102() {
        sync
 
        id=$(stat --format=%u $file) # uid
-       expect1 "$fid" lipe_find3_facet mds1 -user "$id"
-       expect1 "$fid" lipe_find3_facet ost1 -user "$id"
+       expect1 "$fid" lipe_find3_facet mds1 -user "$id" -print-file-fid
+       expect1 "$fid" lipe_find3_facet ost1 -user "$id" -print-file-fid
 
        for id in "${IDS[@]}"; do
                chown $id $file || error "cannot set UID to '$id'"
                wait_delete_completed
 
-               expect1 "$fid" lipe_find3_facet mds1 -user "$id"
-               expect1 "$fid" lipe_find3_facet ost1 -user "$id"
+               expect1 "$fid" lipe_find3_facet mds1 -user "$id" -print-file-fid
+               expect1 "$fid" lipe_find3_facet ost1 -user "$id" -print-file-fid
 
-               expect1 "$fid" lipe_find3_facet mds1 -uid "$id"
-               expect1 "$fid" lipe_find3_facet ost1 -uid "$id"
+               expect1 "$fid" lipe_find3_facet mds1 -uid "$id" -print-file-fid
+               expect1 "$fid" lipe_find3_facet ost1 -uid "$id" -print-file-fid
        done
 
        user=sanityusr
        chown $user $file || error "cannot set user to '$user'"
        wait_delete_completed
 
-       expect1 "$fid" lipe_find3_facet mds1 -user "$user"
-       expect1 "$fid" lipe_find3_facet ost1 -user "$user"
+       expect1 "$fid" lipe_find3_facet mds1 -user "$user" -print-file-fid
+       expect1 "$fid" lipe_find3_facet ost1 -user "$user" -print-file-fid
 
        id=$(id -u "$user")
-       expect1 "$fid" lipe_find3_facet mds1 -uid "$id"
-       expect1 "$fid" lipe_find3_facet ost1 -uid "$id"
+       expect1 "$fid" lipe_find3_facet mds1 -uid "$id" -print-file-fid
+       expect1 "$fid" lipe_find3_facet ost1 -uid "$id" -print-file-fid
 
        expect_error lipe_find3_facet mds1 -user
        expect_error lipe_find3_facet mds1 -user ''
@@ -398,30 +398,30 @@ test_103() {
        sync
 
        id=$(stat --format=%g $file) # gid
-       expect1 "$fid" lipe_find3_facet mds1 -group "$id"
-       expect1 "$fid" lipe_find3_facet ost1 -group "$id"
+       expect1 "$fid" lipe_find3_facet mds1 -group "$id" -print-file-fid
+       expect1 "$fid" lipe_find3_facet ost1 -group "$id" -print-file-fid
 
        for id in "${IDS[@]}"; do
                chown :$id $file || error "cannot set GID to '$id'"
                wait_delete_completed
 
-               expect1 "$fid" lipe_find3_facet mds1 -group "$id"
-               expect1 "$fid" lipe_find3_facet ost1 -group "$id"
+               expect1 "$fid" lipe_find3_facet mds1 -group "$id" -print-file-fid
+               expect1 "$fid" lipe_find3_facet ost1 -group "$id" -print-file-fid
 
-               expect1 "$fid" lipe_find3_facet mds1 -gid "$id"
-               expect1 "$fid" lipe_find3_facet ost1 -gid "$id"
+               expect1 "$fid" lipe_find3_facet mds1 -gid "$id" -print-file-fid
+               expect1 "$fid" lipe_find3_facet ost1 -gid "$id" -print-file-fid
        done
 
        group=sanityusr
        chown :$group $file || error "cannot set group to '$group'"
        wait_delete_completed
 
-       expect1 "$fid" lipe_find3_facet mds1 -group "$group"
-       expect1 "$fid" lipe_find3_facet ost1 -group "$group"
+       expect1 "$fid" lipe_find3_facet mds1 -group "$group" -print-file-fid
+       expect1 "$fid" lipe_find3_facet ost1 -group "$group" -print-file-fid
 
        id=$(id -u "$group")
-       expect1 "$fid" lipe_find3_facet mds1 -gid "$id"
-       expect1 "$fid" lipe_find3_facet ost1 -gid "$id"
+       expect1 "$fid" lipe_find3_facet mds1 -gid "$id" -print-file-fid
+       expect1 "$fid" lipe_find3_facet ost1 -gid "$id" -print-file-fid
 
        expect_error lipe_find3_facet mds1 -group
        expect_error lipe_find3_facet mds1 -group ''
@@ -459,12 +459,12 @@ test_104() {
 
        # XXX find uses 512 byte default unity for size
 
-       expect1 "$fid" lipe_find3_facet mds1 -size 0
-       expect1 "$fid" lipe_find3_facet mds1 -size 0b
-       expect1 "$fid" lipe_find3_facet mds1 -size 0c
-       expect1 "$fid" lipe_find3_facet mds1 -size 0k
-       expect1 "$fid" lipe_find3_facet mds1 -size 0M
-       expect1 "$fid" lipe_find3_facet mds1 -size 0G
+       expect1 "$fid" lipe_find3_facet mds1 -size 0 -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -size 0b -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -size 0c -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -size 0k -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -size 0M -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -size 0G -print-file-fid
 
        expect_empty lipe_find3_facet mds1 -size +0
        expect_empty lipe_find3_facet mds1 -size +0b
@@ -480,41 +480,41 @@ test_104() {
        expect_empty lipe_find3_facet mds1 -size -0M
        expect_empty lipe_find3_facet mds1 -size -0G
 
-       expect1 "$fid" lipe_find3_facet mds1 -size -1b
-       expect1 "$fid" lipe_find3_facet mds1 -size -1k
-       expect1 "$fid" lipe_find3_facet mds1 -size -1M
-       expect1 "$fid" lipe_find3_facet mds1 -size -1G
+       expect1 "$fid" lipe_find3_facet mds1 -size -1b -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -size -1k -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -size -1M -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -size -1G -print-file-fid
 
        truncate "$file" 512
-       expect1 "$fid" lipe_find3_facet mds1 -size 1b
+       expect1 "$fid" lipe_find3_facet mds1 -size 1b -print-file-fid
 
        # Match finds quirky +/- rounding blah blah.
        truncate "$file" 1023
        expect_empty lipe_find3_facet mds1 -size -1k
-       expect1 "$fid" lipe_find3_facet mds1 -size 1k
+       expect1 "$fid" lipe_find3_facet mds1 -size 1k -print-file-fid
        expect_empty lipe_find3_facet mds1 -size +1k
 
        truncate "$file" 1024
        expect_empty lipe_find3_facet mds1 -size -1k
-       expect1 "$fid" lipe_find3_facet mds1 -size 1k
+       expect1 "$fid" lipe_find3_facet mds1 -size 1k -print-file-fid
        expect_empty lipe_find3_facet mds1 -size +1k
 
        truncate "$file" 1025
        expect_empty lipe_find3_facet mds1 -size 1k
-       expect1 "$fid" lipe_find3_facet mds1 -size +1k
-       expect1 "$fid" lipe_find3_facet mds1 -size 2k
+       expect1 "$fid" lipe_find3_facet mds1 -size +1k -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -size 2k -print-file-fid
        expect_empty lipe_find3_facet mds1 -size -2k
        expect_empty lipe_find3_facet mds1 -size +2k
 
        truncate "$file" 1048576
-       expect1 "$fid" lipe_find3_facet mds1 -size 1M
+       expect1 "$fid" lipe_find3_facet mds1 -size 1M -print-file-fid
 
        truncate "$file" 1073741824
-       expect1 "$fid" lipe_find3_facet mds1 -size 1G
+       expect1 "$fid" lipe_find3_facet mds1 -size 1G -print-file-fid
 
        for size in "${SIZES[@]}"; do
                $TRUNCATE $file $size
-               expect1 "$fid" lipe_find3_facet mds1 -size ${size}c
+               expect1 "$fid" lipe_find3_facet mds1 -size ${size}c -print-file-fid
        done
 
        expect_error lipe_find3_facet mds1 -size
@@ -538,17 +538,17 @@ test_105() {
        fid=$($LFS path2fid "$file")
 
        expect_empty lipe_find3_facet mds1 -links 0
-       expect1 "$fid" lipe_find3_facet mds1 -links +0
-       expect1 "$fid" lipe_find3_facet mds1 -links 1
-       expect1 "$fid" lipe_find3_facet mds1 -links -2
+       expect1 "$fid" lipe_find3_facet mds1 -links +0 -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -links 1 -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -links -2 -print-file-fid
 
        ln $file $file-2
        expect_empty lipe_find3_facet mds1 -links 1
-       expect1 "$fid" lipe_find3_facet mds1 -links 2
+       expect1 "$fid" lipe_find3_facet mds1 -links 2 -print-file-fid
 
        ln $file $file-3
        expect_empty lipe_find3_facet mds1 -links 2
-       expect1 "$fid" lipe_find3_facet mds1 -links 3
+       expect1 "$fid" lipe_find3_facet mds1 -links 3 -print-file-fid
 
        expect_error lipe_find3_facet mds1 -links
        expect_error lipe_find3_facet mds1 -links ''
@@ -569,13 +569,13 @@ test_106() {
        fid=$($LFS path2fid "$file")
 
        id=$($LFS project "$file" | awk '{ print $1 }')
-       expect1 "$fid" lipe_find3_facet mds1 -projid "$id"
+       expect1 "$fid" lipe_find3_facet mds1 -projid "$id" -print-file-fid
 
        for id in "${IDS[@]}"; do
                [[ $id =~ ^[0-9]+$ ]] || continue # exclude sanityusr
 
                $LFS project -p "$id" "$file" || error "cannot set projid to '$id'"
-               expect1 "$fid" lipe_find3_facet mds1 -projid "$id"
+               expect1 "$fid" lipe_find3_facet mds1 -projid "$id" -print-file-fid
        done
 
        expect_error lipe_find3_facet mds1 -projid
@@ -591,12 +591,12 @@ test_107() {
        init_lipe_find3_env "$file"
        fid=$($LFS path2fid "$file")
 
-       expect1 "$fid" lipe_find3_facet mds1 -type f
-       expect1 "$fid" lipe_find3_facet mds1 -type f,b
-       expect1 "$fid" lipe_find3_facet mds1 -type f,b,d
-       expect1 "$fid" lipe_find3_facet mds1 -type b,c,d,p,f,l,s
-       expect1 "$fid" lipe_find3_facet mds1 -not -type d
-       expect1 "$fid" lipe_find3_facet mds1 -not -type b,c,d,p,l,s
+       expect1 "$fid" lipe_find3_facet mds1 -type f -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -type f,b -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -type f,b,d -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -type b,c,d,p,f,l,s -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -not -type d -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -not -type b,c,d,p,l,s -print-file-fid
 
        expect_empty lipe_find3_facet mds1 -type d
        expect_empty lipe_find3_facet mds1 -type b,c,d,p,l,s
@@ -619,44 +619,44 @@ test_108() {
 
        # -name '' fails with "lipe_find3: FATAL: at argument 2:
        # missing argument to '-name'". find is OK with -name ''.
-       expect1 "$fid" lipe_find3_facet mds1 -name "$tfile"
-       expect1 "$fid" lipe_find3_facet mds1 -name "$tfile*"
-       expect1 "$fid" lipe_find3_facet mds1 -name "*$tfile"
-       expect1 "$fid" lipe_find3_facet mds1 -name "$tfile*"
+       expect1 "$fid" lipe_find3_facet mds1 -name "$tfile" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -name "$tfile*" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -name "*$tfile" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -name "$tfile*" -print-file-fid
        expect_empty lipe_find3_facet mds1 -name "dagobert.txt"
 
        mv "$file" "$MOUNT/zalf.x"
-       expect1 "$fid" lipe_find3_facet mds1 -name "zalf.x"
-       expect1 "$fid" lipe_find3_facet mds1 -name "*.x"
-       expect1 "$fid" lipe_find3_facet mds1 -name "zalf.?"
-       expect1 "$fid" lipe_find3_facet mds1 -name "[yz]alf.x"
-       expect1 "$fid" lipe_find3_facet mds1 -name "[yz]*.x"
+       expect1 "$fid" lipe_find3_facet mds1 -name "zalf.x" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -name "*.x" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -name "zalf.?" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -name "[yz]alf.x" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -name "[yz]*.x" -print-file-fid
        expect_empty lipe_find3_facet mds1 -name "dagobert.txt"
 
-       expect1 "$fid" lipe_find3_facet mds1 -iname "zalf.x"
-       expect1 "$fid" lipe_find3_facet mds1 -iname "*.x"
-       expect1 "$fid" lipe_find3_facet mds1 -iname "zalf.?"
-       expect1 "$fid" lipe_find3_facet mds1 -iname "[yz]alf.x"
-       expect1 "$fid" lipe_find3_facet mds1 -iname "[yz]*.x"
+       expect1 "$fid" lipe_find3_facet mds1 -iname "zalf.x" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -iname "*.x" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -iname "zalf.?" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -iname "[yz]alf.x" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -iname "[yz]*.x" -print-file-fid
        expect_empty lipe_find3_facet mds1 -iname "dagobert.txt"
 
-       expect1 "$fid" lipe_find3_facet mds1 -iname "ZALF.X"
-       expect1 "$fid" lipe_find3_facet mds1 -iname "Zalf.x"
-       expect1 "$fid" lipe_find3_facet mds1 -iname "*.x"
-       expect1 "$fid" lipe_find3_facet mds1 -iname "ZALF.?"
-       expect1 "$fid" lipe_find3_facet mds1 -iname "[yz]ALF.x"
-       expect1 "$fid" lipe_find3_facet mds1 -iname "[YZ]*.X"
+       expect1 "$fid" lipe_find3_facet mds1 -iname "ZALF.X" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -iname "Zalf.x" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -iname "*.x" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -iname "ZALF.?" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -iname "[yz]ALF.x" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -iname "[YZ]*.X" -print-file-fid
        expect_empty lipe_find3_facet mds1 -iname "dagobert.txt"
        expect_empty lipe_find3_facet mds1 -iname "DAGOBERT.TXT"
 
        ln "$MOUNT/zalf.x" "$MOUNT/schmerp.out"
-       expect1 "$fid" lipe_find3_facet mds1 -name "*.x"
-       expect1 "$fid" lipe_find3_facet mds1 -name "zalf.?"
-       expect1 "$fid" lipe_find3_facet mds1 -name "[yz]alf.x"
-       expect1 "$fid" lipe_find3_facet mds1 -name "[yz]*.x"
-       expect1 "$fid" lipe_find3_facet mds1 -name "schmerp.out"
-       expect1 "$fid" lipe_find3_facet mds1 -iname "SCHMERP.out"
-       expect1 "$fid" lipe_find3_facet mds1 -iname "SCHMERP.OUT"
+       expect1 "$fid" lipe_find3_facet mds1 -name "*.x" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -name "zalf.?" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -name "[yz]alf.x" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -name "[yz]*.x" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -name "schmerp.out" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -iname "SCHMERP.out" -print-file-fid
+       expect1 "$fid" lipe_find3_facet mds1 -iname "SCHMERP.OUT" -print-file-fid
 
        expect_error lipe_find3_facet mds1 -name
 }
@@ -687,7 +687,7 @@ test_110() {
        echo XXX > "$file"
        fid=$($LFS path2fid "$file")
 
-       expect1 "$fid" lipe_find3_facet mds1 -pool "$pool"
+       expect1 "$fid" lipe_find3_facet mds1 -pool "$pool" -print-file-fid
        expect_empty lipe_find3_facet mds1 -pool ""
        expect_empty lipe_find3_facet mds1 -pool quux
 
@@ -695,7 +695,7 @@ test_110() {
        echo XXX > "$file"
        fid=$($LFS path2fid "$file")
 
-       expect1 "$fid" lipe_find3_facet mds1 \! -pool "$pool"
+       expect1 "$fid" lipe_find3_facet mds1 \! -pool "$pool" -print-file-fid
        expect_empty lipe_find3_facet mds1 -pool ""
 
        # We do not validate user supplied pool names in lipe_find3 or
@@ -725,13 +725,13 @@ test_130() {
                xmin="-${x}min"
 
                expect_empty lipe_find3_facet mds1 $xtime -0
-               expect1 "$fid" lipe_find3_facet mds1 $xtime 0
+               expect1 "$fid" lipe_find3_facet mds1 $xtime 0 -print-file-fid
                expect_empty lipe_find3_facet mds1 $xtime +0
-               expect1 "$fid" lipe_find3_facet mds1 $xtime -1
+               expect1 "$fid" lipe_find3_facet mds1 $xtime -1 -print-file-fid
                expect_empty lipe_find3_facet mds1 $xtime 1
 
                expect_empty lipe_find3_facet mds1 $xmin -0
-               expect1 "$fid" lipe_find3_facet mds1 $xmin -10
+               expect1 "$fid" lipe_find3_facet mds1 $xmin -10 -print-file-fid
                expect_empty lipe_find3_facet mds1 $xmin 10
                expect_empty lipe_find3_facet mds1 $xmin +10
 
@@ -742,46 +742,46 @@ test_130() {
                now=$(date +%s)
                touch -$x --date=@$((now - 25 * 3600)) $file
                expect_empty lipe_find3_facet mds1 $xtime 0
-               expect1 "$fid" lipe_find3_facet mds1 $xtime +0
+               expect1 "$fid" lipe_find3_facet mds1 $xtime +0 -print-file-fid
                expect_empty lipe_find3_facet mds1 $xtime -1
-               expect1 "$fid" lipe_find3_facet mds1 $xtime 1
+               expect1 "$fid" lipe_find3_facet mds1 $xtime 1 -print-file-fid
                expect_empty lipe_find3_facet mds1 $xtime +1
-               expect1 "$fid" lipe_find3_facet mds1 $xtime -2
+               expect1 "$fid" lipe_find3_facet mds1 $xtime -2 -print-file-fid
 
                expect_empty lipe_find3_facet mds1 $xtime -86400s
                expect_empty lipe_find3_facet mds1 $xtime 86400s
-               expect1 "$fid" lipe_find3_facet mds1 $xtime +86400s
+               expect1 "$fid" lipe_find3_facet mds1 $xtime +86400s -print-file-fid
 
                expect_empty lipe_find3_facet mds1 $xtime -1440m
                expect_empty lipe_find3_facet mds1 $xtime 1440m
-               expect1 "$fid" lipe_find3_facet mds1 $xtime +1440m
+               expect1 "$fid" lipe_find3_facet mds1 $xtime +1440m -print-file-fid
 
                expect_empty lipe_find3_facet mds1 $xmin -1440
                expect_empty lipe_find3_facet mds1 $xmin 1440
-               expect1 "$fid" lipe_find3_facet mds1 $xmin +1440
+               expect1 "$fid" lipe_find3_facet mds1 $xmin +1440 -print-file-fid
 
                expect_empty lipe_find3_facet mds1 $xtime -24h
                expect_empty lipe_find3_facet mds1 $xtime 24h
-               expect1 "$fid" lipe_find3_facet mds1 $xtime +24h
+               expect1 "$fid" lipe_find3_facet mds1 $xtime +24h -print-file-fid
 
                expect_empty lipe_find3_facet mds1 $xtime -25h
-               expect1 "$fid" lipe_find3_facet mds1 $xtime 25h
+               expect1 "$fid" lipe_find3_facet mds1 $xtime 25h -print-file-fid
                expect_empty lipe_find3_facet mds1 $xtime +25h
 
                expect_empty lipe_find3_facet mds1 $xtime -1d
-               expect1 "$fid" lipe_find3_facet mds1 $xtime 1d
+               expect1 "$fid" lipe_find3_facet mds1 $xtime 1d -print-file-fid
                expect_empty lipe_find3_facet mds1 $xtime +1d
 
-               expect1 "$fid" lipe_find3_facet mds1 $xtime -93600s
-               expect1 "$fid" lipe_find3_facet mds1 $xtime -1560m
-               expect1 "$fid" lipe_find3_facet mds1 $xtime -26h
-               expect1 "$fid" lipe_find3_facet mds1 $xtime -2d
+               expect1 "$fid" lipe_find3_facet mds1 $xtime -93600s -print-file-fid
+               expect1 "$fid" lipe_find3_facet mds1 $xtime -1560m -print-file-fid
+               expect1 "$fid" lipe_find3_facet mds1 $xtime -26h -print-file-fid
+               expect1 "$fid" lipe_find3_facet mds1 $xtime -2d -print-file-fid
 
                now=$(date +%s)
                touch -$x --date=@$((now - 30 * 86400 - 3600)) $file
                expect_empty lipe_find3_facet mds1 $xtime 0
                expect_empty lipe_find3_facet mds1 $xtime -30
-               expect1 "$fid" lipe_find3_facet mds1 $xtime 30
+               expect1 "$fid" lipe_find3_facet mds1 $xtime 30 -print-file-fid
                expect_empty lipe_find3_facet mds1 $xtime +30
        done
 
@@ -915,29 +915,29 @@ test_400() {
        init_lipe_find3_env "$file"
        fid=$($LFS path2fid "$file")
 
-       expect1 "$fid" lipe_find3_facet mds1 -true
+       expect1 "$tfile" lipe_find3_facet mds1 -true
        expect_empty lipe_find3_facet mds1 -false
 
-       expect1 "$fid" lipe_find3_facet mds1 -not -false
+       expect1 "$tfile" lipe_find3_facet mds1 -not -false
        expect_empty lipe_find3_facet mds1 -not -true
 
-       expect1 "$fid" lipe_find3_facet mds1 \! -false
+       expect1 "$tfile" lipe_find3_facet mds1 \! -false
        expect_empty lipe_find3_facet mds1 \! -true
 
-       expect1 "$fid" lipe_find3_facet mds1 -not -not -true
+       expect1 "$tfile" lipe_find3_facet mds1 -not -not -true
        expect_empty lipe_find3_facet mds1 -not -not -false
 
        # -and is implicit
-       expect1 "$fid" lipe_find3_facet mds1 -true -true
-       expect1 "$fid" lipe_find3_facet mds1 -true -and -true
-       expect1 "$fid" lipe_find3_facet mds1 -true -or -true
-       expect1 "$fid" lipe_find3_facet mds1 -true -or -false
-       expect1 "$fid" lipe_find3_facet mds1 -false -or -true
+       expect1 "$tfile" lipe_find3_facet mds1 -true -true
+       expect1 "$tfile" lipe_find3_facet mds1 -true -and -true
+       expect1 "$tfile" lipe_find3_facet mds1 -true -or -true
+       expect1 "$tfile" lipe_find3_facet mds1 -true -or -false
+       expect1 "$tfile" lipe_find3_facet mds1 -false -or -true
 
-       expect1 "$fid" lipe_find3_facet mds1 -true -a -true
-       expect1 "$fid" lipe_find3_facet mds1 -true -o -true
-       expect1 "$fid" lipe_find3_facet mds1 -true -o -false
-       expect1 "$fid" lipe_find3_facet mds1 -false -o -true
+       expect1 "$tfile" lipe_find3_facet mds1 -true -a -true
+       expect1 "$tfile" lipe_find3_facet mds1 -true -o -true
+       expect1 "$tfile" lipe_find3_facet mds1 -true -o -false
+       expect1 "$tfile" lipe_find3_facet mds1 -false -o -true
 
        # -and is implicit
        expect_empty lipe_find3_facet mds1 -true -false
@@ -962,10 +962,10 @@ test_400() {
        # F && T || T => T
        # F && F || T => T
 
-       expect1 "$fid" lipe_find3_facet mds1 -false -and -true -or -true
-       expect1 "$fid" lipe_find3_facet mds1 -false -and -false -or -true
-       expect1 "$fid" lipe_find3_facet mds1 -true -or -false -and -true
-       expect1 "$fid" lipe_find3_facet mds1 -true -or -false -and -false
+       expect1 "$tfile" lipe_find3_facet mds1 -false -and -true -or -true
+       expect1 "$tfile" lipe_find3_facet mds1 -false -and -false -or -true
+       expect1 "$tfile" lipe_find3_facet mds1 -true -or -false -and -true
+       expect1 "$tfile" lipe_find3_facet mds1 -true -or -false -and -false
 
        expect_error lipe_find3_facet mds1 -and
        expect_error lipe_find3_facet mds1 -true -and
@@ -989,22 +989,22 @@ test_401() {
        init_lipe_find3_env "$file"
        fid=$($LFS path2fid "$file")
 
-       expect1 "$fid" lipe_find3_facet mds1 \( -true \)
+       expect1 "$fid" lipe_find3_facet mds1 \( -true \) -print-file-fid
        expect_empty lipe_find3_facet mds1 \( -false \)
 
        expect_empty lipe_find3_facet mds1 -false -and \( -true -or -true \)
        expect_empty lipe_find3_facet mds1 -false -and \( -false -or -true \)
 
-       expect1 "$fid" lipe_find3_facet mds1 \( -true -true \)
+       expect1 "$fid" lipe_find3_facet mds1 \( -true -true \) -print-file-fid
        expect_empty lipe_find3_facet mds1 \( -false -true \)
 
-       expect1 "$fid" lipe_find3_facet mds1 \! \( -false \)
+       expect1 "$fid" lipe_find3_facet mds1 \! \( -false \) -print-file-fid
        expect_empty lipe_find3_facet mds1 \! \( -true \)
 
-       expect1 "$fid" lipe_find3_facet mds1 \( \! -false \)
+       expect1 "$fid" lipe_find3_facet mds1 \( \! -false \) -print-file-fid
        expect_empty lipe_find3_facet mds1 \( \! -true \)
 
-       expect1 "$fid" lipe_find3_facet mds1 -false , -true
+       expect1 "$fid" lipe_find3_facet mds1 -false , -true -print-file-fid
        expect_empty lipe_find3_facet mds1 -true , -false
 
        expect_error lipe_find3_facet mds1 \(
index a9eba87..33e0d7a 100644 (file)
@@ -655,7 +655,7 @@ test_112() {
 
        # FIXME Make a better test.
 
-       hsm=$(lipe_scan3 "$device" --print-json=hsm)
+       hsm=$(lipe_scan3 "$device" --print-json='[hsm]')
        [[ "$hsm" == "{}" ]] || error "hsm expected '{}', got '$hsm'"
 }
 run_test 112 "lipe_scan3 hsm attr does the right thing"
@@ -672,7 +672,7 @@ test_113() {
        # filter_fid. This just checks that ls3 understands the
        # filter_fid attr.
 
-       a2=$(lipe_scan3 "$device" --print-json=filter_fid)
+       a2=$(lipe_scan3 "$device" --print-json='[filter_fid]')
        [[ "$a2" == "{}" ]] || error "filter_fid expected '', got '$a2'"
 }
 run_test 113 "lipe_scan3 filter_fid does the right thing"