From: Ruediger Meier Date: Thu, 6 Apr 2017 07:56:02 +0000 (+0200) Subject: tests: fix fincore/count for PAGE_SIZE != 4096 X-Git-Tag: v2.30-rc1~131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a4a617d03e0ccd87e0f47e00bc2a6a7ae0f4cf6;p=thirdparty%2Futil-linux.git tests: fix fincore/count for PAGE_SIZE != 4096 Signed-off-by: Ruediger Meier --- diff --git a/tests/expected/fincore/count b/tests/expected/fincore/count.4096 similarity index 100% rename from tests/expected/fincore/count rename to tests/expected/fincore/count.4096 diff --git a/tests/expected/fincore/count.65536 b/tests/expected/fincore/count.65536 new file mode 100644 index 0000000000..0a9fab4553 --- /dev/null +++ b/tests/expected/fincore/count.65536 @@ -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 index 0000000000..d5704451c8 --- /dev/null +++ b/tests/expected/fincore/count.nosize @@ -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 diff --git a/tests/ts/fincore/count b/tests/ts/fincore/count index 8f23fece5c..be815527e7 100755 --- a/tests/ts/fincore/count +++ b/tests/ts/fincore/count @@ -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