From 577cbb4df0f4d21d4ae0990832b467f1023f71b4 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 18 May 2010 16:09:58 +0200 Subject: libblkid: improbe DDF detection Signed-off-by: Karel Zak --- tests/expected/blkid/low-probe-ddf-raid | 6 +++--- tests/ts/blkid/images-fs/ddf-raid.img.bz2 | Bin 535 -> 599 bytes 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/expected/blkid/low-probe-ddf-raid b/tests/expected/blkid/low-probe-ddf-raid index 08329501..7956dcd0 100644 --- a/tests/expected/blkid/low-probe-ddf-raid +++ b/tests/expected/blkid/low-probe-ddf-raid @@ -1,5 +1,5 @@ ID_FS_TYPE=ddf_raid_member ID_FS_USAGE=raid -ID_FS_UUID=8Z_I__B_8Z_I_e_I_q_I____ -ID_FS_UUID_ENC=8Z\xb0I\x95\x10B\x028Z\xb0I\xc8e\xb0I\xb8q\xb0I\xff\xff\xff\xff -ID_FS_VERSION=02.00.00 +ID_FS_UUID=Linux-MDޭ__ +ID_FS_UUID_ENC=Linux-MDޭ\xbe\xef +ID_FS_VERSION=01.02.00 diff --git a/tests/ts/blkid/images-fs/ddf-raid.img.bz2 b/tests/ts/blkid/images-fs/ddf-raid.img.bz2 index c8f0c8ac..b0934933 100644 Binary files a/tests/ts/blkid/images-fs/ddf-raid.img.bz2 and b/tests/ts/blkid/images-fs/ddf-raid.img.bz2 differ -- cgit v1.2.3 From b541b8ec56b5783ee7f9aec505a916a98e99f61f Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 19 May 2010 11:16:50 +0200 Subject: tests: update fdisk tests Signed-off-by: Karel Zak --- tests/expected/fdisk/align-512-4K | 6 +++--- tests/expected/fdisk/align-512-4K-63 | 6 +++--- tests/expected/fdisk/align-512-4K-md | 8 ++++---- tests/expected/fdisk/align-512-512 | 6 +++--- tests/expected/fdisk/align-512-512-topology | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) (limited to 'tests') diff --git a/tests/expected/fdisk/align-512-4K b/tests/expected/fdisk/align-512-4K index 9613e176..0857e378 100644 --- a/tests/expected/fdisk/align-512-4K +++ b/tests/expected/fdisk/align-512-4K @@ -21,17 +21,17 @@ Command (m for help): Changing display/entry units to sectors Command (m for help): Command action e extended p primary partition (1-4) -Partition number (1-4): First sector (2048-102399, default 2048): Using default value 2048 +Partition number (1-4, default 1): First sector (2048-102399, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-102399, default 102399): Command (m for help): Command action e extended p primary partition (1-4) -Partition number (1-4): First sector (22528-102399, default 22528): Using default value 22528 +Partition number (1-4, default 2): First sector (22528-102399, default 22528): Using default value 22528 Last sector, +sectors or +size{K,M,G} (22528-102399, default 102399): Command (m for help): Command action e extended p primary partition (1-4) -Partition number (1-4): First sector (43008-102399, default 43008): Using default value 43008 +Partition number (1-4, default 3): First sector (43008-102399, default 43008): Using default value 43008 Last sector, +sectors or +size{K,M,G} (43008-102399, default 102399): Command (m for help): Command action e extended diff --git a/tests/expected/fdisk/align-512-4K-63 b/tests/expected/fdisk/align-512-4K-63 index 95e3bd9b..75998891 100644 --- a/tests/expected/fdisk/align-512-4K-63 +++ b/tests/expected/fdisk/align-512-4K-63 @@ -21,17 +21,17 @@ Command (m for help): Changing display/entry units to sectors Command (m for help): Command action e extended p primary partition (1-4) -Partition number (1-4): First sector (7-102399, default 7): Using default value 7 +Partition number (1-4, default 1): First sector (7-102399, default 7): Using default value 7 Last sector, +sectors or +size{K,M,G} (7-102399, default 102399): Command (m for help): Command action e extended p primary partition (1-4) -Partition number (1-4): First sector (20487-102399, default 20487): Using default value 20487 +Partition number (1-4, default 2): First sector (20487-102399, default 20487): Using default value 20487 Last sector, +sectors or +size{K,M,G} (20487-102399, default 102399): Command (m for help): Command action e extended p primary partition (1-4) -Partition number (1-4): First sector (40967-102399, default 40967): Using default value 40967 +Partition number (1-4, default 3): First sector (40967-102399, default 40967): Using default value 40967 Last sector, +sectors or +size{K,M,G} (40967-102399, default 102399): Command (m for help): Command action e extended diff --git a/tests/expected/fdisk/align-512-4K-md b/tests/expected/fdisk/align-512-4K-md index 026b94a6..4ac8ccc7 100644 --- a/tests/expected/fdisk/align-512-4K-md +++ b/tests/expected/fdisk/align-512-4K-md @@ -21,12 +21,12 @@ Command (m for help): Changing display/entry units to sectors Command (m for help): Command action e extended p primary partition (1-4) -Partition number (1-4): First sector (2048-102399, default 2048): Using default value 2048 +Partition number (1-4, default 1): First sector (2048-102399, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-102399, default 102399): Command (m for help): Command action e extended p primary partition (1-4) -Partition number (1-4): First sector (43008-102399, default 43008): Using default value 43008 +Partition number (1-4, default 2): First sector (43008-102399, default 43008): Using default value 43008 Last sector, +sectors or +size{K,M,G} (43008-102399, default 102399): Using default value 102399 Command (m for help): @@ -71,12 +71,12 @@ Command (m for help): Changing display/entry units to sectors Command (m for help): Command action e extended p primary partition (1-4) -Partition number (1-4): First sector (2048-100095, default 2048): Using default value 2048 +Partition number (1-4, default 1): First sector (2048-100095, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-100095, default 100095): Command (m for help): Command action e extended p primary partition (1-4) -Partition number (1-4): First sector (22528-100095, default 22528): Using default value 22528 +Partition number (1-4, default 2): First sector (22528-100095, default 22528): Using default value 22528 Last sector, +sectors or +size{K,M,G} (22528-100095, default 100095): Command (m for help): Disk /dev/md8: 51 MB, 51249152 bytes diff --git a/tests/expected/fdisk/align-512-512 b/tests/expected/fdisk/align-512-512 index e984d6bc..6f49256e 100644 --- a/tests/expected/fdisk/align-512-512 +++ b/tests/expected/fdisk/align-512-512 @@ -17,17 +17,17 @@ Command (m for help): Changing display/entry units to sectors Command (m for help): Command action e extended p primary partition (1-4) -Partition number (1-4): First sector (2048-102399, default 2048): Using default value 2048 +Partition number (1-4, default 1): First sector (2048-102399, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-102399, default 102399): Command (m for help): Command action e extended p primary partition (1-4) -Partition number (1-4): First sector (22528-102399, default 22528): Using default value 22528 +Partition number (1-4, default 2): First sector (22528-102399, default 22528): Using default value 22528 Last sector, +sectors or +size{K,M,G} (22528-102399, default 102399): Command (m for help): Command action e extended p primary partition (1-4) -Partition number (1-4): First sector (43008-102399, default 43008): Using default value 43008 +Partition number (1-4, default 3): First sector (43008-102399, default 43008): Using default value 43008 Last sector, +sectors or +size{K,M,G} (43008-102399, default 102399): Command (m for help): Command action e extended diff --git a/tests/expected/fdisk/align-512-512-topology b/tests/expected/fdisk/align-512-512-topology index 91cd1b4f..c99a1745 100644 --- a/tests/expected/fdisk/align-512-512-topology +++ b/tests/expected/fdisk/align-512-512-topology @@ -17,17 +17,17 @@ Command (m for help): Changing display/entry units to sectors Command (m for help): Command action e extended p primary partition (1-4) -Partition number (1-4): First sector (2048-102399, default 2048): Using default value 2048 +Partition number (1-4, default 1): First sector (2048-102399, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-102399, default 102399): Command (m for help): Command action e extended p primary partition (1-4) -Partition number (1-4): First sector (22528-102399, default 22528): Using default value 22528 +Partition number (1-4, default 2): First sector (22528-102399, default 22528): Using default value 22528 Last sector, +sectors or +size{K,M,G} (22528-102399, default 102399): Command (m for help): Command action e extended p primary partition (1-4) -Partition number (1-4): First sector (43008-102399, default 43008): Using default value 43008 +Partition number (1-4, default 3): First sector (43008-102399, default 43008): Using default value 43008 Last sector, +sectors or +size{K,M,G} (43008-102399, default 102399): Command (m for help): Command action e extended -- cgit v1.2.3 From 125b6a9191a1b09dbeaa1a068e7b0a966fca03fa Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 24 May 2010 14:13:33 +0200 Subject: tests: add cpuset regression test Signed-off-by: Karel Zak --- lib/Makefile.am | 3 +- lib/cpuset.c | 70 ++++++++++++++++++++++++++++++++++++++++ tests/commands.sh.in | 1 + tests/expected/schedutils/cpuset | 24 ++++++++++++++ tests/ts/schedutils/cpuset | 57 ++++++++++++++++++++++++++++++++ 5 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 tests/expected/schedutils/cpuset create mode 100755 tests/ts/schedutils/cpuset (limited to 'tests') diff --git a/lib/Makefile.am b/lib/Makefile.am index 0f008b30..93b79a5a 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -3,13 +3,14 @@ include $(top_srcdir)/config/include-Makefile.am AM_CPPFLAGS += -DTEST_PROGRAM noinst_PROGRAMS = test_blkdev test_ismounted test_wholedisk test_mangle \ - test_strtosize + test_strtosize test_cpuset test_blkdev_SOURCES = blkdev.c test_ismounted_SOURCES = ismounted.c test_wholedisk_SOURCES = wholedisk.c test_mangle_SOURCES = mangle.c test_strtosize_SOURCES = strtosize.c +test_cpuset_SOURCES = cpuset.c if LINUX test_blkdev_SOURCES += linux_version.c diff --git a/lib/cpuset.c b/lib/cpuset.c index abdd4090..92ed7304 100644 --- a/lib/cpuset.c +++ b/lib/cpuset.c @@ -239,3 +239,73 @@ int cstr_to_cpuset(struct bitmask *mask, const char* str) return 0; } + +#ifdef TEST_PROGRAM + +#include +#include + +int main(int argc, char *argv[]) +{ + struct bitmask *set; + char *buf, *mask = NULL, *range = NULL; + int ncpus = 2048, rc, c; + + struct option longopts[] = { + { "ncpus", 1, 0, 'n' }, + { "mask", 1, 0, 'm' }, + { "range", 1, 0, 'r' }, + { NULL, 0, 0, 0 } + }; + + while ((c = getopt_long(argc, argv, "n:m:r:", longopts, NULL)) != -1) { + switch(c) { + case 'n': + ncpus = atoi(optarg); + break; + case 'm': + mask = strdup(optarg); + break; + case 'r': + range = strdup(optarg); + break; + default: + goto usage_err; + } + } + + if (!mask && !range) + goto usage_err; + + set = bitmask_alloc(ncpus); + if (!set) + err(EXIT_FAILURE, "failed to allocate cpu set"); + + buf = malloc(7 * ncpus); + if (!buf) + err(EXIT_FAILURE, "failed to allocate cpu set buffer"); + + if (mask) + rc = str_to_cpuset(set, mask); + else + rc = cstr_to_cpuset(set, range); + + if (rc) + errx(EXIT_FAILURE, "failed to parse string: %s", mask ? : range); + + printf("%-15s = %15s ", mask ? : range, cpuset_to_str(set, buf)); + printf("[%s]\n", cpuset_to_cstr(set, buf)); + + free(buf); + free(set->maskp); + free(set); + + return EXIT_SUCCESS; + +usage_err: + fprintf(stderr, + "usage: %s [--ncpus ] --mask | --range ", + program_invocation_short_name); + exit(EXIT_FAILURE); +} +#endif diff --git a/tests/commands.sh.in b/tests/commands.sh.in index f52a6868..94f6521e 100644 --- a/tests/commands.sh.in +++ b/tests/commands.sh.in @@ -11,6 +11,7 @@ TS_HELPER_MD5="$TS_TOPDIR/helpers/test_md5" TS_HELPER_ISMOUNTED="$TOPDIR/lib/test_ismounted" TS_HELPER_STRTOSIZE="$TOPDIR/lib/test_strtosize" +TS_HELPER_CPUSET="$TOPDIR/lib/test_cpuset" # TODO: use partx TS_HELPER_PARTITIONS="$TOPDIR/shlibs/blkid/samples/partitions" diff --git a/tests/expected/schedutils/cpuset b/tests/expected/schedutils/cpuset new file mode 100644 index 00000000..10e17606 --- /dev/null +++ b/tests/expected/schedutils/cpuset @@ -0,0 +1,24 @@ +masks: +0x00000001 = 1 [0] +0x00000002 = 2 [1] +0x00000003 = 3 [0,1] +0x00000004 = 4 [2] +0x00000005 = 5 [0,2] +0x00000006 = 6 [1,2] +0x00000007 = 7 [0-2] +0x00000008 = 8 [3] +0x00000009 = 9 [0,3] +0x00005555 = 5555 [0,2,4,6,8,10,12,14] +0x00007777 = 7777 [0-2,4-6,8-10,12-14] +strings: +0 = 1 [0] +1 = 2 [1] +0,1 = 3 [0,1] +2 = 4 [2] +0,2 = 5 [0,2] +1,2 = 6 [1,2] +0-2 = 7 [0-2] +3 = 8 [3] +0,3 = 9 [0,3] +0,2,4,6,8,10,12,14 = 5555 [0,2,4,6,8,10,12,14] +0-2,4-6,8-10,12-14 = 7777 [0-2,4-6,8-10,12-14] diff --git a/tests/ts/schedutils/cpuset b/tests/ts/schedutils/cpuset new file mode 100755 index 00000000..6ad240dc --- /dev/null +++ b/tests/ts/schedutils/cpuset @@ -0,0 +1,57 @@ +#!/bin/bash + +# +# This file is part of util-linux-ng. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# + +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="cpuset" + +. $TS_TOPDIR/functions.sh +ts_init "$*" + +MASKS=" 0x00000001 \ + 0x00000002 \ + 0x00000003 \ + 0x00000004 \ + 0x00000005 \ + 0x00000006 \ + 0x00000007 \ + 0x00000008 \ + 0x00000009 \ + 0x00005555 \ + 0x00007777" + +RANGES="0 \ + 1 \ + 0,1 \ + 2 \ + 0,2 \ + 1,2 \ + 0-2 \ + 3 \ + 0,3 \ + 0,2,4,6,8,10,12,14 \ + 0-2,4-6,8-10,12-14" + +ts_log "masks:" +for i in $MASKS; do + $TS_HELPER_CPUSET --mask $i >> $TS_OUTPUT +done + +ts_log "strings:" +for i in $RANGES; do + $TS_HELPER_CPUSET --range $i >> $TS_OUTPUT +done + +ts_finalize -- cgit v1.2.3 From 68975d7eb182e3b08668d79cbcb68c365f101475 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 1 Jun 2010 10:44:41 +0200 Subject: tests: update lscpu Signed-off-by: Karel Zak --- tests/expected/lscpu/lscpu-ia64-hpmatterhorn | 19 +++++++++------- tests/expected/lscpu/lscpu-ia64-hprx1620 | 1 + tests/expected/lscpu/lscpu-ia64-pg0 | 34 +++++++++++++++------------- tests/expected/lscpu/lscpu-x86_64-hpdl585 | 28 +++++++++++++---------- tests/expected/lscpu/lscpu-x86_64-ibme326m | 1 + tests/expected/lscpu/lscpu-x86_64-necem14 | 1 + 6 files changed, 48 insertions(+), 36 deletions(-) (limited to 'tests') diff --git a/tests/expected/lscpu/lscpu-ia64-hpmatterhorn b/tests/expected/lscpu/lscpu-ia64-hpmatterhorn index e38bf46d..e4446067 100644 --- a/tests/expected/lscpu/lscpu-ia64-hpmatterhorn +++ b/tests/expected/lscpu/lscpu-ia64-hpmatterhorn @@ -11,16 +11,19 @@ L1d cache: 16K L1i cache: 16K L2 cache: 256K L3 cache: 3072K +NUMA node0 CPU(s): 4-7 +NUMA node1 CPU(s): 0-3 +NUMA node2 CPU(s): # The following is the parsable format, which can be fed to other # programs. Each different item in every column has an unique ID # starting from zero. # CPU,Core,Socket,Node,,L1d,L1i,L2,L3 -0,0,0,0,,0,0,0,0 -1,1,1,0,,1,1,1,1 -2,2,2,0,,2,2,2,2 -3,3,3,0,,3,3,3,3 -4,4,4,1,,4,4,4,4 -5,5,5,1,,5,5,5,5 -6,6,6,1,,6,6,6,6 -7,7,7,1,,7,7,7,7 +0,0,0,1,,0,0,0,0 +1,1,1,1,,1,1,1,1 +2,2,2,1,,2,2,2,2 +3,3,3,1,,3,3,3,3 +4,4,4,0,,4,4,4,4 +5,5,5,0,,5,5,5,5 +6,6,6,0,,6,6,6,6 +7,7,7,0,,7,7,7,7 diff --git a/tests/expected/lscpu/lscpu-ia64-hprx1620 b/tests/expected/lscpu/lscpu-ia64-hprx1620 index 081d8788..4812be6a 100644 --- a/tests/expected/lscpu/lscpu-ia64-hprx1620 +++ b/tests/expected/lscpu/lscpu-ia64-hprx1620 @@ -11,6 +11,7 @@ L1d cache: 16K L1i cache: 16K L2 cache: 256K L3 cache: 3072K +NUMA node0 CPU(s): 0,1 # The following is the parsable format, which can be fed to other # programs. Each different item in every column has an unique ID diff --git a/tests/expected/lscpu/lscpu-ia64-pg0 b/tests/expected/lscpu/lscpu-ia64-pg0 index 7600b808..22c4539c 100644 --- a/tests/expected/lscpu/lscpu-ia64-pg0 +++ b/tests/expected/lscpu/lscpu-ia64-pg0 @@ -12,24 +12,26 @@ L1i cache: 16K L2d cache: 256K L2i cache: 1024K L3 cache: 6144K +NUMA node0 CPU(s): 0-7 +NUMA node1 CPU(s): 8-15 # The following is the parsable format, which can be fed to other # programs. Each different item in every column has an unique ID # starting from zero. # CPU,Core,Socket,Node,,L1d,L1i,L2d,L2i,L3 -0,0,0,0,,0,0,0,0,0 -1,1,0,0,,1,1,1,0,0 -2,2,1,0,,2,2,2,1,1 -3,3,1,0,,3,3,3,1,1 -4,4,2,0,,4,4,4,2,2 -5,5,2,0,,5,5,5,2,2 -6,6,3,0,,6,6,6,3,3 -7,7,3,0,,7,7,7,3,3 -8,8,4,1,,8,8,8,4,4 -9,9,4,1,,9,9,9,4,4 -10,10,5,1,,10,10,10,5,5 -11,11,5,1,,11,11,11,5,5 -12,12,6,1,,12,12,12,6,6 -13,13,6,1,,13,13,13,6,6 -14,14,7,1,,14,14,14,7,7 -15,15,7,1,,15,15,15,7,7 +0,0,0,0,,0,0,0,, +1,1,0,0,,1,1,1,, +2,2,1,0,,2,2,2,, +3,3,1,0,,3,3,3,, +4,4,2,0,,4,4,4,, +5,5,2,0,,5,5,5,, +6,6,3,0,,6,6,6,, +7,7,3,0,,7,7,7,, +8,8,4,1,,8,8,8,, +9,9,4,1,,9,9,9,, +10,10,5,1,,10,10,10,, +11,11,5,1,,11,11,11,, +12,12,6,1,,12,12,12,, +13,13,6,1,,13,13,13,, +14,14,7,1,,14,14,14,, +15,15,7,1,,15,15,15,, diff --git a/tests/expected/lscpu/lscpu-x86_64-hpdl585 b/tests/expected/lscpu/lscpu-x86_64-hpdl585 index 52bc8cb9..54a1a242 100644 --- a/tests/expected/lscpu/lscpu-x86_64-hpdl585 +++ b/tests/expected/lscpu/lscpu-x86_64-hpdl585 @@ -14,24 +14,28 @@ L1d cache: 512K L1i cache: 512K L2 cache: 512K L3 cache: 2048K +NUMA node0 CPU(s): 0,4,8,12 +NUMA node1 CPU(s): 1,5,9,13 +NUMA node2 CPU(s): 2,6,10,14 +NUMA node3 CPU(s): 3,7,11,15 # The following is the parsable format, which can be fed to other # programs. Each different item in every column has an unique ID # starting from zero. # CPU,Core,Socket,Node,,L1d,L1i,L2,L3 0,0,0,0,,0,0,0,0 -1,1,0,0,,1,1,1,1 -2,2,0,0,,2,2,2,2 -3,3,0,0,,3,3,3,3 -4,4,1,1,,4,4,4,4 +1,1,1,1,,1,1,1,1 +2,2,2,2,,2,2,2,2 +3,3,3,3,,3,3,3,3 +4,4,0,0,,4,4,4,4 5,5,1,1,,5,5,5,5 -6,6,1,1,,6,6,6,6 -7,7,1,1,,7,7,7,7 -8,8,2,2,,8,8,8,8 -9,9,2,2,,9,9,9,9 +6,6,2,2,,6,6,6,6 +7,7,3,3,,7,7,7,7 +8,8,0,0,,8,8,8,8 +9,9,1,1,,9,9,9,9 10,10,2,2,,10,10,10,10 -11,11,2,2,,11,11,11,11 -12,12,3,3,,12,12,12,12 -13,13,3,3,,13,13,13,13 -14,14,3,3,,14,14,14,14 +11,11,3,3,,11,11,11,11 +12,12,0,0,,12,12,12,12 +13,13,1,1,,13,13,13,13 +14,14,2,2,,14,14,14,14 15,15,3,3,,15,15,15,15 diff --git a/tests/expected/lscpu/lscpu-x86_64-ibme326m b/tests/expected/lscpu/lscpu-x86_64-ibme326m index a373aacc..ccc64a07 100644 --- a/tests/expected/lscpu/lscpu-x86_64-ibme326m +++ b/tests/expected/lscpu/lscpu-x86_64-ibme326m @@ -12,6 +12,7 @@ CPU MHz: 1995.058 L1d cache: 1024K L1i cache: 1024K L2 cache: 1024K +NUMA node0 CPU(s): 0,1 # The following is the parsable format, which can be fed to other # programs. Each different item in every column has an unique ID diff --git a/tests/expected/lscpu/lscpu-x86_64-necem14 b/tests/expected/lscpu/lscpu-x86_64-necem14 index 0cde9c31..c823f7e7 100644 --- a/tests/expected/lscpu/lscpu-x86_64-necem14 +++ b/tests/expected/lscpu/lscpu-x86_64-necem14 @@ -11,6 +11,7 @@ Stepping: 3 CPU MHz: 3790.599 L1d cache: 16K L2 cache: 2048K +NUMA node0 CPU(s): 0,1 # The following is the parsable format, which can be fed to other # programs. Each different item in every column has an unique ID -- cgit v1.2.3 From 3d9c5ba7b850255a14fad0fd8e41a9c896432c71 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 1 Jun 2010 10:55:37 +0200 Subject: tests: add lscpu dump from Dell R710, 8-core Nehalem w/HT (RHEL 5.5) Signed-off-by: Karel Zak --- tests/expected/lscpu/lscpu-x86_64-dellr710 | 39 ++++++++++++++++++++++++++++ tests/ts/lscpu/dumps/x86_64-dellr710.tar.gz | Bin 0 -> 14300 bytes 2 files changed, 39 insertions(+) create mode 100644 tests/expected/lscpu/lscpu-x86_64-dellr710 create mode 100644 tests/ts/lscpu/dumps/x86_64-dellr710.tar.gz (limited to 'tests') diff --git a/tests/expected/lscpu/lscpu-x86_64-dellr710 b/tests/expected/lscpu/lscpu-x86_64-dellr710 new file mode 100644 index 00000000..43679dc4 --- /dev/null +++ b/tests/expected/lscpu/lscpu-x86_64-dellr710 @@ -0,0 +1,39 @@ +CPU op-mode(s): 32-bit, 64-bit +CPU(s): 16 +Thread(s) per core: 2 +Core(s) per socket: 4 +CPU socket(s): 2 +NUMA node(s): 2 +Vendor ID: GenuineIntel +CPU family: 6 +Model: 26 +Stepping: 5 +CPU MHz: 2527.073 +Virtualization: VT-x +L1d cache: 32K +L1i cache: 32K +L2 cache: 256K +L3 cache: 8192K +NUMA node0 CPU(s): 0,2,4,6,8,10,12,14 +NUMA node1 CPU(s): 1,3,5,7,9,11,13,15 + +# The following is the parsable format, which can be fed to other +# programs. Each different item in every column has an unique ID +# starting from zero. +# CPU,Core,Socket,Node,,L1d,L1i,L2,L3 +0,0,0,0,,0,0,0,0 +1,1,1,1,,1,1,1,1 +2,2,0,0,,2,2,2,0 +3,3,1,1,,3,3,3,1 +4,4,0,0,,4,4,4,0 +5,5,1,1,,5,5,5,1 +6,6,0,0,,6,6,6,0 +7,7,1,1,,7,7,7,1 +8,0,0,0,,0,0,0,0 +9,1,1,1,,1,1,1,1 +10,2,0,0,,2,2,2,0 +11,3,1,1,,3,3,3,1 +12,4,0,0,,4,4,4,0 +13,5,1,1,,5,5,5,1 +14,6,0,0,,6,6,6,0 +15,7,1,1,,7,7,7,1 diff --git a/tests/ts/lscpu/dumps/x86_64-dellr710.tar.gz b/tests/ts/lscpu/dumps/x86_64-dellr710.tar.gz new file mode 100644 index 00000000..2c163816 Binary files /dev/null and b/tests/ts/lscpu/dumps/x86_64-dellr710.tar.gz differ -- cgit v1.2.3 From 75f037082038a4f9857d00e45254fcd4bce4cec2 Mon Sep 17 00:00:00 2001 From: Francesco Cosoleto Date: Tue, 18 May 2010 01:07:49 +0200 Subject: tests: update ipcs/headers test Signed-off-by: Francesco Cosoleto --- tests/expected/ipcs/headers | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/expected/ipcs/headers b/tests/expected/ipcs/headers index 155d3080..298d8c93 100644 --- a/tests/expected/ipcs/headers +++ b/tests/expected/ipcs/headers @@ -1,7 +1,7 @@ test: shm headers ------ Shared Memory Attach/Detach/Change Times -------- shmid owner attached detached changed ------- Shared Memory Creator/Last-op -------- +------ Shared Memory Creator/Last-op PIDs -------- shmid owner cpid lpid ------ Shared Memory Segment Creators/Owners -------- shmid perms cuid cgid uid gid @@ -13,10 +13,10 @@ test: mesg headers msqid owner send recv change ------ Message Queues PIDs -------- msqid owner lspid lrpid ------- Message Queues: Creators/Owners -------- +------ Message Queues Creators/Owners -------- msqid perms cuid cgid uid gid ------- Messages: Limits -------- ------- Messages: Status -------- +------ Messages Limits -------- +------ Messages Status -------- test: sem headers ------ Semaphore Operation/Change Times -------- @@ -43,7 +43,7 @@ semid owner last-op last-changed -- ------ Message Queues Send/Recv/Change Times -------- msqid owner send recv change ------- Shared Memory Creator/Last-op -------- +------ Shared Memory Creator/Last-op PIDs -------- shmid owner cpid lpid -- ------ Message Queues PIDs -------- @@ -54,11 +54,11 @@ shmid perms cuid cgid uid gid ------ Semaphore Arrays Creators/Owners -------- semid perms cuid cgid uid gid -- ------- Message Queues: Creators/Owners -------- +------ Message Queues Creators/Owners -------- msqid perms cuid cgid uid gid ------ Shared Memory Limits -------- ------ Semaphore Limits -------- ------- Messages: Limits -------- +------ Messages Limits -------- ------ Shared Memory Status -------- ------ Semaphore Status -------- ------- Messages: Status -------- +------ Messages Status -------- -- cgit v1.2.3 From 8604c25570baaaf814b95199fd0592147d8616c1 Mon Sep 17 00:00:00 2001 From: Andrew Nayenko Date: Fri, 28 May 2010 23:22:00 +0400 Subject: libblkid: add exFAT file system detection support Add exFAT file system detection support. Signed-off-by: Andrew Nayenko --- shlibs/blkid/src/superblocks/Makefile.am | 3 +- shlibs/blkid/src/superblocks/exfat.c | 146 +++++++++++++++++++++++++++++ shlibs/blkid/src/superblocks/superblocks.c | 3 +- shlibs/blkid/src/superblocks/superblocks.h | 1 + tests/expected/blkid/low-probe-exfat | 7 ++ tests/ts/blkid/images-fs/exfat.img.bz2 | Bin 0 -> 6301 bytes 6 files changed, 158 insertions(+), 2 deletions(-) create mode 100644 shlibs/blkid/src/superblocks/exfat.c create mode 100644 tests/expected/blkid/low-probe-exfat create mode 100644 tests/ts/blkid/images-fs/exfat.img.bz2 (limited to 'tests') diff --git a/shlibs/blkid/src/superblocks/Makefile.am b/shlibs/blkid/src/superblocks/Makefile.am index f5b88b8e..39b074ba 100644 --- a/shlibs/blkid/src/superblocks/Makefile.am +++ b/shlibs/blkid/src/superblocks/Makefile.am @@ -46,4 +46,5 @@ libblkid_superblocks_la_SOURCES = \ bfs.c \ drbd.c \ vmfs.c \ - befs.c + befs.c \ + exfat.c diff --git a/shlibs/blkid/src/superblocks/exfat.c b/shlibs/blkid/src/superblocks/exfat.c new file mode 100644 index 00000000..bada3a83 --- /dev/null +++ b/shlibs/blkid/src/superblocks/exfat.c @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2010 Andrew Nayenko + * + * This file may be redistributed under the terms of the + * GNU Lesser General Public License. + */ +#include "superblocks.h" + +struct exfat_super_block { + uint8_t jump[3]; + uint8_t oem_name[8]; + uint8_t __unused1[53]; + uint64_t block_start; + uint64_t block_count; + uint32_t fat_block_start; + uint32_t fat_block_count; + uint32_t cluster_block_start; + uint32_t cluster_count; + uint32_t rootdir_cluster; + uint8_t volume_serial[4]; + struct { + uint8_t minor; + uint8_t major; + } version; + uint16_t volume_state; + uint8_t block_bits; + uint8_t bpc_bits; + uint8_t fat_count; + uint8_t drive_no; + uint8_t allocated_percent; +} __attribute__((__packed__)); + +struct exfat_entry_label { + uint8_t type; + uint8_t length; + uint8_t name[30]; +} __attribute__((__packed__)); + +#define BLOCK_SIZE(sb) (1 << (sb)->block_bits) +#define CLUSTER_SIZE(sb) (BLOCK_SIZE(sb) << (sb)->bpc_bits) +#define EXFAT_FIRST_DATA_CLUSTER 2 +#define EXFAT_LAST_DATA_CLUSTER 0xffffff6 +#define EXFAT_ENTRY_SIZE 32 + +#define EXFAT_ENTRY_EOD 0x00 +#define EXFAT_ENTRY_LABEL 0x83 + +static blkid_loff_t block_to_offset(const struct exfat_super_block *sb, + blkid_loff_t block) +{ + return (blkid_loff_t) block << sb->block_bits; +} + +static blkid_loff_t cluster_to_block(const struct exfat_super_block *sb, + uint32_t cluster) +{ + return le32_to_cpu(sb->cluster_block_start) + + ((blkid_loff_t) (cluster - EXFAT_FIRST_DATA_CLUSTER) + << sb->bpc_bits); +} + +static blkid_loff_t cluster_to_offset(const struct exfat_super_block *sb, + uint32_t cluster) +{ + return block_to_offset(sb, cluster_to_block(sb, cluster)); +} + +static uint32_t next_cluster(blkid_probe pr, + const struct exfat_super_block *sb, uint32_t cluster) +{ + uint32_t *next; + blkid_loff_t fat_offset; + + fat_offset = block_to_offset(sb, le32_to_cpu(sb->fat_block_start)) + + (blkid_loff_t) cluster * sizeof(cluster); + next = (uint32_t *) blkid_probe_get_buffer(pr, fat_offset, + sizeof(uint32_t)); + if (!next) + return 0; + return le32_to_cpu(*next); +} + +static struct exfat_entry_label *find_label(blkid_probe pr, + const struct exfat_super_block *sb) +{ + uint32_t cluster = le32_to_cpu(sb->rootdir_cluster); + blkid_loff_t offset = cluster_to_offset(sb, cluster); + uint8_t *entry; + + for (;;) { + entry = (uint8_t *) blkid_probe_get_buffer(pr, offset, + EXFAT_ENTRY_SIZE); + if (!entry) + return NULL; + if (entry[0] == EXFAT_ENTRY_EOD) + return NULL; + if (entry[0] == EXFAT_ENTRY_LABEL) + return (struct exfat_entry_label *) entry; + offset += EXFAT_ENTRY_SIZE; + if (offset % CLUSTER_SIZE(sb) == 0) { + cluster = next_cluster(pr, sb, cluster); + if (cluster < EXFAT_FIRST_DATA_CLUSTER) + return NULL; + if (cluster > EXFAT_LAST_DATA_CLUSTER) + return NULL; + offset = cluster_to_offset(sb, cluster); + } + } +} + +static int probe_exfat(blkid_probe pr, const struct blkid_idmag *mag) +{ + struct exfat_super_block *sb; + struct exfat_entry_label *label; + + sb = blkid_probe_get_sb(pr, mag, struct exfat_super_block); + if (!sb) + return -1; + + label = find_label(pr, sb); + if (label) + blkid_probe_set_utf8label(pr, label->name, + min(label->length * 2, 30), BLKID_ENC_UTF16LE); + + blkid_probe_sprintf_uuid(pr, sb->volume_serial, 4, + "%02hhX%02hhX-%02hhX%02hhX", + sb->volume_serial[3], sb->volume_serial[2], + sb->volume_serial[1], sb->volume_serial[0]); + + blkid_probe_sprintf_version(pr, "%hu.%hu", + sb->version.major, sb->version.minor); + + return 0; +} + +const struct blkid_idinfo exfat_idinfo = +{ + .name = "exfat", + .usage = BLKID_USAGE_FILESYSTEM, + .probefunc = probe_exfat, + .magics = + { + { .magic = "EXFAT ", .len = 8, .sboff = 3 }, + { NULL } + } +}; diff --git a/shlibs/blkid/src/superblocks/superblocks.c b/shlibs/blkid/src/superblocks/superblocks.c index caa169fa..b80c10b7 100644 --- a/shlibs/blkid/src/superblocks/superblocks.c +++ b/shlibs/blkid/src/superblocks/superblocks.c @@ -139,7 +139,8 @@ static const struct blkid_idinfo *idinfos[] = &ubifs_idinfo, &bfs_idinfo, &vmfs_fs_idinfo, - &befs_idinfo + &befs_idinfo, + &exfat_idinfo }; /* diff --git a/shlibs/blkid/src/superblocks/superblocks.h b/shlibs/blkid/src/superblocks/superblocks.h index b1fa49d5..74cb9743 100644 --- a/shlibs/blkid/src/superblocks/superblocks.h +++ b/shlibs/blkid/src/superblocks/superblocks.h @@ -65,6 +65,7 @@ extern const struct blkid_idinfo vmfs_volume_idinfo; extern const struct blkid_idinfo vmfs_fs_idinfo; extern const struct blkid_idinfo drbd_idinfo; extern const struct blkid_idinfo befs_idinfo; +extern const struct blkid_idinfo exfat_idinfo; /* * superblock functions diff --git a/tests/expected/blkid/low-probe-exfat b/tests/expected/blkid/low-probe-exfat new file mode 100644 index 00000000..b9defbdf --- /dev/null +++ b/tests/expected/blkid/low-probe-exfat @@ -0,0 +1,7 @@ +ID_FS_LABEL=Новый_том +ID_FS_LABEL_ENC=Новый\x20том +ID_FS_TYPE=exfat +ID_FS_USAGE=filesystem +ID_FS_UUID=9C23-8877 +ID_FS_UUID_ENC=9C23-8877 +ID_FS_VERSION=1.0 diff --git a/tests/ts/blkid/images-fs/exfat.img.bz2 b/tests/ts/blkid/images-fs/exfat.img.bz2 new file mode 100644 index 00000000..f96c3f06 Binary files /dev/null and b/tests/ts/blkid/images-fs/exfat.img.bz2 differ -- cgit v1.2.3 From b3f7edcf48126358612f521ddffbdd77506c14ab Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 4 Jun 2010 23:29:26 +0200 Subject: tests: update lscpu test Signed-off-by: Karel Zak --- tests/expected/lscpu/lscpu-ia64-hpmatterhorn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/expected/lscpu/lscpu-ia64-hpmatterhorn b/tests/expected/lscpu/lscpu-ia64-hpmatterhorn index e4446067..f7a38445 100644 --- a/tests/expected/lscpu/lscpu-ia64-hpmatterhorn +++ b/tests/expected/lscpu/lscpu-ia64-hpmatterhorn @@ -13,7 +13,7 @@ L2 cache: 256K L3 cache: 3072K NUMA node0 CPU(s): 4-7 NUMA node1 CPU(s): 0-3 -NUMA node2 CPU(s): +NUMA node2 CPU(s): # The following is the parsable format, which can be fed to other # programs. Each different item in every column has an unique ID -- cgit v1.2.3 From 88827f2623f24bda1e44cdacdee992732a722f90 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 4 Jun 2010 23:31:43 +0200 Subject: tests: mount cramfs read-only Signed-off-by: Karel Zak --- tests/ts/cramfs/mkfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/ts/cramfs/mkfs b/tests/ts/cramfs/mkfs index eb85c55c..99b039e2 100755 --- a/tests/ts/cramfs/mkfs +++ b/tests/ts/cramfs/mkfs @@ -71,7 +71,7 @@ ts_device_has "TYPE" "cramfs" $DEVICE [ "$?" == "0" ] || ts_die "Cannot found cramfs on $DEVICE" $DEVICE ts_log "mount the image" -$TS_CMD_MOUNT -L $LABEL $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT +$TS_CMD_MOUNT -r -L $LABEL $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT # check it ts_is_mounted $DEVICE || ts_die "Cannot found $DEVICE in /proc/mounts" $DEVICE -- cgit v1.2.3 From 5601d158545fc382be031a0330e512784baeee6d Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 4 Jun 2010 23:33:49 +0200 Subject: tests: update blkid test for raid1 ID_PART_ENTRY_TYPE_ENC does not exists anymore. Signed-off-by: Karel Zak --- tests/expected/blkid/md-raid1-part | 2 -- 1 file changed, 2 deletions(-) (limited to 'tests') diff --git a/tests/expected/blkid/md-raid1-part b/tests/expected/blkid/md-raid1-part index d770a741..08b49bd4 100644 --- a/tests/expected/blkid/md-raid1-part +++ b/tests/expected/blkid/md-raid1-part @@ -53,7 +53,6 @@ ID_FS_VERSION=0.90.0 ID_PART_ENTRY_NUMBER=1 ID_PART_ENTRY_SCHEME=dos ID_PART_ENTRY_TYPE=0x83 -ID_PART_ENTRY_TYPE_ENC=0x83 Probe second RAID member ID_FS_TYPE=linux_raid_member ID_FS_USAGE=raid @@ -63,4 +62,3 @@ ID_FS_VERSION=0.90.0 ID_PART_ENTRY_NUMBER=2 ID_PART_ENTRY_SCHEME=dos ID_PART_ENTRY_TYPE=0x83 -ID_PART_ENTRY_TYPE_ENC=0x83 -- cgit v1.2.3 From 5c7cd9ab507a1f49da541711959aa0062cea2ad6 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 16 Jun 2010 11:04:39 +0200 Subject: tests: update fdisk tests Signed-off-by: Karel Zak --- tests/expected/blkid/md-raid1-part | 8 -------- tests/expected/blkid/md-raid1-whole | 8 -------- tests/expected/fdisk/align-512-4K | 8 -------- tests/expected/fdisk/align-512-4K-63 | 8 -------- tests/expected/fdisk/align-512-4K-md | 16 ---------------- tests/expected/fdisk/align-512-512 | 8 -------- tests/expected/fdisk/align-512-512-topology | 8 -------- tests/ts/blkid/md-raid1-part | 2 -- tests/ts/blkid/md-raid1-whole | 2 -- tests/ts/fdisk/align-512-4K | 2 -- tests/ts/fdisk/align-512-4K-63 | 2 -- tests/ts/fdisk/align-512-4K-md | 4 ---- tests/ts/fdisk/align-512-512 | 2 -- tests/ts/fdisk/align-512-512-topology | 2 -- tests/ts/fdisk/doslabel | 22 +++++++++++----------- tests/ts/fdisk/oddinput | 6 +++--- 16 files changed, 14 insertions(+), 94 deletions(-) (limited to 'tests') diff --git a/tests/expected/blkid/md-raid1-part b/tests/expected/blkid/md-raid1-part index 08b49bd4..f1d4cbbb 100644 --- a/tests/expected/blkid/md-raid1-part +++ b/tests/expected/blkid/md-raid1-part @@ -6,14 +6,6 @@ After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) -WARNING: DOS-compatible mode is deprecated. It's strongly recommended to - switch off the mode (command 'c') and change display units to - sectors (command 'u'). - -Command (m for help): DOS Compatibility flag is not set - -Command (m for help): Changing display/entry units to sectors - Command (m for help): Command action e extended p primary partition (1-4) diff --git a/tests/expected/blkid/md-raid1-whole b/tests/expected/blkid/md-raid1-whole index 670a6023..32281c61 100644 --- a/tests/expected/blkid/md-raid1-whole +++ b/tests/expected/blkid/md-raid1-whole @@ -8,14 +8,6 @@ After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) -WARNING: DOS-compatible mode is deprecated. It's strongly recommended to - switch off the mode (command 'c') and change display units to - sectors (command 'u'). - -Command (m for help): DOS Compatibility flag is not set - -Command (m for help): Changing display/entry units to sectors - Command (m for help): Command action e extended p primary partition (1-4) diff --git a/tests/expected/fdisk/align-512-4K b/tests/expected/fdisk/align-512-4K index 0857e378..7be7c039 100644 --- a/tests/expected/fdisk/align-512-4K +++ b/tests/expected/fdisk/align-512-4K @@ -10,14 +10,6 @@ The device presents a logical sector size that is smaller than the physical sector size. Aligning to a physical sector (or optimal I/O) size boundary is recommended, or performance may be impacted. -WARNING: DOS-compatible mode is deprecated. It's strongly recommended to - switch off the mode (command 'c') and change display units to - sectors (command 'u'). - -Command (m for help): DOS Compatibility flag is not set - -Command (m for help): Changing display/entry units to sectors - Command (m for help): Command action e extended p primary partition (1-4) diff --git a/tests/expected/fdisk/align-512-4K-63 b/tests/expected/fdisk/align-512-4K-63 index 75998891..51e75f95 100644 --- a/tests/expected/fdisk/align-512-4K-63 +++ b/tests/expected/fdisk/align-512-4K-63 @@ -10,14 +10,6 @@ The device presents a logical sector size that is smaller than the physical sector size. Aligning to a physical sector (or optimal I/O) size boundary is recommended, or performance may be impacted. -WARNING: DOS-compatible mode is deprecated. It's strongly recommended to - switch off the mode (command 'c') and change display units to - sectors (command 'u'). - -Command (m for help): DOS Compatibility flag is not set - -Command (m for help): Changing display/entry units to sectors - Command (m for help): Command action e extended p primary partition (1-4) diff --git a/tests/expected/fdisk/align-512-4K-md b/tests/expected/fdisk/align-512-4K-md index 4ac8ccc7..db43ec6d 100644 --- a/tests/expected/fdisk/align-512-4K-md +++ b/tests/expected/fdisk/align-512-4K-md @@ -10,14 +10,6 @@ The device presents a logical sector size that is smaller than the physical sector size. Aligning to a physical sector (or optimal I/O) size boundary is recommended, or performance may be impacted. -WARNING: DOS-compatible mode is deprecated. It's strongly recommended to - switch off the mode (command 'c') and change display units to - sectors (command 'u'). - -Command (m for help): DOS Compatibility flag is not set - -Command (m for help): Changing display/entry units to sectors - Command (m for help): Command action e extended p primary partition (1-4) @@ -60,14 +52,6 @@ The device presents a logical sector size that is smaller than the physical sector size. Aligning to a physical sector (or optimal I/O) size boundary is recommended, or performance may be impacted. -WARNING: DOS-compatible mode is deprecated. It's strongly recommended to - switch off the mode (command 'c') and change display units to - sectors (command 'u'). - -Command (m for help): DOS Compatibility flag is not set - -Command (m for help): Changing display/entry units to sectors - Command (m for help): Command action e extended p primary partition (1-4) diff --git a/tests/expected/fdisk/align-512-512 b/tests/expected/fdisk/align-512-512 index 6f49256e..c940f806 100644 --- a/tests/expected/fdisk/align-512-512 +++ b/tests/expected/fdisk/align-512-512 @@ -6,14 +6,6 @@ After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) -WARNING: DOS-compatible mode is deprecated. It's strongly recommended to - switch off the mode (command 'c') and change display units to - sectors (command 'u'). - -Command (m for help): DOS Compatibility flag is not set - -Command (m for help): Changing display/entry units to sectors - Command (m for help): Command action e extended p primary partition (1-4) diff --git a/tests/expected/fdisk/align-512-512-topology b/tests/expected/fdisk/align-512-512-topology index c99a1745..f37b5a3b 100644 --- a/tests/expected/fdisk/align-512-512-topology +++ b/tests/expected/fdisk/align-512-512-topology @@ -6,14 +6,6 @@ After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) -WARNING: DOS-compatible mode is deprecated. It's strongly recommended to - switch off the mode (command 'c') and change display units to - sectors (command 'u'). - -Command (m for help): DOS Compatibility flag is not set - -Command (m for help): Changing display/entry units to sectors - Command (m for help): Command action e extended p primary partition (1-4) diff --git a/tests/ts/blkid/md-raid1-part b/tests/ts/blkid/md-raid1-part index 1d55f6bb..909edd03 100755 --- a/tests/ts/blkid/md-raid1-part +++ b/tests/ts/blkid/md-raid1-part @@ -40,8 +40,6 @@ DEVICE="/dev/${DEVNAME}" ts_log "Create partitions" $TS_CMD_FDISK ${DEVICE} >> $TS_OUTPUT 2>&1 <> $TS_OUTPUT 2>&1 <> $TS_OUTPUT 2>&1 <> $TS_OUTPUT 2>&1 <> $TS_OUTPUT 2>&1 <> $TS_OUTPUT 2>&1 <> $TS_OUTPUT 2>&1 <> $TS_OUTPUT 2>&1 <> $TS_OUTPUT 2>&1 # ID will be random and will screw up md5's ts_log "Create new DOS partition table" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_DOSLABEL}${FDISK_CMD_INIT}${FDISK_CMD_WRITE_CLOSE}" \ - | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null + | $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Create primary partition" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}" | \ - $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null + $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Set partition type" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CHANGE_PARTTYPE}${FDISK_CMD_WRITE_CLOSE}" | \ - $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null + $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Set primary partition active" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_SET_ACTIVE}${FDISK_CMD_WRITE_CLOSE}" | \ - $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null + $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Re-create primary partition" echo -e "${FDISK_CMD_INIT}d\n${FDISK_CMD_CREATE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}" | \ - $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null + $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Create extended partition" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_EXTENDED}${FDISK_CMD_WRITE_CLOSE}" | \ - $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null + $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Create logical partitions" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_WRITE_CLOSE}" \ - | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null + | $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Delete logical partitions" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETE_LOGICALS}${FDISK_CMD_WRITE_CLOSE}" \ - | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null + | $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Create another logical partition" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_WRITE_CLOSE}" \ - | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null + | $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Delete primary partition" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}" \ - | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null + | $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Delete extended partition" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETE_EXTENDED}${FDISK_CMD_WRITE_CLOSE}" \ - | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null + | $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_finalize diff --git a/tests/ts/fdisk/oddinput b/tests/ts/fdisk/oddinput index 9d5c4762..ceb6102c 100755 --- a/tests/ts/fdisk/oddinput +++ b/tests/ts/fdisk/oddinput @@ -28,12 +28,12 @@ ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Empty image listing" # this should report empty partition table # TEST_IMAGE_NAME has absolute path, and is by definition different on each computer, we need to sed it away -$TS_CMD_FDISK -l ${TEST_IMAGE_NAME} 2>&1 | sed -e "s/${TEST_IMAGE_NAME//\//\\/}/testimage/" >> $TS_OUTPUT +$TS_CMD_FDISK -c=dos -u=cylinders -l ${TEST_IMAGE_NAME} 2>&1 | sed -e "s/${TEST_IMAGE_NAME//\//\\/}/testimage/" >> $TS_OUTPUT ts_log "Nonexistant file" # this originally does absolutely nothing -$TS_CMD_FDISK -l _a_file_that_does_not_exist_ >> $TS_OUTPUT 2>&1 +$TS_CMD_FDISK -c=dos -u=cylinders -l _a_file_that_does_not_exist_ >> $TS_OUTPUT 2>&1 ts_log "Too small file" # same here -$TS_CMD_FDISK -l $TS_TOPDIR/expected/fdisk/oddinput.toosmall >> $TS_OUTPUT 2>&1 +$TS_CMD_FDISK -c=dos -u=cylinders -l $TS_TOPDIR/expected/fdisk/oddinput.toosmall >> $TS_OUTPUT 2>&1 ts_finalize -- cgit v1.2.3 From 2f89fb42a3fd950d2a35e515c21f016f7dc0e8d7 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 1 Jul 2010 09:44:08 +0200 Subject: tests: truncate BeFS and tuxonice images Signed-off-by: Karel Zak --- tests/ts/blkid/images-fs/befs.img.bz2 | Bin 899614 -> 36236 bytes tests/ts/blkid/images-fs/tuxonice.img.bz2 | Bin 2765314 -> 36891 bytes 2 files changed, 0 insertions(+), 0 deletions(-) (limited to 'tests') diff --git a/tests/ts/blkid/images-fs/befs.img.bz2 b/tests/ts/blkid/images-fs/befs.img.bz2 index 0913da24..f4deaec4 100644 Binary files a/tests/ts/blkid/images-fs/befs.img.bz2 and b/tests/ts/blkid/images-fs/befs.img.bz2 differ diff --git a/tests/ts/blkid/images-fs/tuxonice.img.bz2 b/tests/ts/blkid/images-fs/tuxonice.img.bz2 index c47ab3e8..a70c95ad 100644 Binary files a/tests/ts/blkid/images-fs/tuxonice.img.bz2 and b/tests/ts/blkid/images-fs/tuxonice.img.bz2 differ -- cgit v1.2.3 From 67bb0074eec2b154d15bd3dd77b482c3d6125761 Mon Sep 17 00:00:00 2001 From: Jiro SEKIBA Date: Tue, 13 Jul 2010 09:14:08 +0200 Subject: tests: add nilfs2 test for libblkid Signed-off-by: Jiro SEKIBA Signed-off-by: Karel Zak --- tests/expected/blkid/low-probe-nilfs2 | 7 +++++++ tests/ts/blkid/images-fs/nilfs2.img.bz2 | Bin 0 -> 795 bytes 2 files changed, 7 insertions(+) create mode 100644 tests/expected/blkid/low-probe-nilfs2 create mode 100644 tests/ts/blkid/images-fs/nilfs2.img.bz2 (limited to 'tests') diff --git a/tests/expected/blkid/low-probe-nilfs2 b/tests/expected/blkid/low-probe-nilfs2 new file mode 100644 index 00000000..bfd8fcde --- /dev/null +++ b/tests/expected/blkid/low-probe-nilfs2 @@ -0,0 +1,7 @@ +ID_FS_LABEL=test-nilfs2 +ID_FS_LABEL_ENC=test-nilfs2 +ID_FS_TYPE=nilfs +ID_FS_USAGE=filesystem +ID_FS_UUID=524025fb-6d31-40e6-baad-1db36cfdf806 +ID_FS_UUID_ENC=524025fb-6d31-40e6-baad-1db36cfdf806 +ID_FS_VERSION=2 diff --git a/tests/ts/blkid/images-fs/nilfs2.img.bz2 b/tests/ts/blkid/images-fs/nilfs2.img.bz2 new file mode 100644 index 00000000..a9762eb1 Binary files /dev/null and b/tests/ts/blkid/images-fs/nilfs2.img.bz2 differ -- cgit v1.2.3 From 1326e1dfa5c1d06ff7521b8c8162452799164239 Mon Sep 17 00:00:00 2001 From: Jiro SEKIBA Date: Thu, 15 Jul 2010 13:40:27 +0900 Subject: libblkid: fix typo filesystem name nilfs to nilfs2 The correct filesystem name is nilfs2, not nilfs. Signed-off-by: Jiro SEKIBA --- shlibs/blkid/src/superblocks/nilfs.c | 2 +- tests/expected/blkid/low-probe-nilfs2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/shlibs/blkid/src/superblocks/nilfs.c b/shlibs/blkid/src/superblocks/nilfs.c index c7aba356..bf169182 100644 --- a/shlibs/blkid/src/superblocks/nilfs.c +++ b/shlibs/blkid/src/superblocks/nilfs.c @@ -104,7 +104,7 @@ static int probe_nilfs2(blkid_probe pr, const struct blkid_idmag *mag) const struct blkid_idinfo nilfs2_idinfo = { - .name = "nilfs", + .name = "nilfs2", .usage = BLKID_USAGE_FILESYSTEM, .probefunc = probe_nilfs2, .magics = diff --git a/tests/expected/blkid/low-probe-nilfs2 b/tests/expected/blkid/low-probe-nilfs2 index bfd8fcde..c6c9cab1 100644 --- a/tests/expected/blkid/low-probe-nilfs2 +++ b/tests/expected/blkid/low-probe-nilfs2 @@ -1,6 +1,6 @@ ID_FS_LABEL=test-nilfs2 ID_FS_LABEL_ENC=test-nilfs2 -ID_FS_TYPE=nilfs +ID_FS_TYPE=nilfs2 ID_FS_USAGE=filesystem ID_FS_UUID=524025fb-6d31-40e6-baad-1db36cfdf806 ID_FS_UUID_ENC=524025fb-6d31-40e6-baad-1db36cfdf806 -- cgit v1.2.3