aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/compression-levels.sh
blob: 85f12974ac77b44f48aa2f4f79bf328b4221697c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
source common.sh

clearStore
clearCache

outPath=$(nix-build dependencies.nix --no-out-link)

cacheURI="file://$cacheDir?compression=xz&compression-level=0"

nix copy --to $cacheURI $outPath

FILESIZES=$(cat ${cacheDir}/*.narinfo | awk '/FileSize: /{sum+=$2}END{print sum}')

clearCache

cacheURI="file://$cacheDir?compression=xz&compression-level=5"

nix copy --to $cacheURI $outPath

FILESIZES2=$(cat ${cacheDir}/*.narinfo | awk '/FileSize: /{sum+=$2}END{print sum}')

[[ $FILESIZES -gt $FILESIZES2 ]]