]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: fix fincore/count for PAGE_SIZE != 4096
authorRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 6 Apr 2017 07:56:02 +0000 (09:56 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 6 Apr 2017 10:30:09 +0000 (12:30 +0200)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests/expected/fincore/count.4096 [moved from tests/expected/fincore/count with 100% similarity]
tests/expected/fincore/count.65536 [new file with mode: 0644]
tests/expected/fincore/count.nosize [new file with mode: 0644]
tests/ts/fincore/count

diff --git a/tests/expected/fincore/count.65536 b/tests/expected/fincore/count.65536
new file mode 100644 (file)
index 0000000..0a9fab4
--- /dev/null
@@ -0,0 +1,55 @@
+[ NO EXCITING FILE ]
+fincore: failed to open: no_such_file: No such file or directory
+return value: 1
+    0    0 i_EMPTY_FILE
+return value: 0
+    1 65535 i_PAGESIZE_-1__incore_
+return value: 0
+    1 65536 i_JUST_PAGESIZE_incore_
+return value: 0
+    0 65536 i_JUST_PAGESIZE_directio_
+return value: 0
+    2 131072 i_TWO_PAGES_incore_
+return value: 0
+    0 131072 i_TWO_PAGES_directio_
+return value: 0
+    1 131072 i_TWO_PAGES_mixed_directio_incore_
+return value: 0
+    1 131072 i_TWO_PAGES_mixed_incore_directio_
+return value: 0
+    2 2147418112 i_WINDOW_SIZE_incore-sparse-incore_
+return value: 0
+    0 2147418112 i_WINDOW_SIZE_directio-sparse-directio_
+return value: 0
+    1 2147418112 i_WINDOW_SIZE_incore-sparse-directio_
+return value: 0
+    1 2147418112 i_WINDOW_SIZE_directio-sparse-incore_
+return value: 0
+    2 2147483648 i_WINDOW_SIZE_+_1_page_incore-sparse-incore_
+return value: 0
+    0 2147483648 i_WINDOW_SIZE_+_1_page_directio-sparse-directio_
+return value: 0
+    1 2147483648 i_WINDOW_SIZE_+_1_page_incore-sparse-directio_
+return value: 0
+    1 2147483648 i_WINDOW_SIZE_+_1_page_directio-sparse-incore_
+return value: 0
+[ MULTIPLE FILES ]
+fincore: failed to open: no_such_file: No such file or directory
+PAGES       SIZE FILE
+    0          0 i_EMPTY_FILE
+    1      65535 i_PAGESIZE_-1__incore_
+    1      65536 i_JUST_PAGESIZE_incore_
+    0      65536 i_JUST_PAGESIZE_directio_
+    2     131072 i_TWO_PAGES_incore_
+    0     131072 i_TWO_PAGES_directio_
+    1     131072 i_TWO_PAGES_mixed_directio_incore_
+    1     131072 i_TWO_PAGES_mixed_incore_directio_
+    2 2147418112 i_WINDOW_SIZE_incore-sparse-incore_
+    0 2147418112 i_WINDOW_SIZE_directio-sparse-directio_
+    1 2147418112 i_WINDOW_SIZE_incore-sparse-directio_
+    1 2147418112 i_WINDOW_SIZE_directio-sparse-incore_
+    2 2147483648 i_WINDOW_SIZE_+_1_page_incore-sparse-incore_
+    0 2147483648 i_WINDOW_SIZE_+_1_page_directio-sparse-directio_
+    1 2147483648 i_WINDOW_SIZE_+_1_page_incore-sparse-directio_
+    1 2147483648 i_WINDOW_SIZE_+_1_page_directio-sparse-incore_
+return value: 1
diff --git a/tests/expected/fincore/count.nosize b/tests/expected/fincore/count.nosize
new file mode 100644 (file)
index 0000000..d570445
--- /dev/null
@@ -0,0 +1,55 @@
+[ NO EXCITING FILE ]
+fincore: failed to open: no_such_file: No such file or directory
+return value: 1
+    0 i_EMPTY_FILE
+return value: 0
+    1 i_PAGESIZE_-1__incore_
+return value: 0
+    1 i_JUST_PAGESIZE_incore_
+return value: 0
+    0 i_JUST_PAGESIZE_directio_
+return value: 0
+    2 i_TWO_PAGES_incore_
+return value: 0
+    0 i_TWO_PAGES_directio_
+return value: 0
+    1 i_TWO_PAGES_mixed_directio_incore_
+return value: 0
+    1 i_TWO_PAGES_mixed_incore_directio_
+return value: 0
+    2 i_WINDOW_SIZE_incore-sparse-incore_
+return value: 0
+    0 i_WINDOW_SIZE_directio-sparse-directio_
+return value: 0
+    1 i_WINDOW_SIZE_incore-sparse-directio_
+return value: 0
+    1 i_WINDOW_SIZE_directio-sparse-incore_
+return value: 0
+    2 i_WINDOW_SIZE_+_1_page_incore-sparse-incore_
+return value: 0
+    0 i_WINDOW_SIZE_+_1_page_directio-sparse-directio_
+return value: 0
+    1 i_WINDOW_SIZE_+_1_page_incore-sparse-directio_
+return value: 0
+    1 i_WINDOW_SIZE_+_1_page_directio-sparse-incore_
+return value: 0
+[ MULTIPLE FILES ]
+fincore: failed to open: no_such_file: No such file or directory
+PAGES FILE
+    0 i_EMPTY_FILE
+    1 i_PAGESIZE_-1__incore_
+    1 i_JUST_PAGESIZE_incore_
+    0 i_JUST_PAGESIZE_directio_
+    2 i_TWO_PAGES_incore_
+    0 i_TWO_PAGES_directio_
+    1 i_TWO_PAGES_mixed_directio_incore_
+    1 i_TWO_PAGES_mixed_incore_directio_
+    2 i_WINDOW_SIZE_incore-sparse-incore_
+    0 i_WINDOW_SIZE_directio-sparse-directio_
+    1 i_WINDOW_SIZE_incore-sparse-directio_
+    1 i_WINDOW_SIZE_directio-sparse-incore_
+    2 i_WINDOW_SIZE_+_1_page_incore-sparse-incore_
+    0 i_WINDOW_SIZE_+_1_page_directio-sparse-directio_
+    1 i_WINDOW_SIZE_+_1_page_incore-sparse-directio_
+    1 i_WINDOW_SIZE_+_1_page_directio-sparse-incore_
+return value: 1
index 8f23fece5c522ef6d8129f681b294d64e40f7b8d..be815527e72fdabc3daedf460169db8a2516d9b0 100755 (executable)
@@ -32,7 +32,7 @@ function run_dd_test
        $DD if=/dev/zero of=$input count=1 bs=$bs $flags &> /dev/null
     fi
 
-    $TS_CMD_FINCORE --output PAGES,SIZE,FILE  --bytes --noheadings $input
+    $TS_CMD_FINCORE --output $COLUMNS  --bytes --noheadings $input
 
     footer "$?"
 }
