8000 Merge pull request #2684 from jku/update-tuf-conformance-to-1.0 · theupdateframework/python-tuf@8b25782 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b25782

Browse files
authored
Merge pull request #2684 from jku/update-tuf-conformance-to-1.0
Update tuf conformance to 1.0
2 parents 8b53382 + 9b2a931 commit 8b25782

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

.github/scripts/conformance-client.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
import os
99
import shutil
1010
import sys
11-
from datetime import datetime, timedelta, timezone
1211

13-
from tuf.ngclient import Updater, UpdaterConfig
12+
from tuf.ngclient import Updater
1413

1514

1615
def init(metadata_dir: str, trusted_root: str) -> None:
@@ -21,23 +20,13 @@ def init(metadata_dir: str, trusted_root: str) -> None:
2120
print(f"python-tuf test client: Initialized repository in {metadata_dir}")
2221

2322

24-
def refresh(
25-
metadata_url: str,
26-
metadata_dir: str,
27-
days_in_future: str,
28-
max_root_rotations: int,
29-
) -> None:
23+
def refresh(metadata_url: str, metadata_dir: str) -> None:
3024
"""Refresh local metadata from remote"""
3125

3226
updater = Updater(
3327
metadata_dir,
3428
metadata_url,
35-
config=UpdaterConfig(max_root_rotations=int(max_root_rotations)),
3629
)
37-
if days_in_future != "0":
38-
day_int = int(days_in_future)
39-
day_in_future = datetime.now(timezone.utc) + timedelta(days=day_int)
40-
updater._trusted_set.reference_time = day_in_future # noqa: SLF001
4130
updater.refresh()
4231
print(f"python-tuf test client: Refreshed metadata in {metadata_dir}")
4332

@@ -56,7 +45,6 @@ def download_target(
5645
metadata_url,
5746
download_dir,
5847
target_base_url,
59-
config=UpdaterConfig(prefix_targets_with_hash=False),
6048
)
6149
target_info = updater.get_targetinfo(target_name)
6250
if not target_info:
@@ -73,10 +61,6 @@ def main() -> int:
7361
parser.add_argument("--target-name", required=False)
7462
parser.add_argument("--target-dir", required=False)
7563
parser.add_argument("--target-base-url", required=False)
76-
parser.add_argument("--days-in-future", required=False, default="0")
77-
parser.add_argument(
78-
"--max-root-rotations", required=False, default=32, type=int
79-
)
8064

8165
sub_command = parser.add_subparsers(dest="sub_command")
8266
init_parser = sub_command.add_parser(
@@ -104,8 +88,6 @@ def main() -> int:
10488
refresh(
10589
command_args.metadata_url,
10690
command_args.metadata_dir,
107-
command_args.days_in_future,
108-
command_args.max_root_rotations,
10991
)
11092
elif command_args.sub_command == "download":
11193
download_target(

.github/workflows/conformance.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
on:
2-
# manual dispatch only while the conformance test suite is under rapid development
2+
push:
3+
branches:
4+
- develop
5+
pull_request:
36
workflow_dispatch:
47

8+
permissions:
9+
contents: read
10+
511
name: Conformance test
612
jobs:
713
conformance:
@@ -11,6 +17,6 @@ jobs:
1117
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
1218

1319
- name: Run test suite
14-
uses: theupdateframework/tuf-conformance@main
20+
uses: theupdateframework/tuf-conformance@5ae68349ec6b85ae443c110d967ac21807f1cdb7 # v1.0.0
1521
with:
1622
entrypoint: ".github/scripts/conformance-client.py"

0 commit comments

Comments
 (0)
0