diff options
author | Symphorien Gibol <symphorien+git@xlumurb.eu> | 2020-11-14 12:00:00 +0000 |
---|---|---|
committer | Symphorien Gibol <symphorien+git@xlumurb.eu> | 2020-11-14 12:00:00 +0000 |
commit | 6fa16462681ec457fda481823f09721499645b46 (patch) | |
tree | 77f09485f95a313f19087c1d8195afbe4fc66dbd /nixos/tests | |
parent | a371c1071161104d329f6a85d922fd92b7cbab63 (diff) | |
download | nixpkgs-6fa16462681ec457fda481823f09721499645b46.tar nixpkgs-6fa16462681ec457fda481823f09721499645b46.tar.gz nixpkgs-6fa16462681ec457fda481823f09721499645b46.tar.bz2 nixpkgs-6fa16462681ec457fda481823f09721499645b46.tar.lz nixpkgs-6fa16462681ec457fda481823f09721499645b46.tar.xz nixpkgs-6fa16462681ec457fda481823f09721499645b46.tar.zst nixpkgs-6fa16462681ec457fda481823f09721499645b46.zip |
nixos/firejail: allow to pass options to firejail
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/firejail.nix | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nixos/tests/firejail.nix b/nixos/tests/firejail.nix index a723cb01664..5f122c3fa94 100644 --- a/nixos/tests/firejail.nix +++ b/nixos/tests/firejail.nix @@ -11,6 +11,10 @@ import ./make-test-python.nix ({ pkgs, ...} : { enable = true; wrappedBinaries = { bash-jailed = "${pkgs.bash}/bin/bash"; + bash-jailed2 = { + executable = "${pkgs.bash}/bin/bash"; + extraArgs = [ "--private=~/firejail-home" ]; + }; }; }; @@ -53,6 +57,11 @@ import ./make-test-python.nix ({ pkgs, ...} : { ) machine.fail("sudo -u alice bash-jailed -c 'cat ~/my-secrets/secret' | grep -q s3cret") + # Test extraArgs + machine.succeed("sudo -u alice mkdir /home/alice/firejail-home") + machine.succeed("sudo -u alice bash-jailed2 -c 'echo test > /home/alice/foo'") + machine.fail("sudo -u alice cat /home/alice/foo") + machine.succeed("sudo -u alice cat /home/alice/firejail-home/foo | grep test") # Test path acl with firejail executable machine.succeed("sudo -u alice firejail -- bash -c 'cat ~/public' | grep -q publ1c") |