Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: check publishing of telemetry data whilst mapper is down #3187

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions tests/RobotFramework/tests/mqtt/offline_publishing.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
*** Settings ***
Resource ../../resources/common.resource
Library ThinEdgeIO
Library Cumulocity

Test Setup Setup Test
Test Teardown Get Logs


*** Test Cases ***
Publish event whilst mapper is down
[Documentation] The mapper should publish the event to the cloud when it comes back online
${event_type}= Get Random Name
Stop Service tedge-mapper-c8y
Execute Command tedge mqtt pub -q 1 te/device/main///e/${event_type} '{"text":"test message"}'
Start Service tedge-mapper-c8y
Cumulocity.Device Should Have Event/s type=${event_type} expected_text=test message


*** Keywords ***
Setup Test
${DEVICE_SN}= Setup
Set Suite Variable $DEVICE_SN
Device Should Exist ${DEVICE_SN}
19 changes: 13 additions & 6 deletions tests/images/debian-systemd/debian-systemd.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,24 @@ RUN apt-get -y update \
net-tools \
# json tools (for tests)
jq \
jo
jo \
# mosquitto (default version used by Debian, see below for more details)
mosquitto \
mosquitto-clients

# Note: Avoid using mosquitto 2.0.18 due to a session persistence bug when using `per_listener_settings true
# Only comment out the custom install logic to make it easier to re-enable once the bug is resolved
# See https://github.com/thin-edge/thin-edge.io/issues/3185 for more details
# Install more recent version of mosquitto >= 2.0.18 from debian backports to avoid mosquitto following bugs:
# The mosquitto repo can't be used as it does not included builds for arm64/aarch64 (only amd64 and armhf)
# * https://github.com/eclipse/mosquitto/issues/2604 (2.0.11)
# * https://github.com/eclipse/mosquitto/issues/2634 (2.0.15)
RUN sh -c "echo 'deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian bookworm-backports main' > /etc/apt/sources.list.d/debian-bookworm-backports.list" \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install -t bookworm-backports \
mosquitto \
mosquitto-clients
# * https://github.com/eclipse/mosquitto/issues/2618 (2.0.18)
#RUN sh -c "echo 'deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian bookworm-backports main' > /etc/apt/sources.list.d/debian-bookworm-backports.list" \
# && apt-get update \
# && DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install -t bookworm-backports \
# mosquitto \
# mosquitto-clients

# Remove unnecessary systemd services
RUN rm -f /lib/systemd/system/multi-user.target.wants/* \
Expand Down