From a7e1a51fdf5d93b0a158a120595443fe9c7c6687 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 13 Aug 2007 14:56:40 +0000 Subject: * A test for the nix-worker. --- tests/Makefile.am | 3 ++- tests/common.sh.in | 5 ++++- tests/init.sh | 1 + tests/remote-store.sh | 17 +++++++++++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 tests/remote-store.sh diff --git a/tests/Makefile.am b/tests/Makefile.am index 31ad159b06b2..bab9e8ee4771 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -18,7 +18,8 @@ TESTS = init.sh hash.sh lang.sh add.sh simple.sh dependencies.sh \ locking.sh parallel.sh build-hook.sh substitutes.sh substitutes2.sh \ fallback.sh nix-push.sh gc.sh gc-concurrent.sh verify.sh nix-pull.sh \ referrers.sh user-envs.sh logging.sh nix-build.sh misc.sh fixed.sh \ - gc-runtime.sh install-package.sh check-refs.sh filter-source.sh + gc-runtime.sh install-package.sh check-refs.sh filter-source.sh \ + remote-store.sh XFAIL_TESTS = diff --git a/tests/common.sh.in b/tests/common.sh.in index 1b8bb3e7df42..4228811ff9b5 100644 --- a/tests/common.sh.in +++ b/tests/common.sh.in @@ -18,7 +18,9 @@ export NIX_LIBEXEC_DIR=$TEST_ROOT/bin export NIX_ROOT_FINDER= export SHARED=$TEST_ROOT/shared -export NIX_REMOTE= +if test -z "$FORCE_NIX_REMOTE"; then + export NIX_REMOTE= +fi export REAL_BIN_DIR=@bindir@ export REAL_LIBEXEC_DIR=@libexecdir@ @@ -45,6 +47,7 @@ export nixinstantiate=$TOP/src/nix-instantiate/nix-instantiate export nixstore=$TOP/src/nix-store/nix-store export nixenv=$TOP/src/nix-env/nix-env export nixhash=$TOP/src/nix-hash/nix-hash +export nixworker=$TOP/src/nix-worker/nix-worker export nixbuild=$NIX_BIN_DIR/nix-build readLink() { diff --git a/tests/init.sh b/tests/init.sh index 160cb6b0a915..b5c62f408709 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -22,6 +22,7 @@ ln -s $nixstore $NIX_BIN_DIR/ ln -s $nixinstantiate $NIX_BIN_DIR/ ln -s $nixhash $NIX_BIN_DIR/ ln -s $nixenv $NIX_BIN_DIR/ +ln -s $nixworker $NIX_BIN_DIR/ ln -s $TOP/scripts/nix-prefetch-url $NIX_BIN_DIR/ ln -s $TOP/scripts/nix-collect-garbage $NIX_BIN_DIR/ ln -s $TOP/scripts/nix-build $NIX_BIN_DIR/ diff --git a/tests/remote-store.sh b/tests/remote-store.sh new file mode 100644 index 000000000000..4a31312f58bf --- /dev/null +++ b/tests/remote-store.sh @@ -0,0 +1,17 @@ +source common.sh + +export FORCE_NIX_REMOTE=1 + +echo '*** testing slave mode ***' +clearStore +clearManifests +NIX_REMOTE=slave sh ./user-envs.sh + +echo '*** testing daemon mode ***' +clearStore +clearManifests +$nixworker --daemon & +pidDaemon=$! +NIX_REMOTE=daemon sh ./user-envs.sh +kill -9 $pidDaemon +wait $pidDaemon || true -- cgit 1.4.1