aboutsummaryrefslogtreecommitdiffstats
path: root/tests/t0020-validate-cache.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/t0020-validate-cache.sh')
-rwxr-xr-xtests/t0020-validate-cache.sh32
1 files changed, 17 insertions, 15 deletions
diff --git a/tests/t0020-validate-cache.sh b/tests/t0020-validate-cache.sh
index 53ec2eb..1910b47 100755
--- a/tests/t0020-validate-cache.sh
+++ b/tests/t0020-validate-cache.sh
@@ -1,13 +1,12 @@
1#!/bin/sh 1#!/bin/sh
2 2
3test_description='Validate cache'
3. ./setup.sh 4. ./setup.sh
4 5
5prepare_tests 'Validate cache' 6test_expect_success 'verify cache-size=0' '
6 7
7run_test 'verify cache-size=0' ' 8 rm -f cache/* &&
8 9 sed -i -e "s/cache-size=1021$/cache-size=0/" cgitrc &&
9 rm -f trash/cache/* &&
10 sed -i -e "s/cache-size=1021$/cache-size=0/" trash/cgitrc &&
11 cgit_url "" && 10 cgit_url "" &&
12 cgit_url "foo" && 11 cgit_url "foo" &&
13 cgit_url "foo/refs" && 12 cgit_url "foo/refs" &&
@@ -21,13 +20,14 @@ run_test 'verify cache-size=0' '
21 cgit_url "bar/log" && 20 cgit_url "bar/log" &&
22 cgit_url "bar/diff" && 21 cgit_url "bar/diff" &&
23 cgit_url "bar/patch" && 22 cgit_url "bar/patch" &&
24 test 0 -eq $(ls trash/cache | wc -l) 23 ls cache >output &&
24 test_line_count = 0 output
25' 25'
26 26
27run_test 'verify cache-size=1' ' 27test_expect_success 'verify cache-size=1' '
28 28
29 rm -f trash/cache/* && 29 rm -f cache/* &&
30 sed -i -e "s/cache-size=0$/cache-size=1/" trash/cgitrc && 30 sed -i -e "s/cache-size=0$/cache-size=1/" cgitrc &&
31 cgit_url "" && 31 cgit_url "" &&
32 cgit_url "foo" && 32 cgit_url "foo" &&
33 cgit_url "foo/refs" && 33 cgit_url "foo/refs" &&
@@ -41,13 +41,14 @@ run_test 'verify cache-size=1' '
41 cgit_url "bar/log" && 41 cgit_url "bar/log" &&
42 cgit_url "bar/diff" && 42 cgit_url "bar/diff" &&
43 cgit_url "bar/patch" && 43 cgit_url "bar/patch" &&
44 test 1 -eq $(ls trash/cache | wc -l) 44 ls cache >output &&
45 test_line_count = 1 output
45' 46'
46 47
47run_test 'verify cache-size=1021' ' 48test_expect_success 'verify cache-size=1021' '
48 49
49 rm -f trash/cache/* && 50 rm -f cache/* &&
50 sed -i -e "s/cache-size=1$/cache-size=1021/" trash/cgitrc && 51 sed -i -e "s/cache-size=1$/cache-size=1021/" cgitrc &&
51 cgit_url "" && 52 cgit_url "" &&
52 cgit_url "foo" && 53 cgit_url "foo" &&
53 cgit_url "foo/refs" && 54 cgit_url "foo/refs" &&
@@ -61,7 +62,8 @@ run_test 'verify cache-size=1021' '
61 cgit_url "bar/log" && 62 cgit_url "bar/log" &&
62 cgit_url "bar/diff" && 63 cgit_url "bar/diff" &&
63 cgit_url "bar/patch" && 64 cgit_url "bar/patch" &&
64 test 13 -eq $(ls trash/cache | wc -l) 65 ls cache >output &&
66 test_line_count = 13 output
65' 67'
66 68
67tests_done 69test_done