From: Luis Chamberlain <mcgrof@kernel.org>
To: fstests@vger.kernel.org
Cc: Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH] check: force hostname to be unique
Date: Fri, 11 Jan 2019 13:54:20 -0800 [thread overview]
Message-ID: <20190111215420.9676-1-mcgrof@kernel.org> (raw)
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 <mcgrof@kernel.org>
---
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"
--
2.20.1
next reply other threads:[~2019-01-11 21:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-11 21:54 Luis Chamberlain [this message]
2019-01-16 8:12 ` [PATCH] check: force hostname to be unique Eryu Guan
2019-01-24 16:45 ` Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190111215420.9676-1-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=fstests@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox