актализация примера yaml конфига для последних правок кода
This commit is contained in:
parent
cf413dfea0
commit
1aa23674fc
|
|
@ -6,6 +6,12 @@ service:
|
|||
restart_backoff_seconds: 0.5
|
||||
restart_backoff_max_seconds: 5.0
|
||||
join_timeout_seconds: 2.0
|
||||
north_bridge:
|
||||
enabled: true
|
||||
host: 127.0.0.1
|
||||
port: 8765
|
||||
queue_maxsize: 1024
|
||||
session_idle_timeout_seconds: 30.0
|
||||
cache:
|
||||
enabled: true
|
||||
ttl_seconds: 300
|
||||
|
|
@ -15,12 +21,12 @@ adapters:
|
|||
- kind: file
|
||||
config:
|
||||
adapter:
|
||||
adapter_id: file-polling-json
|
||||
name: File Polling JSON
|
||||
adapter_id: file-events
|
||||
name: File Events Stream
|
||||
connection:
|
||||
type: file
|
||||
file:
|
||||
path: .tmp/file_polling_input.json
|
||||
path: .tmp/file_events.log
|
||||
acquisition:
|
||||
trigger:
|
||||
kind: poll
|
||||
|
|
@ -29,13 +35,13 @@ adapters:
|
|||
detection:
|
||||
kind: blind
|
||||
fetch:
|
||||
kind: single
|
||||
kind: stream
|
||||
batch_size: 1
|
||||
progress:
|
||||
kind: none
|
||||
parsing:
|
||||
kind: json
|
||||
content_type: application/json
|
||||
kind: line
|
||||
encoding: utf-8
|
||||
validation:
|
||||
mode: stub
|
||||
prefilter:
|
||||
|
|
@ -49,25 +55,69 @@ adapters:
|
|||
mode: stub
|
||||
observability:
|
||||
sink: in_memory
|
||||
namespace: skeleton.file_polling_json_runtime
|
||||
namespace: skeleton.file_events_runtime
|
||||
wrapper:
|
||||
path: ""
|
||||
- kind: wpa_supplicant
|
||||
config:
|
||||
adapter:
|
||||
adapter_id: wpa-status
|
||||
name: WPA Status Snapshot
|
||||
adapter_id: wpa-ctrl-event
|
||||
name: WPA Ctrl Event Stream
|
||||
connection:
|
||||
type: file
|
||||
file:
|
||||
path: .tmp/wpa_status.txt
|
||||
path: .tmp/wpa_ctrl_event.log
|
||||
acquisition:
|
||||
trigger:
|
||||
kind: poll
|
||||
interval_seconds: 1
|
||||
kind: event
|
||||
run_immediately: true
|
||||
detection:
|
||||
kind: blind
|
||||
fetch:
|
||||
kind: stream
|
||||
batch_size: 1
|
||||
progress:
|
||||
kind: none
|
||||
parsing:
|
||||
kind: text
|
||||
content_type: text/plain
|
||||
validation:
|
||||
mode: stub
|
||||
prefilter:
|
||||
mode: stub
|
||||
marking:
|
||||
mode: stub
|
||||
export:
|
||||
mode: bridge
|
||||
destination: stdout
|
||||
commands:
|
||||
mode: stub
|
||||
observability:
|
||||
sink: in_memory
|
||||
namespace: skeleton.wpa_ctrl_event_runtime
|
||||
wrapper:
|
||||
path: ""
|
||||
wpa_source:
|
||||
channel: ctrl_event
|
||||
interface_name: wlp3s0
|
||||
ctrl_socket_dir: /run/wpa_supplicant
|
||||
content_type: text/plain
|
||||
payload_kind: text
|
||||
- kind: wpa_supplicant
|
||||
config:
|
||||
adapter:
|
||||
adapter_id: wpa-ctrl-iface
|
||||
name: WPA Ctrl Iface Control
|
||||
connection:
|
||||
type: file
|
||||
file:
|
||||
path: .tmp/wpa_ctrl_iface.log
|
||||
acquisition:
|
||||
trigger:
|
||||
kind: manual
|
||||
run_immediately: false
|
||||
detection:
|
||||
kind: blind
|
||||
fetch:
|
||||
kind: single
|
||||
batch_size: 1
|
||||
|
|
@ -89,28 +139,76 @@ adapters:
|
|||
mode: stub
|
||||
observability:
|
||||
sink: in_memory
|
||||
namespace: skeleton.wpa_status
|
||||
namespace: skeleton.wpa_ctrl_iface_runtime
|
||||
wrapper:
|
||||
path: ""
|
||||
wpa_source:
|
||||
channel: status
|
||||
path: .tmp/wpa_status.txt
|
||||
channel: ctrl_iface
|
||||
interface_name: wlp3s0
|
||||
ctrl_socket_dir: /run/wpa_supplicant
|
||||
receive_command: STATUS
|
||||
receive_arguments: []
|
||||
content_type: text/plain
|
||||
payload_kind: text
|
||||
# Application command example for the same interface, separate from
|
||||
# acquisition:
|
||||
# command_request:
|
||||
# name: SCAN
|
||||
# metadata:
|
||||
# interface_name: wlan0
|
||||
# ctrl_socket_dir: /run/wpa_supplicant
|
||||
# Live control socket examples:
|
||||
# ctrl_iface:
|
||||
# channel: ctrl_iface
|
||||
# interface_name: wlan0
|
||||
# ctrl_socket_dir: /run/wpa_supplicant
|
||||
#
|
||||
# ctrl_event:
|
||||
# channel: ctrl_event
|
||||
# interface_name: wlan0
|
||||
# ctrl_socket_dir: /run/wpa_supplicant
|
||||
- kind: d-bus
|
||||
config:
|
||||
adapter:
|
||||
adapter_id: wpa-dbus-branch
|
||||
name: WPA D-Bus Branch Stream
|
||||
connection:
|
||||
type: d-bus
|
||||
dbus:
|
||||
bus_name: fi.w1.wpa_supplicant1
|
||||
object_path: /fi/w1/wpa_supplicant1
|
||||
interface: fi.w1.wpa_supplicant1
|
||||
member: GetInterface
|
||||
timeout_seconds: 2.0
|
||||
acquisition:
|
||||
trigger:
|
||||
kind: event
|
||||
run_immediately: true
|
||||
detection:
|
||||
kind: blind
|
||||
fetch:
|
||||
kind: stream
|
||||
batch_size: 1
|
||||
progress:
|
||||
kind: none
|
||||
parsing:
|
||||
kind: json
|
||||
content_type: application/json
|
||||
validation:
|
||||
mode: stub
|
||||
prefilter:
|
||||
mode: stub
|
||||
marking:
|
||||
mode: stub
|
||||
export:
|
||||
mode: bridge
|
||||
destination: stdout
|
||||
commands:
|
||||
mode: stub
|
||||
observability:
|
||||
sink: in_memory
|
||||
namespace: skeleton.wpa_dbus_branch_runtime
|
||||
wrapper:
|
||||
path: ""
|
||||
dbus_source:
|
||||
interface_name: wlp3s0
|
||||
monitored_ssid: demo-net
|
||||
filter_by_monitored_ssid: false
|
||||
signal_mode: branch
|
||||
scan_profile:
|
||||
bands:
|
||||
- name: 2.4ghz
|
||||
frequencies_mhz: [2412, 2437, 2462]
|
||||
channel_width_mhz: 20
|
||||
passive: false
|
||||
- name: 5ghz
|
||||
frequencies_mhz: [5180, 5200, 5220]
|
||||
channel_width_mhz: 80
|
||||
passive: true
|
||||
command_target:
|
||||
object_path: /fi/w1/wpa_supplicant1
|
||||
interface: fi.w1.wpa_supplicant1
|
||||
member: GetInterface
|
||||
|
|
|
|||
|
|
@ -25,6 +25,30 @@ def test_legacy_single_adapter_config_remains_supported() -> None:
|
|||
assert config.adapters[0].config.connection.file is not None
|
||||
|
||||
|
||||
def test_daemon_multi_adapter_example_loads_live_event_sources() -> None:
|
||||
config = load_application_config(
|
||||
"src/app/application/examples/daemon_multi_adapter.yaml"
|
||||
)
|
||||
|
||||
assert config.service.name == "wf-agent3"
|
||||
assert config.north_bridge.enabled is True
|
||||
assert config.north_bridge.host == "127.0.0.1"
|
||||
assert config.north_bridge.port == 8765
|
||||
assert [adapter.kind for adapter in config.adapters] == [
|
||||
AdapterKind.FILE,
|
||||
AdapterKind.WPA_SUPPLICANT,
|
||||
AdapterKind.WPA_SUPPLICANT,
|
||||
AdapterKind.DBUS,
|
||||
]
|
||||
assert config.adapters[0].config.acquisition.fetch.kind.value == "stream"
|
||||
assert config.adapters[1].wpa_source is not None
|
||||
assert config.adapters[1].wpa_source.channel.value == "ctrl_event"
|
||||
assert config.adapters[2].wpa_source is not None
|
||||
assert config.adapters[2].wpa_source.channel.value == "ctrl_iface"
|
||||
assert config.adapters[3].dbus_source is not None
|
||||
assert config.adapters[3].dbus_source.signal_mode is DbusSignalMode.BRANCH
|
||||
|
||||
|
||||
def test_multi_adapter_config_loads_mixed_kinds() -> None:
|
||||
config = ApplicationConfigLoader().load_text(
|
||||
dedent(
|
||||
|
|
|
|||
Loading…
Reference in New Issue