ltp/fsx: allow comments when reading operations from logs
authorEryu Guan <eguan@redhat.com>
Wed, 25 Oct 2017 04:06:06 +0000 (12:06 +0800)
committerEryu Guan <eguan@redhat.com>
Fri, 10 Nov 2017 04:33:38 +0000 (12:33 +0800)
We use '--replay-ops' option to replay operations in the specified
operation log file, but we're not allowed to add comments for the
operations in the log, which might be useful when writing regression
tests that replay a given sequence of operations.

Now treat lines starting with '#' as comments and skip them when
reading operations.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
ltp/fsx.c

index 863d536e5a7b368899c6b7e01f8844a1c1cf3c21..9c358f27bd925eddc3b85bf2a4cb4668b8ce75e2 100644 (file)
--- a/ltp/fsx.c
+++ b/ltp/fsx.c
@@ -1391,7 +1391,7 @@ read_op(struct log_entry *log_entry)
                                goto fail;
                        }
                        str = strtok(line, " \t\n");
-               } while (!str);
+               } while (!str || str[0] == '#');
 
                if (strcmp(str, "skip") == 0) {
                        log_entry->flags |= FL_SKIPPED;