Skip to content

Commit

Permalink
remove unfinished test that is missing get_target_info feature in client
Browse files Browse the repository at this point in the history
We can re-add it later, but for now the client is missing the get_target_info functionality required to complete this test.

Signed-off-by: Adam Korczynski <[email protected]>
  • Loading branch information
AdamKorcz committed Aug 2, 2024
1 parent c12fdde commit e633429
Showing 1 changed file with 1 addition and 58 deletions.
59 changes: 1 addition & 58 deletions tuf_conformance/test_expiration.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import os
from datetime import timezone
from tuf.api.metadata import (
Timestamp, Snapshot, Root, Targets, Metadata,
DelegatedRole
Timestamp, Snapshot, Root, Targets, Metadata
)

from tuf_conformance.client_runner import ClientRunner
Expand Down Expand Up @@ -162,59 +161,3 @@ def test_timestamp_expired(
# Check that client resisted rollback attack
assert client._files_exist([Root.type])
assert client.version(Timestamp.type) == 1


def test_TestDelegateConsistentSnapshotDisabled(
client: ClientRunner, server: SimulatorServer
) -> None:
# https://github.com/theupdateframework/go-tuf/blob/f1d8916f08e4dd25f91e40139137edb8bf0498f3/metadata/updater/updater_consistent_snapshot_test.go#L97C6-L97C60
init_data, repo = server.new_test(client.test_name)

assert client.init_client(init_data) == 0
client.refresh(init_data)
# Sanity check
assert client._files_exist([Root.type,
Timestamp.type,
Snapshot.type,
Targets.type])

repo.set_root_consistent_snapshot(False)
repo.bump_root_by_one()

# Add 3 delegates for new target
# Target that expires 5 days in the future
new_target = Targets(expires=datetime.datetime.now(timezone.utc)
.replace(microsecond=0)
+ datetime.timedelta(days=5))

delegated_role1 = DelegatedRole(name="role1",
keyids=list(),
threshold=1,
terminating=False,
paths=["*"])
repo.add_delegation(Targets.type,
delegated_role1,
new_target)

delegated_role2 = DelegatedRole(name="..",
keyids=list(),
threshold=1,
terminating=False,
paths=["*"])
repo.add_delegation(Targets.type,
delegated_role2,
new_target)

delegated_role3 = DelegatedRole(name=".",
keyids=list(),
threshold=1,
terminating=False,
paths=["*"])
repo.add_delegation(Targets.type,
delegated_role3,
new_target)
repo.update_snapshot()

assert client.refresh(init_data) == 0

# TODO: Implement this: https://github.com/theupdateframework/go-tuf/blob/f1d8916f08e4dd25f91e40139137edb8bf0498f3/metadata/updater/updater_consistent_snapshot_test.go#L146-L161

0 comments on commit e633429

Please sign in to comment.