nix/tests/init.sh

34 lines
648 B
Bash
Raw Normal View History

source common.sh
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"
2005-02-01 17:50:48 +00:00
mkdir "$NIX_LOCALSTATE_DIR"
2005-02-18 08:40:52 +00:00
mkdir -p "$NIX_LOG_DIR"/drvs
mkdir "$NIX_STATE_DIR"
mkdir "$NIX_DB_DIR"
2005-02-15 09:39:12 +00:00
mkdir "$NIX_CONF_DIR"
2005-02-15 09:39:12 +00:00
cat > "$NIX_CONF_DIR"/nix.conf <<EOF
build-users-group =
2005-02-15 09:39:12 +00:00
gc-keep-outputs = false
gc-keep-derivations = false
env-keep-derivations = false
fsync-metadata = false
2005-02-15 09:39:12 +00:00
EOF
# Initialise the database.
nix-store --init
# Did anything happen?
test -e "$NIX_DB_DIR"/db.sqlite
2008-12-03 16:15:38 +00:00
echo 'Hello World' > ./dummy