Fix tests/ to ensure they use the lib attribute introduced in 83ad1c2206710f356d362170402e461422d2ff3b
This commit is contained in:
parent
d246c4b5da
commit
a057ce75e9
4 changed files with 12 additions and 12 deletions
|
|
@ -152,7 +152,7 @@ spec = parallel $ inTestM $ do
|
||||||
runNixDrv
|
runNixDrv
|
||||||
[i|
|
[i|
|
||||||
let
|
let
|
||||||
jail' = jail-nix.extend {
|
jail' = jail-nix.lib.extend {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
bubblewrapPackage = pkgs.writeShellApplication {
|
bubblewrapPackage = pkgs.writeShellApplication {
|
||||||
name = "my-bubblewrap";
|
name = "my-bubblewrap";
|
||||||
|
|
@ -429,7 +429,7 @@ spec = parallel $ inTestM $ do
|
||||||
it "clears all set permissions - including ones set in base permissions" $ do
|
it "clears all set permissions - including ones set in base permissions" $ do
|
||||||
[i|
|
[i|
|
||||||
let
|
let
|
||||||
jail' = jail-nix.extend {
|
jail' = jail-nix.lib.extend {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
basePermissions = c: [
|
basePermissions = c: [
|
||||||
c.base
|
c.base
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ spec = parallel $ inTestM $ do
|
||||||
it "can be imported using callPackage" $ do
|
it "can be imported using callPackage" $ do
|
||||||
[i|
|
[i|
|
||||||
let
|
let
|
||||||
jail-nix-without-flake = pkgs.callPackage <jail-nix> {};
|
jail-nix-without-flake = import <jail-nix> {};
|
||||||
jail-without-flake = jail-nix-without-flake.init pkgs;
|
jail-without-flake = jail-nix-without-flake.lib.init pkgs;
|
||||||
in
|
in
|
||||||
jail-without-flake "hello" pkgs.hello []
|
jail-without-flake "hello" pkgs.hello []
|
||||||
|]
|
|]
|
||||||
|
|
@ -85,7 +85,7 @@ spec = parallel $ inTestM $ do
|
||||||
liftIO $ writeFile secretPath "hunter2"
|
liftIO $ writeFile secretPath "hunter2"
|
||||||
[i|
|
[i|
|
||||||
let
|
let
|
||||||
jail' = jail-nix.extend {
|
jail' = jail-nix.lib.extend {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
basePermissions = c: [
|
basePermissions = c: [
|
||||||
(c.readonly #{toNixString secretPath})
|
(c.readonly #{toNixString secretPath})
|
||||||
|
|
@ -101,7 +101,7 @@ spec = parallel $ inTestM $ do
|
||||||
it "allows overriding the bubblewrap package" $ do
|
it "allows overriding the bubblewrap package" $ do
|
||||||
[i|
|
[i|
|
||||||
let
|
let
|
||||||
jail' = jail-nix.extend {
|
jail' = jail-nix.lib.extend {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
bubblewrapPackage = pkgs.writeShellApplication {
|
bubblewrapPackage = pkgs.writeShellApplication {
|
||||||
name = "my-bubblewrap";
|
name = "my-bubblewrap";
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ spec = parallel $ inTestM $ do
|
||||||
let
|
let
|
||||||
pkgs = import <nixpkgs> { overlays = [ jailOverlay ]; };
|
pkgs = import <nixpkgs> { overlays = [ jailOverlay ]; };
|
||||||
jailOverlay = final: prev:
|
jailOverlay = final: prev:
|
||||||
jail-nix.mkOverlay {
|
jail-nix.lib.mkOverlay {
|
||||||
inherit final prev;
|
inherit final prev;
|
||||||
packages = combinators: with combinators; {
|
packages = combinators: with combinators; {
|
||||||
nodejs = [ (readonly #{toNixString $ tmpDir </> "visible"}) ];
|
nodejs = [ (readonly #{toNixString $ tmpDir </> "visible"}) ];
|
||||||
|
|
@ -53,7 +53,7 @@ spec = parallel $ inTestM $ do
|
||||||
let
|
let
|
||||||
pkgs = import <nixpkgs> { overlays = [ jailOverlay ]; };
|
pkgs = import <nixpkgs> { overlays = [ jailOverlay ]; };
|
||||||
jailOverlay = final: prev:
|
jailOverlay = final: prev:
|
||||||
jail-nix.mkOverlay {
|
jail-nix.lib.mkOverlay {
|
||||||
inherit final prev;
|
inherit final prev;
|
||||||
additionalCombinators = combinators: {
|
additionalCombinators = combinators: {
|
||||||
my-combinator = combinators.readonly #{toNixString $ tmpDir </> "file"};
|
my-combinator = combinators.readonly #{toNixString $ tmpDir </> "file"};
|
||||||
|
|
@ -76,7 +76,7 @@ spec = parallel $ inTestM $ do
|
||||||
let
|
let
|
||||||
pkgs = import <nixpkgs> { overlays = [ jailOverlay ]; };
|
pkgs = import <nixpkgs> { overlays = [ jailOverlay ]; };
|
||||||
jailOverlay = final: prev:
|
jailOverlay = final: prev:
|
||||||
jail-nix.mkOverlay {
|
jail-nix.lib.mkOverlay {
|
||||||
inherit final prev;
|
inherit final prev;
|
||||||
basePermissions = combinators: [
|
basePermissions = combinators: [
|
||||||
(combinators.readonly #{toNixString $ tmpDir </> "file"})
|
(combinators.readonly #{toNixString $ tmpDir </> "file"})
|
||||||
|
|
@ -100,7 +100,7 @@ spec = parallel $ inTestM $ do
|
||||||
let
|
let
|
||||||
pkgs = import <nixpkgs> { overlays = [ jailOverlay ]; };
|
pkgs = import <nixpkgs> { overlays = [ jailOverlay ]; };
|
||||||
jailOverlay = final: prev:
|
jailOverlay = final: prev:
|
||||||
jail-nix.mkOverlay {
|
jail-nix.lib.mkOverlay {
|
||||||
inherit final prev;
|
inherit final prev;
|
||||||
bubblewrapPackage = pkgs.writeShellApplication {
|
bubblewrapPackage = pkgs.writeShellApplication {
|
||||||
name = "my-bubblewrap";
|
name = "my-bubblewrap";
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ runNixDrvWithinVm vmConfig nixDrvExpr = do
|
||||||
};
|
};
|
||||||
script = let
|
script = let
|
||||||
jail-nix = import <jail-nix> {};
|
jail-nix = import <jail-nix> {};
|
||||||
jail = jail-nix.extend { inherit pkgs; suppressExperimentalWarnings = true; };
|
jail = jail-nix.lib.extend { inherit pkgs; suppressExperimentalWarnings = true; };
|
||||||
testToRun = #{nixDrvExpr};
|
testToRun = #{nixDrvExpr};
|
||||||
in ''
|
in ''
|
||||||
(
|
(
|
||||||
|
|
@ -204,7 +204,7 @@ evalNixExpr nixExpr = do
|
||||||
lib = pkgs.lib;
|
lib = pkgs.lib;
|
||||||
sh = script: (pkgs.writeShellApplication { name = "test-script"; text = script; });
|
sh = script: (pkgs.writeShellApplication { name = "test-script"; text = script; });
|
||||||
jail-nix = import <jail-nix> {};
|
jail-nix = import <jail-nix> {};
|
||||||
jail = jail-nix.extend { inherit pkgs; suppressExperimentalWarnings = true; };
|
jail = jail-nix.lib.extend { inherit pkgs; suppressExperimentalWarnings = true; };
|
||||||
in #{nixExpr}
|
in #{nixExpr}
|
||||||
|]
|
|]
|
||||||
liftIO $
|
liftIO $
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue