Skip to content

Commit 8efd6cd

Browse files
authored
test: add python-tuf v3.0.0 support (#515)
tests: add python-tuf 3.0.0 support Signed-off-by: Radoslav Dimitrov <[email protected]>
1 parent 9774d79 commit 8efd6cd

File tree

25 files changed

+240
-240
lines changed

25 files changed

+240
-240
lines changed

client/python_interop/python_interop_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (InteropSuite) TestGoClientPythonGenerated(c *C) {
4343
// start file server
4444
cwd, err := os.Getwd()
4545
c.Assert(err, IsNil)
46-
testDataDir := filepath.Join(cwd, "testdata", "python-tuf-v2.0.0")
46+
testDataDir := filepath.Join(cwd, "testdata", "python-tuf-v3.0.0")
4747
addr, cleanup := startFileServer(c, testDataDir)
4848
defer cleanup()
4949

@@ -145,7 +145,7 @@ func (InteropSuite) TestPythonClientGoGenerated(c *C) {
145145
c.Assert(os.WriteFile(filepath.Join(currDir, "root.json"), rootJSON, 0644), IsNil)
146146

147147
args := []string{
148-
filepath.Join(cwd, "testdata", "python-tuf-v2.0.0", "client.py"),
148+
filepath.Join(cwd, "testdata", "python-tuf-v3.0.0", "client.py"),
149149
"--repo=http://" + addr + "/" + name,
150150
}
151151
for path := range files {
@@ -204,7 +204,7 @@ func (InteropSuite) TestPythonClientGoGeneratedNullDelegations(c *C) {
204204
c.Assert(os.WriteFile(filepath.Join(currDir, "root.json"), rootJSON, 0644), IsNil)
205205

206206
args := []string{
207-
filepath.Join(cwd, "testdata", "python-tuf-v2.0.0", "client.py"),
207+
filepath.Join(cwd, "testdata", "python-tuf-v3.0.0", "client.py"),
208208
"--repo=http://" + addr + "/" + name,
209209
}
210210
for path := range files {

client/python_interop/testdata/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PYTHON_TUF=python-tuf-v2.0.0
1+
PYTHON_TUF=python-tuf-v3.0.0
22

33
all:
44
docker build -t tuf-gen ./$(PYTHON_TUF)

client/python_interop/testdata/python-tuf-v2.0.0/with-consistent-snapshot/repository/metadata/1.root.json

Lines changed: 0 additions & 71 deletions
This file was deleted.

client/python_interop/testdata/python-tuf-v2.0.0/with-consistent-snapshot/repository/metadata/1.snapshot.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

client/python_interop/testdata/python-tuf-v2.0.0/with-consistent-snapshot/repository/metadata/timestamp.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

client/python_interop/testdata/python-tuf-v2.0.0/without-consistent-snapshot/repository/metadata/1.root.json

Lines changed: 0 additions & 71 deletions
This file was deleted.

client/python_interop/testdata/python-tuf-v2.0.0/without-consistent-snapshot/repository/metadata/snapshot.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

client/python_interop/testdata/python-tuf-v2.0.0/without-consistent-snapshot/repository/metadata/timestamp.json

Lines changed: 0 additions & 19 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM python:3.10
22

33
RUN apt-get update && apt-get install -y libsodium-dev tree
4-
RUN pip install -U pip && pip install 'securesystemslib[crypto,pynacl]==0.25.0' 'tuf==v2.0.0'
4+
RUN pip install -U pip && pip install 'securesystemslib[crypto,pynacl]==0.28.0' 'tuf==v3.0.0'
55

66
ADD generate.py generate.sh /
77
CMD /generate.sh

client/python_interop/testdata/python-tuf-v2.0.0/client.py renamed to client/python_interop/testdata/python-tuf-v3.0.0/client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
from typing import List
1212
from pathlib import Path
1313

14-
import tuf.api
15-
1614
from tuf.ngclient import Updater
1715

1816

@@ -35,7 +33,8 @@ def update_client(repo: str, targets: List[str]):
3533

3634

3735
def parse_arguments():
38-
parser = argparse.ArgumentParser(description="Retrieve file from TUF repository.")
36+
parser = argparse.ArgumentParser(
37+
description="Retrieve file from TUF repository.")
3938

4039
parser.add_argument(
4140
"-r",

0 commit comments

Comments
 (0)