Skip to content

Commit

Permalink
RepositorySimulator: Include "refresh" in dump directory name
Browse files Browse the repository at this point in the history
This way it's maybe more obvious that each repository version
is dumped at the time of each client refresh.

Signed-off-by: Jussi Kukkonen <[email protected]>
  • Loading branch information
jku committed Aug 1, 2024
1 parent 4988f2e commit 51daedd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ we can now run the test:
--repository-dump-dir /tmp/test-repos # dump repository contents
# take a look at the repository targets.json that got debug dumped
cat /tmp/test-repos/test_targets_version/1/targets.json
cat /tmp/test-repos/test_targets_version/1/snapshot.json
cat /tmp/test-repos/test_targets_version/refresh-1/targets.json
cat /tmp/test-repos/test_targets_version/refresh-1/snapshot.json
```

The metadata looks as expected (targets version is 7) so we can add a modification to the end of the test:
Expand All @@ -110,8 +110,8 @@ Running the test again results in a second repository version being dumped (each
--repository-dump-dir /tmp/test-repos # dump repository contents
# take a look at targets versions in both snapshot versions that got debug dumped
cat /tmp/test-repos/test_targets_version/1/snapshot.json
cat /tmp/test-repos/test_targets_version/2/snapshot.json
cat /tmp/test-repos/test_targets_version/refresh-1/snapshot.json
cat /tmp/test-repos/test_targets_version/refresh-2/snapshot.json
```

The repository metadata looks as expected (but not spec-compliant) so we can add some asserts for client behaviour now.
Expand Down
2 changes: 1 addition & 1 deletion tuf_conformance/repository_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ def debug_dump(self) -> None:
return

self.dump_version += 1
dest_dir = os.path.join(self.dump_dir, str(self.dump_version))
dest_dir = os.path.join(self.dump_dir, f"refresh-{self.dump_version}")
os.makedirs(dest_dir, exist_ok=True)

for ver in range(1, len(self.signed_roots) + 1):
Expand Down

0 comments on commit 51daedd

Please sign in to comment.