aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2013-11-18 07:42:48 -0600
committerRob Landley <rob@landley.net>2013-11-18 07:42:48 -0600
commit75cb924bbd82d00173038128947cc323dac524e9 (patch)
tree5251e9bf436b997ce19a564d7ee0756d960632f0
parent59272f2019b6f1a5b984fa2bbf36f9c0174b4dcb (diff)
downloadtoybox-0.4.7.tar.gz
Add test suite for blkid and clean up an editorial comment that shouldn't have been checked in.0.4.7
-rwxr-xr-xscripts/test/blkid.test44
-rw-r--r--toys/other/blkid.c4
2 files changed, 46 insertions, 2 deletions
diff --git a/scripts/test/blkid.test b/scripts/test/blkid.test
new file mode 100755
index 00000000..b9662b77
--- /dev/null
+++ b/scripts/test/blkid.test
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+[ -f testing.sh ] && . testing.sh
+
+#testing "name" "command" "result" "infile" "stdin"
+
+BDIR="$TOPDIR/scripts/test/blkid"
+
+bzcat "$BDIR"/squashfs.bz2 > temp.img
+testing "blkid file" "blkid temp.img" 'temp.img: TYPE="squashfs"\n' "" ""
+rm temp.img
+
+testing "blkid cramfs" 'bzcat "$BDIR"/cramfs.bz2 | blkid -' \
+ '-: LABEL="mycramfs" TYPE="cramfs"\n' "" ""
+testing "blkid ext2" 'bzcat "$BDIR"/ext2.bz2 | blkid -' \
+ '-: LABEL="myext2" UUID="e59093ba-4135-4fdb-bcc4-f20beae4dfaf" TYPE="ext2"' \
+ "" ""
+testing "blkid ext3" 'bzcat "$BDIR"/ext3.bz2 | blkid -' \
+ '-: LABEL="myext3" UUID="79d1c877-1a0f-4e7d-b21d-fc32ae3ef101" TYPE="ext2"' \
+ "" ""
+testing "blkid ext4" 'bzcat "$BDIR"/ext4.bz2 | blkid -' \
+ '-: LABEL="myext4" UUID="dc4b7c00-c0c0-4600-af7e-0335f09770fa" TYPE="ext2"' \
+ "" ""
+testing "blkid f2fs" 'bzcat "$BDIR"/f2fs.bz2 | blkid -' \
+ '-: LABEL="" UUID="b53d3619-c204-4c0b-8504-36363578491c" TYPE="f2fs"' \
+ "" ""
+testing "blkid msdos" 'bzcat "$BDIR"/msdos.bz2 | blkid -' \
+ '-: LABEL="mymsdos " UUID="5108-1e6e" TYPE="vfat"' "" ""
+testing "blkid ntfs" 'bzcat "$BDIR"/ntfs.bz2 | blkid -' \
+ '-: UUID="8585600838bfe16e" TYPE="ntfs"' "" ""
+testing "blkid reiserfs" 'bzcat "$BDIR"/reiser3.bz2 | blkid -' \
+ '-: LABEL="" UUID="a5b99bec-45cc-41d7-986e-32f4b6fc28f2" TYPE="murderfs"' \
+ "" ""
+testing "blkid squashfs" 'bzcat "$BDIR"/squashfs.bz2 | blkid -' \
+ '-: TYPE="squashfs"' ""
+testing "blkid vfat" 'bzcat "$BDIR"/vfat.bz2 | blkid -' \
+ '-: LABEL="myvfat " UUID="1db9-5673" TYPE="vfat"'
+testing "blkid xfs" 'bzcat "$BDIR"/xfs.bz2 | blkid -' \
+ '-: LABEL="XFS_test" UUID="d63a1dc3-27d5-4dd4-8b38-f4f97f495c6f" TYPE="xfs"' \
+ "" ""
+
+#testing "blkid minix" 'bzcat "$BDIR"/minix.bz2 | blkid -'
+#adfs bfs btrfs cramfs jfs nilfs romfs
+#vfat // fat32 fat12 fat16
diff --git a/toys/other/blkid.c b/toys/other/blkid.c
index 99d6999a..1604ac35 100644
--- a/toys/other/blkid.c
+++ b/toys/other/blkid.c
@@ -38,8 +38,8 @@ static const struct fstype fstypes[] = {
{"f2fs", 0xF2F52010, 4, 1024, 1132, 16, 1110},
{"jfs", 0x3153464a, 4, 32768, 32920, 16, 32904},
{"nilfs", 0x3434, 2, 1030, 1176, 80, 1192},
- {"murderfs", 0x724573496552, 6, 8244, 8276, 16, 8292},
- {"murderfs", 0x724573496552, 6, 65588, 65620, 16, 65536},
+ {"reiserfs", 0x724573496552, 6, 8244, 8276, 16, 8292},
+ {"reiserfs", 0x724573496552, 6, 65588, 65620, 16, 65536},
{"romfs", 0x2d6d6f72, 4, 0, 0,0,0},
{"squashfs", 0x73717368, 4, 0, 0,0,0},
{"xiafs", 0x012fd16d, 4, 572, 0,0,0},