summaryrefslogtreecommitdiffstats
path: root/debian/patches/upstream/fadvise-test-dynamically-calculate-expected-test-values.patch
blob: bd84ee578d4eb95052e654cb8a1d7d83fa081081 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <thomas@t-8ch.de>
Date: Sun, 21 May 2023 21:42:14 +0200
Subject: fadvise: (test) dynamically calculate expected test values
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
---
 tests/ts/fadvise/drop | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/ts/fadvise/drop b/tests/ts/fadvise/drop
index 7c7eee5..86c0d5b 100755
--- a/tests/ts/fadvise/drop
+++ b/tests/ts/fadvise/drop
@@ -16,7 +16,7 @@ ts_check_prog "sleep"
 ts_cd "$TS_OUTDIR"
 
 FILE="ddtest"
-BS=4k
+BS=4096
 COUNT=8
 
 FILE_FS="$("$TS_CMD_FINDMNT" -nr -o FSTYPE -T "$PWD")"
@@ -41,22 +41,22 @@ create_file() {
     echo
 
     create_file
-    echo "offset: 8192"
-    "$TS_CMD_FADVISE" -o 8192 "$FILE"
+    echo "offset: $(( 2 * $BS ))"
+    "$TS_CMD_FADVISE" -o $(( 2 * $BS )) "$FILE"
     echo status: $?
     "$TS_CMD_FINCORE" "$FILE"
     echo
 
     create_file
-    echo "length: 16384"
-    "$TS_CMD_FADVISE" -l 16384 "$FILE"
+    echo "length: $(( 4 * $BS ))"
+    "$TS_CMD_FADVISE" -l $(( 4 * $BS )) "$FILE"
     echo status: $?
     "$TS_CMD_FINCORE" "$FILE"
     echo
 
     create_file
-    echo "offset: 8192, length: 16384 fd: 42"
-    "$TS_CMD_FADVISE" -o 8192 -l 16384 --fd 42 42<"$FILE"
+    echo "offset: $(( 2 * $BS )), length: $(( 4 * $BS )) fd: 42"
+    "$TS_CMD_FADVISE" -o $(( 2 * $BS )) -l $(( 4 * $BS )) --fd 42 42<"$FILE"
     echo status: $?
     "$TS_CMD_FINCORE" "$FILE"
     echo