about summary refs log tree commit diff
path: root/tests/init.sh
blob: 627cdae1752ccd77d059fe3805859c2f3d100af9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
echo "NIX_STORE_DIR=$NIX_STORE_DIR NIX_DB_DIR=$NIX_DB_DIR"

test -n "$TEST_ROOT"
if test -d "$TEST_ROOT"; then
    chmod -R u+w "$TEST_ROOT"
    rm -rf "$TEST_ROOT"
fi
mkdir "$TEST_ROOT"

mkdir "$NIX_STORE_DIR"
mkdir "$NIX_DATA_DIR"
mkdir "$NIX_LOG_DIR"
mkdir "$NIX_STATE_DIR"
mkdir "$NIX_DB_DIR"

# Initialise the database.
$TOP/src/nix-store/nix-store --init

# Did anything happen?
test -e "$NIX_DB_DIR"/validpaths