lib/test/container-test-driver: Fix extraPythonPackages support
Fix `extraPythonPackages` support in the container test driver. It triggered the following warning from `nixpkgs`: ``` python3Packages = throw "do not use python3Packages when building Python packages, specify each used package as a separate argument"; # do not remove ``` The following `callPackage` usage triggered the `throw`: ``` hostPackages.python3.pkgs.callPackage ``` The change to a regular `callPackage` i`nvocation fixes this issue. Added a container test with a popular package to ensure compatibility in the future. Closes: #5459
This commit is contained in:
@@ -97,6 +97,7 @@ in
|
||||
nixos-test-container = self.clanLib.test.containerTest ./container nixosTestArgs;
|
||||
nixos-test-user-firewall-iptables = self.clanLib.test.containerTest ./user-firewall/iptables.nix nixosTestArgs;
|
||||
nixos-test-user-firewall-nftables = self.clanLib.test.containerTest ./user-firewall/nftables.nix nixosTestArgs;
|
||||
nixos-test-extra-python-packages = self.clanLib.test.containerTest ./test-extra-python-packages nixosTestArgs;
|
||||
|
||||
service-dummy-test = import ./service-dummy-test nixosTestArgs;
|
||||
wireguard = import ./wireguard nixosTestArgs;
|
||||
|
||||
26
checks/test-extra-python-packages/default.nix
Normal file
26
checks/test-extra-python-packages/default.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
(
|
||||
{ ... }:
|
||||
{
|
||||
name = "test-extra-python-packages";
|
||||
|
||||
extraPythonPackages = ps: [ ps.numpy ];
|
||||
|
||||
nodes.machine =
|
||||
{ ... }:
|
||||
{
|
||||
networking.hostName = "machine";
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
import numpy as np
|
||||
|
||||
start_all()
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
|
||||
# Test availability of numpy
|
||||
arr = np.array([1, 2, 3])
|
||||
print(f"Numpy array: {arr}")
|
||||
assert len(arr) == 3
|
||||
'';
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user