features/tuf/hashed_bins.expiry.featureRunning behat features/tuf/hashed_bins.expiry.feature results in:
@rugged @gitlab-155 @refresh-expiry-hashed-bins @hashed-bins
Feature: Command to refresh metadata expiry periods.
In order to keep a TUF systems operating and performant,
As a TUF administrator
I need to ensure that hashed bin metadata expiry periods can be refreshed.
Background:
Given I reset Rugged
Scenario: Expiring hashed bins metadata gets refreshed.
Given I run "sudo cp features/fixtures/config/expiry/short_targets_expiry_with_hashed_bins.yaml /var/rugged/.config/rugged/config.yaml"
And I run the Rugged command "rugged pause-processing"
And I run the Rugged command "rugged generate-keys --local"
And I run the Rugged command "rugged initialize --local"
And I record the expiry timestamp from "targets.json"
And I record the expiry timestamp from "bins.json"
And I record the expiry timestamp from "bin_0.json"
And I record the expiry timestamp from "bin_f.json"
When I run the Rugged command "rugged validate"
Then I should get:
"""
Metadata for the 'targets' role is valid.
Metadata for the 'bins' role is valid.
Metadata for the 'bin_0' role is valid.
Metadata for the 'bin_f' role is valid.
"""
Given I wait "6" seconds
When I try to run the Rugged command "rugged validate"
Then I should get:
"""
error: ExpiredMetadataError thrown in validate_targets: targets.json is expired
error: Metadata for the 'targets' role is not valid.
"""
And the expiry timestamp from "targets.json" has not changed
And the expiry timestamp from "bins.json" has not changed
And the expiry timestamp from "bin_0.json" has not changed
And the expiry timestamp from "bin_f.json" has not changed
When I run the Rugged command "rugged --debug refresh-expiry"
Then I should get:
"""
Preparing to refresh metadata expiry periods.
Fetching expiring metadata from workers.
debug: Fetching expiring metadata from targets-worker.
debug: Fetched expiring metadata from targets-worker.
debug: Fetching expiring metadata from snapshot-worker.
debug: Fetched expiring metadata from snapshot-worker.
debug: Fetching expiring metadata from timestamp-worker.
debug: Fetched expiring metadata from timestamp-worker.
Expiring metadata from targets-worker:
targets.json
bins.json
bin_0.json
bin_f.json
Refreshed targets metadata expiry period.
Refreshed bins metadata expiry period.
Refreshed bin_0 metadata expiry period.
Refreshed bin_f metadata expiry period.
Updated snapshot metadata.
Updated timestamp metadata.
"""
'bins.json' was not found in command output:
------
debug: rugged_cli invoked
Preparing to refresh metadata expiry periods.
Fetching expiring metadata from workers.
debug: Fetching expiring metadata from targets-worker.
debug: Initializing connection to RabbitMQ.
debug: Fetched expiring metadata from targets-worker.
debug: Fetching expiring metadata from snapshot-worker.
debug: Initializing connection to RabbitMQ.
debug: Fetched expiring metadata from snapshot-worker.
debug: Fetching expiring metadata from timestamp-worker.
debug: Initializing connection to RabbitMQ.
debug: Fetched expiring metadata from timestamp-worker.
Expiring metadata from targets-worker:
targets.json
Expiring metadata from snapshot-worker:
No expiring metadata.
Expiring metadata from timestamp-worker:
No expiring metadata.
Dispatching task to refresh expiring metadata on targets-worker.
debug: Initializing connection to RabbitMQ.
Refreshed targets metadata expiry period.
debug: Initializing connection to RabbitMQ.
Updated snapshot metadata.
debug: Initializing connection to RabbitMQ.
Updated timestamp metadata.
debug: Peak memory allocation: 2,667.47KiB
debug: Final memory allocation: 2,494.72KiB
------
(Exception)
Then the expiry timestamp from "targets.json" has changed
Then the expiry timestamp from "bins.json" has changed
Then the expiry timestamp from "bin_0.json" has changed
Then the expiry timestamp from "bin_f.json" has changed
When I run the Rugged command "rugged validate"
Then I should get:
"""
Metadata for the 'targets' role is valid.
Metadata for the 'bins' role is valid.
Metadata for the 'bin_0' role is valid.
Metadata for the 'bin_f' role is valid.
"""
--- Failed scenarios:
features/tuf/hashed_bins.expiry.feature:16
1 scenario (1 failed)
26 steps (19 passed, 1 failed, 6 skipped)