@@ -51,7 +51,7 @@ function run_dd_dd_test
     $DD if=/dev/zero of=$input count=1 bs=$bs $flags0 &> /dev/null
     $DD if=/dev/zero of=$input count=1 bs=$bs $flags1 &> /dev/null
 
-    $TS_CMD_FINCORE --output PAGES,SIZE,FILE --bytes --noheadings $input
+    $TS_CMD_FINCORE --output $COLUMNS --bytes --noheadings $input
 
     footer "$?"
 }
@@ -65,6 +65,16 @@ ts_init "$*"
 PAGE_SIZE=$($TS_HELPER_SYSINFO pagesize)
 WINDOW_SIZE=$(( 32 * 1024 * PAGE_SIZE ))
 
+# we use PAGE_SIZE dependent output for a few systems
+if test -f "$TS_EXPECTED.$PAGE_SIZE"; then
+       TS_EXPECTED+=".$PAGE_SIZE"
+       COLUMNS="PAGES,SIZE,FILE"
+else
+       TS_EXPECTED+=".nosize"
+       COLUMNS="PAGES,FILE"
+fi
+
+
 # seems unsupported by some dd(1) version
 #DD_FLAGS="status=none"
 
@@ -83,7 +93,7 @@ input=
     INPUT="${INPUT} ${input}"
 
     header "NO EXCITING FILE"
-    $TS_CMD_FINCORE --output PAGES,SIZE,FILE --bytes --noheadings $input
+    $TS_CMD_FINCORE --output $COLUMNS --bytes --noheadings $input
     footer "$?"
 } >> $TS_OUTPUT 2>&1
 
@@ -181,7 +191,7 @@ input=
 
 {
     header "MULTIPLE FILES"
-    $TS_CMD_FINCORE --output PAGES,SIZE,FILE --bytes $INPUT
+    $TS_CMD_FINCORE --output $COLUMNS --bytes $INPUT
     footer "$?"
 } >> $TS_OUTPUT 2>&1