nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 bash,
4 buildPythonPackage,
5 cliff,
6 debtcollector,
7 defusedxml,
8 fetchPypi,
9 fixtures,
10 hacking,
11 jsonschema,
12 netaddr,
13 oslo-concurrency,
14 oslo-config,
15 oslo-log,
16 oslo-serialization,
17 oslo-utils,
18 oslotest,
19 paramiko,
20 pbr,
21 prettytable,
22 python,
23 pyyaml,
24 setuptools,
25 stestr,
26 stevedore,
27 subunit,
28 testscenarios,
29 testtools,
30 urllib3,
31}:
32
33buildPythonPackage rec {
34 pname = "tempest";
35 version = "46.0.0";
36 pyproject = true;
37
38 src = fetchPypi {
39 inherit pname version;
40 hash = "sha256-ddm1OE7BDwDM4T9GIB0+qK8WvU/+aC+FBIGWDm3ObHM=";
41 };
42
43 postPatch = ''
44 substituteInPlace tempest/lib/common/http.py \
45 --replace-fail 'getheaders()' 'headers'
46 '';
47
48 pythonRelaxDeps = [ "defusedxml" ];
49
50 build-system = [ setuptools ];
51
52 dependencies = [
53 cliff
54 debtcollector
55 defusedxml
56 fixtures
57 jsonschema
58 netaddr
59 oslo-concurrency
60 oslo-config
61 oslo-log
62 oslo-serialization
63 oslo-utils
64 paramiko
65 pbr
66 prettytable
67 pyyaml
68 stestr
69 stevedore
70 subunit
71 testscenarios
72 testtools
73 urllib3
74 ];
75
76 nativeCheckInputs = [
77 hacking
78 oslotest
79 stestr
80 ];
81
82 checkPhase = ''
83 # Tests expect these applications available as such.
84 mkdir -p bin
85 export PATH="$PWD/bin:$PATH"
86 printf '#!${bash}/bin/bash\nexec ${python.interpreter} -m tempest.cmd.main "$@"\n' > bin/tempest
87 printf '#!${bash}/bin/bash\nexec ${python.interpreter} -m tempest.cmd.subunit_describe_calls "$@"\n' > bin/subunit-describe-calls
88 chmod +x bin/*
89
90 stestr --test-path tempest/tests run -e <(echo "
91 tempest.tests.lib.cli.test_execute.TestExecute.test_execute_with_prefix
92 ")
93 '';
94
95 pythonImportsCheck = [ "tempest" ];
96
97 meta = {
98 description = "OpenStack integration test suite that runs against live OpenStack cluster and validates an OpenStack deployment";
99 homepage = "https://github.com/openstack/tempest";
100 license = lib.licenses.asl20;
101 mainProgram = "tempest";
102 teams = [ lib.teams.openstack ];
103 };
104}