Skip to contentSkip to conversation

xfstests: test mkfs.xfs config files

RFC PATCH New Darrick J. Wong 1 participant 1 message Jul 6, 2018

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 xfstests: test mkfs.xfs config files

From: Darrick J. Wong <[email protected]>

Simple tests of the upcoming mkfs.xfs config file feature. First we have some simple tests of properly formatted config files, then improperly formatted config files, then we test any distro-supplied config files, and finally we try to spot conflicts between config file options and the cli.

---
 common/xfs        |   10 ++
 tests/xfs/716     |  276 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/716.out |   20 ++++
 tests/xfs/717     |  155 ++++++++++++++++++++++++++++++
 tests/xfs/717.out |   30 ++++++
 tests/xfs/718     |   64 ++++++++++++
 tests/xfs/718.out |    1 
 tests/xfs/719     |   59 +++++++++++
 tests/xfs/719.out |    2 
 tests/xfs/720     |   51 ++++++++++
 tests/xfs/720.out |    1 
 tests/xfs/721     |   65 ++++++++++++
 tests/xfs/721.out |    3 +
 tests/xfs/group   |    6 +
 14 files changed, 743 insertions(+)
 create mode 100755 tests/xfs/716
 create mode 100644 tests/xfs/716.out
 create mode 100755 tests/xfs/717
 create mode 100644 tests/xfs/717.out
 create mode 100755 tests/xfs/718
 create mode 100644 tests/xfs/718.out
 create mode 100755 tests/xfs/719
 create mode 100644 tests/xfs/719.out
 create mode 100755 tests/xfs/720
 create mode 100644 tests/xfs/720.out
 create mode 100755 tests/xfs/721
 create mode 100644 tests/xfs/721.out
common/xfs +10 -0
index 33d819d7..150129b0 100644
@@ -605,6 +605,16 @@ _require_xfs_mkfs_ciname()
 		|| _notrun "need case-insensitive naming support in mkfs.xfs"
 }
 
+# this test requires mkfs.xfs have configuration file support
+_require_xfs_mkfs_cfgfile()
+{
+	echo > /tmp/a
+	_scratch_mkfs_xfs_supported -c /tmp/a >/dev/null 2>&1
+	res=$?
+	rm -rf /tmp/a
+	test $res -eq 0 || _notrun "need configuration file support in mkfs.xfs"
+}
+
 # XFS_DEBUG requirements
 _require_xfs_debug()
 {
tests/xfs/716 new file +276 -0

276 lines not on this page · raw message

tests/xfs/716.out new file +20 -0
new file mode 100644
index 00000000..b39f59ad
@@ -0,0 +1,20 @@
+QA output created by 716
+Simplest config file
+Piped-in config file
+Full line comment
+End of line comment
+Multiple directives
+Multiple sections
+No directives at all
+Single space around the section name
+Two spaces around the section name
+Three spaces
+Four spaces
+Mix of spaces and tabs
+Single space around the key/value directive
+Two spaces around the key/value directive
+Three spaces around the key/value directive
+Four spaces around the key/value directive
+Arbitrary spaces and tabs
+ambiguous comment/section names
+ambiguous comment/variable names
tests/xfs/717 new file +155 -0

155 lines not on this page · raw message

tests/xfs/717.out new file +30 -0
new file mode 100644
index 00000000..68c2f634
@@ -0,0 +1,30 @@
+QA output created by 717
+Spaces in the middle of a section name
+TEST_DIR/a:1: line not recognized as a section header or a key/value pair.
+TEST_DIR/a:1: line not recognized as a section header or a key/value pair.
+Spaces in the middle of a key name
+TEST_DIR/a:2: line not recognized as a section header or a key/value pair.
+Invalid value
+TEST_DIR/a:2: could not interpret value 'waffles'.
+Nonexistent sections
+TEST_DIR/a:1: section 'goober' not recognized.
+Nonexistent keys
+TEST_DIR/a:2: key 'goober' is not a part of section 'metadata'.
+Strictly base-10 numbers for booleans only
+Only zero or one
+TEST_DIR/a:2: metadata.crc value '50' must be 0 or 1.
+TEST_DIR/a:2: metadata.crc value '-1' must be 0 or 1.
+sysctl style files
+TEST_DIR/a:1: key 'metadata.crc' is not in a section.
+binaries
+MKFS_XFS_PROG:1: line not recognized as a section header or a key/value pair.
+respecified options
+TEST_DIR/a:3: section 'metadata' key 'crc' already seen.
+respecified sections
+TEST_DIR/a:3: section 'metadata' already seen.
+ambiguous comment/section names
+TEST_DIR/a:1: line not recognized as a section header or a key/value pair.
+ambiguous comment/variable names
+TEST_DIR/a:2: line not recognized as a section header or a key/value pair.
+TEST_DIR/a:2: line not recognized as a section header or a key/value pair.
+TEST_DIR/a:2: line not recognized as a section header or a key/value pair.
tests/xfs/718 new file +64 -0

64 lines not on this page · raw message

tests/xfs/718.out new file +1 -0
new file mode 100644
index 00000000..34c1819d
@@ -0,0 +1 @@
+QA output created by 718
tests/xfs/719 new file +59 -0

59 lines not on this page · raw message

tests/xfs/719.out new file +2 -0
new file mode 100644
index 00000000..43e56f5d
@@ -0,0 +1,2 @@
+QA output created by 719
+rmapbt not supported without CRC support
tests/xfs/720 new file +51 -0

51 lines not on this page · raw message

tests/xfs/720.out new file +1 -0
new file mode 100644
index 00000000..625af162
@@ -0,0 +1 @@
+QA output created by 720
tests/xfs/721 new file +65 -0

65 lines not on this page · raw message

tests/xfs/721.out new file +3 -0
new file mode 100644
index 00000000..23f10ee2
@@ -0,0 +1,3 @@
+QA output created by 721
+rmapbt not supported without CRC support
+rmapbt not supported without CRC support
tests/xfs/group +6 -0
index f825e6b8..becd4a03 100644
@@ -450,6 +450,12 @@
 450 auto quick rmap
 451 auto quick metadata repair
 452 auto db
+716 auto quick mkfs
+717 auto quick mkfs
+718 auto quick mkfs
+719 auto quick mkfs
+720 auto quick mkfs
+721 auto quick mkfs
 1387 dangerous_fuzzers dangerous_norepair
 1388 dangerous_fuzzers dangerous_norepair
 1389 dangerous_fuzzers dangerous_norepair