features/workers/monitor_worker.featureRunning behat features/workers/monitor_worker.feature results in:
@rugged @workers @monitor-worker
Feature: A worker to dispatch `add-targets` tasks based on monitoring a directory for target files.
In order to allow a packaging pipeline not to hold credentials for the task queue,
As a TUF administrator
I need to ensure that a monitor worker can check a shared directory and dispatch `add-targets` tasks.
Background:
Given I reset Rugged
Scenario: Send a basic ping/echo message.
When I run the Rugged command "rugged echo --worker=monitor-worker --timeout=1"
Then I should get:
"""
Sending monitor-worker Ping!...
Done. Response was: monitor-worker PONG: Ping!
"""
Scenario: Retrieve worker logs.
Given I run the Rugged command "rugged echo --worker=monitor-worker --timeout=1"
When I run the Rugged command "rugged logs --worker=monitor-worker --limit=0"
Then I should get:
"""
monitor-worker received echo task: Ping!
"""
Scenario: Verify that monitor-worker has proper filesystem permissions.
When I run the Rugged command "rugged check-monitor"
Then I should get:
"""
Monitor worker has read access to incoming-targets directory: `/var/rugged/incoming_targets`
Monitor worker has write access to incoming-targets directory: `/var/rugged/incoming_targets`
Monitor worker has read access to post-to-tuf directory: `/opt/post_to_tuf`
Monitor worker has write access to post-to-tuf directory: `/opt/post_to_tuf`
"""
When I run the Rugged command "rugged logs --worker=monitor-worker --limit=0"
Then I should get:
"""
Received check-monitor task.
Monitor worker has read access to incoming-targets directory: `/var/rugged/incoming_targets`
Monitor worker has write access to incoming-targets directory: `/var/rugged/incoming_targets`
Monitor worker has read access to post-to-tuf directory: `/opt/post_to_tuf`
Monitor worker has write access to post-to-tuf directory: `/opt/post_to_tuf`
"""
3 scenarios (3 passed)
12 steps (12 passed)