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