Skip to content

Commit 21c84fe

Browse files
reubenmillerdidier-wenzek
authored andcommitted
isolate journalctl flows to avoid flooding broker with too many messages
Signed-off-by: reubenmiller <reuben.d.miller@gmail.com>
1 parent 2da05fe commit 21c84fe

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

tests/RobotFramework/tests/tedge_flows/tedge_flows.robot

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Library JSONLibrary
33
Library ThinEdgeIO
44

55
Suite Setup Custom Setup
6-
Suite Teardown Get Logs
6+
Test Teardown Get Logs
77

88
Test Tags theme:tedge_flows
99

@@ -98,17 +98,21 @@ Running tedge-flows
9898

9999
Consuming messages from a process stdout
100100
# Assuming the flow journalctl-follow.toml has been properly installed
101+
Install Journalctl Flow journalctl-follow.toml
101102
${test_start} Get Unix Timestamp
102103
Restart Service tedge-agent
103-
${messages} Should Have MQTT Messages topic=log/journalctl-follow minimum=1 date_from=${test_start}
104+
${messages} Should Have MQTT Messages topic=log/journalctl-follow minimum=10 date_from=${test_start}
104105
Should Not Be Empty ${messages[0]} msg=Output should not be empty lines
106+
[Teardown] Uninstall Journalctl Flow journalctl-follow.toml
105107

106108
Consuming messages from a process stdout, periodically
107109
# Assuming the flow journalctl-cursor.toml has been properly installed
110+
Install Journalctl Flow journalctl-cursor.toml
108111
${test_start} Get Unix Timestamp
109112
Restart Service tedge-agent
110-
${messages} Should Have MQTT Messages topic=log/journalctl-cursor minimum=10 date_from=${test_start}
113+
${messages} Should Have MQTT Messages topic=log/journalctl-cursor minimum=1 date_from=${test_start}
111114
Should Not Be Empty ${messages[0]} msg=Output should not be empty lines
115+
[Teardown] Uninstall Journalctl Flow journalctl-cursor.toml
112116

113117
Consuming messages from the tail of file
114118
# Assuming the flow tail-named-pipe.toml has been properly installed
@@ -176,6 +180,14 @@ Custom Setup
176180
Copy Configuration Files
177181
ThinEdgeIO.Transfer To Device ${CURDIR}/flows/* /etc/tedge/flows/
178182

183+
Install Journalctl Flow
184+
[Arguments] ${definition_file}
185+
ThinEdgeIO.Transfer To Device ${CURDIR}/journalctl-flows/${definition_file} /etc/tedge/flows/
186+
187+
Uninstall Journalctl Flow
188+
[Arguments] ${definition_file}
189+
Execute Command cmd=rm -f /etc/tedge/flows/${definition_file}
190+
179191
Configure flows
180192
# Required by tail-named-pipe.toml
181193
Execute Command mkfifo /tmp/events

0 commit comments

Comments
 (0)