From patchwork Fri Jan 11 21:54:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 10760719 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 29B03746 for ; Fri, 11 Jan 2019 21:54:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AB0E29E8F for ; Fri, 11 Jan 2019 21:54:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0EAEA2A1EA; Fri, 11 Jan 2019 21:54:25 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 A8C4A29E8F for ; Fri, 11 Jan 2019 21:54:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725777AbfAKVyY (ORCPT ); Fri, 11 Jan 2019 16:54:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:51452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725536AbfAKVyY (ORCPT ); Fri, 11 Jan 2019 16:54:24 -0500 Received: from garbanzo.lan (c-73-71-40-85.hsd1.ca.comcast.net [73.71.40.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 747032183F; Fri, 11 Jan 2019 21:54:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547243663; bh=tRb11TntbmmgKxTJr+GDwaPNqsJPRWtyFgjt+d3yNJU=; h=From:To:Cc:Subject:Date:From; b=eef4XFiRgElD1BthNGDgiNKJFJnGZKoHhiOcului0rItcIfn2QuRFgFsGj+dfvj2I sDI/6NgMb9lJbOH3rj2JBWnt0PFWvaWMWRmw89VOVxlA3FUlo8yIOPMANcog3Vvkpe VjFuuX1eAMKLgJY0g4Yhs/fjoNFXNhxSCKymL0HU= From: Luis Chamberlain To: fstests@vger.kernel.org Cc: Luis Chamberlain Subject: [PATCH] check: force hostname to be unique Date: Fri, 11 Jan 2019 13:54:20 -0800 Message-Id: <20190111215420.9676-1-mcgrof@kernel.org> X-Mailer: git-send-email 2.18.0 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If you use a hostname which is part of the output of standard tools you end up with failures with fstests due to differences in output against the golden output. The failures are false positives due to the hostname. For instance if you hostname is 'xfs' _dump_filter_main() will substitute the initiial 'xfs' with HOSTNAME as part of your logs, and will fail the output will fail against the golden output on say all xfsdump / xfsrestores tests. The hostname must be a unique string, not used as part of the output from any tool used when capturing output. Signed-off-by: Luis Chamberlain --- We could be more pedantic about uniqueness, but this should suffice at last of most issues. README | 2 ++ check | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/README b/README index 73f057f3..7128da67 100644 --- a/README +++ b/README @@ -22,6 +22,8 @@ _______________________ - create fsgqa test user ("sudo useradd fsgqa") - create fsgqa group ("sudo groupadd fsgqa") - create 123456-fsgqa test user ("sudo useradd 123456-fsgqa") +- assign a unique hostname to the test system. It must not clash with + any word used on output by standard tools or tools for your filesystem. ______________________ USING THE FSQA SUITE diff --git a/check b/check index 77a06b00..3a0bb026 100755 --- a/check +++ b/check @@ -251,6 +251,40 @@ _prepare_test_list() fi } +_invalid_hostname() +{ + host_check=`hostname` + + case $host_check in + xfs) + return 1; + ;; + btrfs) + return 1; + ;; + ext4) + return 1; + ;; + ext3) + return 1; + ;; + ext2) + return 1; + ;; + esac + + return 0 +} + +_check_unique_hostname() +{ + _invalid_hostname + if [ $? -ne -0 ]; then + echo "Hostname `hostname` is not unique, make a unique hostname to avoid output log clashes with tools" + exit 1 + fi +} + # Process command arguments first. while [ $# -gt 0 ]; do case "$1" in @@ -371,6 +405,8 @@ then exit 1 fi +_check_unique_hostname + _wipe_counters() { n_try="0"