From patchwork Thu Nov 9 08:32:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 10050481 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0FB74601EB for ; Thu, 9 Nov 2017 08:32:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F26A52ABC2 for ; Thu, 9 Nov 2017 08:32:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E75E12ABC6; Thu, 9 Nov 2017 08:32:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB23D2ABC2 for ; Thu, 9 Nov 2017 08:32:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753641AbdKIIcs (ORCPT ); Thu, 9 Nov 2017 03:32:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33614 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753515AbdKIIcr (ORCPT ); Thu, 9 Nov 2017 03:32:47 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5AD017E382; Thu, 9 Nov 2017 08:32:47 +0000 (UTC) Received: from localhost (unknown [10.66.12.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id D667460017; Thu, 9 Nov 2017 08:32:46 +0000 (UTC) From: Eryu Guan To: fstests@vger.kernel.org Cc: linux-xfs@vger.kernel.org, Eryu Guan Subject: [PATCH v2 1/2] ltp/fsx: allow comments when reading operations from logs Date: Thu, 9 Nov 2017 16:32:41 +0800 Message-Id: <20171109083242.32373-1-eguan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 09 Nov 2017 08:32:47 +0000 (UTC) Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- v2: - no change since v1 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;