diff mbox

[v2,1/2] ltp/fsx: allow comments when reading operations from logs

Message ID 20171109083242.32373-1-eguan@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eryu Guan Nov. 9, 2017, 8:32 a.m. UTC
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.

Signed-off-by: Eryu Guan <eguan@redhat.com>
---
v2:
- no change since v1

 ltp/fsx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Amir Goldstein Nov. 9, 2017, 8:40 a.m. UTC | #1
On Thu, Nov 9, 2017 at 10:32 AM, Eryu Guan <eguan@redhat.com> wrote:
> 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.
>
> Signed-off-by: Eryu Guan <eguan@redhat.com>
> ---
> v2:
> - no change since v1

Looks fine

>
>  ltp/fsx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ltp/fsx.c b/ltp/fsx.c
> index 863d536e5a7b..9c358f27bd92 100644
> --- 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;
> --
> 2.13.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/ltp/fsx.c b/ltp/fsx.c
index 863d536e5a7b..9c358f27bd92 100644
--- 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;