diff --git a/nixos/lib/default.nix b/nixos/lib/default.nix new file mode 100644 index 0000000000000000000000000000000000000000..3ebaf60b7d536589d46a745d2945cbef96b2b554 --- /dev/null +++ b/nixos/lib/default.nix @@ -0,0 +1,6 @@ +{ callPackage }: +{ + /* A library of tools useful for writing tests with Nix. + */ + testing = callPackage ./testing.nix { }; +} diff --git a/nixos/lib/testing.nix b/nixos/lib/testing.nix index de68dc1f92060912bcc4f7781501e5d36bd49b89..d89717a0a76f93bb6062ad63c6cfdbb91c12c746 100644 --- a/nixos/lib/testing.nix +++ b/nixos/lib/testing.nix @@ -1,5 +1,5 @@ +{ ...}: { - /* Returns a string that runs tests from the Python code at the given path. The Python code is loaded using *execfile* and the *test* global it diff --git a/nixos/pkgs/default.nix b/nixos/pkgs/default.nix index bfc30b36101c220434606832127a7e8ca0a70490..435095f7890b7ac41afaebe050a756c4b4887641 100644 --- a/nixos/pkgs/default.nix +++ b/nixos/pkgs/default.nix @@ -5,6 +5,8 @@ # pkgs.callPackage ./nixos/pkgs {buildPlatform, hostPlatform, callPackage}: { + lib = callPackage ../lib {}; + leasereport = callPackage ./leasereport {}; # `privatestorage` is a derivation with a good Tahoe+ZKAP environment # that is exposed by ZKAPAuthorizer. diff --git a/nixos/tests/private-storage.nix b/nixos/tests/private-storage.nix index d6fdfaf93fd656e936f2aa5936298dbfe0557c1d..eaff1ed5320607e6aabc94226804aea4b7186b0a 100644 --- a/nixos/tests/private-storage.nix +++ b/nixos/tests/private-storage.nix @@ -1,6 +1,6 @@ { pkgs }: let - makeTestScript = (import ../lib/testing.nix).makeTestScript; + ourpkgs = pkgs.callPackage ../pkgs { }; sshPrivateKey = ./probeuser_ed25519; sshPublicKey = ./probeuser_ed25519.pub; @@ -154,7 +154,7 @@ in { }; # Test the machines with a Python program. - testScript = makeTestScript { + testScript = ourpkgs.lib.testing.makeTestScript { testpath = ./test_privatestorage.py; kwargs = { inherit sshPrivateKey pemFile introducerPort introducerFURL issuerURL ristrettoPublicKey voucher; diff --git a/nixos/tests/tahoe.nix b/nixos/tests/tahoe.nix index da6c5ee18246bceeb3921377bd6875489354ac70..a007e65efd2d6bee8ab4adba9df3cb2901f53526 100644 --- a/nixos/tests/tahoe.nix +++ b/nixos/tests/tahoe.nix @@ -1,5 +1,6 @@ +{ pkgs }: let - makeTestScript = (import ../lib/testing.nix).makeTestScript; + ourpkgs = pkgs.callPackage ../pkgs { }; in { nodes = { @@ -25,7 +26,7 @@ in }; }; }; - testScript = makeTestScript { + testScript = ourpkgs.lib.testing.makeTestScript { testpath = ./test_tahoe.py; }; }