nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 packaging,
6 pytestCheckHook,
7 scapy,
8 setuptools,
9}:
10
11buildPythonPackage rec {
12 pname = "boiboite-opener-framework";
13 version = "1.2.1";
14 pyproject = true;
15
16 src = fetchFromGitHub {
17 owner = "Orange-Cyberdefense";
18 repo = "bof";
19 tag = version;
20 hash = "sha256-atKqHRX24UjF/9Dy0aYXAN+80nBJKCd07FmaR5Vl1q4=";
21 };
22
23 pythonRelaxDeps = [ "scapy" ];
24
25 build-system = [ setuptools ];
26
27 dependencies = [
28 packaging
29 scapy
30 ];
31
32 nativeCheckInputs = [ pytestCheckHook ];
33
34 preCheck = ''
35 export HOME=$(mktemp -d)
36 '';
37
38 # Race condition, https://github.com/secdev/scapy/pull/4558
39 # pythonImportsCheck = [ "bof" ];
40
41 disabledTests = [
42 # Tests are using netcat and cat to do UDP connections
43 "test_0101_knxnet_instantiate"
44 "test_0101_modbusnet_instantiate"
45 "test_0102_knxnet_connect"
46 "test_0102_modbusnet_connect"
47 "test_0201_knxnet_send_knxpacket"
48 "test_0201_modbus_send_modbuspacket"
49 "test_0201_udp_send_str_bytes"
50 "test_0202_knxnet_send_knxpacket"
51 "test_0202_modbus_send_modbuspacket"
52 "test_0202_udp_send_receive"
53 "test_0203_knxnet_send_raw"
54 "test_0203_modbus_send_raw"
55 "test_0203_send_receive_timeout"
56 "test_0204_knxnet_receive"
57 "test_0204_modbus_receive"
58 "test_0204_multicast_error_handling"
59 "test_0205_broadcast_error_handling"
60 "test_0301_pndcp_device_raise"
61 "test_0301_tcp_instantiate"
62 "test_0302_tcp_connect"
63 "test_0303_tcp_connect_bad_addr"
64 "test_0304_tcp_connect_bad_port"
65 "test_0401_tcp_send_str_bytes"
66 "test_0402_tcp_send_receive"
67 "test_0802_search_valid"
68 ];
69
70 meta = {
71 description = "Testing framework for industrial protocols implementations and devices";
72 homepage = "https://github.com/Orange-Cyberdefense/bof";
73 changelog = "https://github.com/Orange-Cyberdefense/bof/releases/tag/${version}";
74 license = lib.licenses.gpl3Only;
75 maintainers = with lib.maintainers; [ fab ];
76 platforms = lib.platforms.linux;
77 };
78}