From 6201f67e9ec30ec7d39270c0da27cd282a5e8cb4 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 21 Nov 2017 07:51:25 +0100 Subject: tests/games/sandbox: Rename to tests/sandbox We have excluded all tests within the games directory from being built by Hydra, rightfully so because they're proprietary. However our sandbox is *not* proprietary so we want to have it tested. Besides, we might want to use that sandbox for other things rather than just games in the future, which saves us that rename later ;-) Signed-off-by: aszlig --- tests/default.nix | 2 +- tests/games/sandbox.nix | 42 ------------------------------------------ tests/sandbox.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 43 deletions(-) delete mode 100644 tests/games/sandbox.nix create mode 100644 tests/sandbox.nix (limited to 'tests') diff --git a/tests/default.nix b/tests/default.nix index 0d03bc62..c9cafe6c 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -7,12 +7,12 @@ let in { games = { - sandbox = callTest ./games/sandbox.nix; starbound = callTest ./games/starbound.nix; }; programs = { gnupg = callTest ./programs/gnupg; }; + sandbox = callTest ./sandbox.nix; system = { kernel.bfq = callTest ./system/kernel/bfq.nix; }; diff --git a/tests/games/sandbox.nix b/tests/games/sandbox.nix deleted file mode 100644 index 98d29870..00000000 --- a/tests/games/sandbox.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - name = "sandbox"; - - machine = { pkgs, lib, ... }: { - nixpkgs.config.vuizvui.games = {}; - system.activationScripts.inject-link = '' - ln -svf ${pkgs.hello} /run/foo-test-sandbox - ln -svf ${pkgs.gnused} /run/bar-test-sandbox - ln -svf ${pkgs.gnugrep} /run/baz-test-sandbox - ''; - environment.sessionVariables.COLLECT_ME = [ - "/run/foo-test-sandbox" - "/run/bar-test-sandbox" - "/run/baz-test-sandbox" - ]; - environment.systemPackages = let - testProgram = pkgs.writeScriptBin "test-sandbox" '' - #!${pkgs.stdenv.shell} -ex - ! echo foo | grep -qF foo - export PATH=/run/baz-test-sandbox/bin - echo foo > /home/foo/existing/bar - test ! -d /home/foo/nonexisting - /run/foo-test-sandbox/bin/hello - echo aaa | /run/bar-test-sandbox/bin/sed -e 's/a/b/g' - ''; - in lib.singleton (pkgs.vuizvui.games.buildSandbox testProgram { - paths.required = [ "/home/foo/existing" ]; - paths.wanted = [ "/home/foo/nonexisting" ]; - paths.runtimeVars = [ "COLLECT_ME" ]; - }); - users.users.foo.isNormalUser = true; - }; - - testScript = '' - $machine->waitForUnit('multi-user.target'); - $machine->succeed('su - -c test-sandbox foo >&2'); - - $machine->succeed('test -d /home/foo/existing'); - $machine->succeed('grep -qF foo /home/foo/existing/bar'); - $machine->fail('test -d /home/foo/nonexisting'); - ''; -} diff --git a/tests/sandbox.nix b/tests/sandbox.nix new file mode 100644 index 00000000..98d29870 --- /dev/null +++ b/tests/sandbox.nix @@ -0,0 +1,42 @@ +{ + name = "sandbox"; + + machine = { pkgs, lib, ... }: { + nixpkgs.config.vuizvui.games = {}; + system.activationScripts.inject-link = '' + ln -svf ${pkgs.hello} /run/foo-test-sandbox + ln -svf ${pkgs.gnused} /run/bar-test-sandbox + ln -svf ${pkgs.gnugrep} /run/baz-test-sandbox + ''; + environment.sessionVariables.COLLECT_ME = [ + "/run/foo-test-sandbox" + "/run/bar-test-sandbox" + "/run/baz-test-sandbox" + ]; + environment.systemPackages = let + testProgram = pkgs.writeScriptBin "test-sandbox" '' + #!${pkgs.stdenv.shell} -ex + ! echo foo | grep -qF foo + export PATH=/run/baz-test-sandbox/bin + echo foo > /home/foo/existing/bar + test ! -d /home/foo/nonexisting + /run/foo-test-sandbox/bin/hello + echo aaa | /run/bar-test-sandbox/bin/sed -e 's/a/b/g' + ''; + in lib.singleton (pkgs.vuizvui.games.buildSandbox testProgram { + paths.required = [ "/home/foo/existing" ]; + paths.wanted = [ "/home/foo/nonexisting" ]; + paths.runtimeVars = [ "COLLECT_ME" ]; + }); + users.users.foo.isNormalUser = true; + }; + + testScript = '' + $machine->waitForUnit('multi-user.target'); + $machine->succeed('su - -c test-sandbox foo >&2'); + + $machine->succeed('test -d /home/foo/existing'); + $machine->succeed('grep -qF foo /home/foo/existing/bar'); + $machine->fail('test -d /home/foo/nonexisting'); + ''; +} -- cgit 1.4.1