Skip to content

Commit

Permalink
make test work for go-tuf
Browse files Browse the repository at this point in the history
enabled by theupdateframework/go-tuf#641

Signed-off-by: Adam Korczynski <[email protected]>
  • Loading branch information
AdamKorcz committed Jun 18, 2024
1 parent 3144072 commit a3e3a4a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
3 changes: 1 addition & 2 deletions clients/go-tuf/cmd/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ func RefreshAndDownloadCmd(targetName, targetBaseUrl, targetDownloadDir, daysInF
if daysInFuture != "0" {
laterDay, _ := strconv.Atoi(daysInFuture)
laterTime := time.Now().AddDate(0, 0, laterDay)
_ = laterTime
//up.trusted.RefTime = laterTime
up.UnsafeSetRefTime(laterTime)
}

// try to build the top-level metadata
Expand Down
6 changes: 2 additions & 4 deletions clients/go-tuf/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ go 1.21
toolchain go1.22.3

require (
github.com/jku/tuf-conformance/clients/go-tuf-metadata v0.0.0-20240430071659-3e958fed3625
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.8.1
github.com/theupdateframework/go-tuf/v2 v2.0.0-20240617113600-41866142c66a
github.com/theupdateframework/go-tuf/v2 v2.0.0-20240618160255-f1d8916f08e4
)

require (
Expand All @@ -17,13 +16,12 @@ require (
github.com/kr/text v0.1.0 // indirect
github.com/letsencrypt/boulder v0.0.0-20230907030200-6d76a0f91e1e // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/rdimitrov/go-tuf-metadata v0.0.0-20230710113934-fe6fba86596c // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.8.0 // indirect
github.com/sigstore/sigstore v1.8.4 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect
Expand Down
10 changes: 2 additions & 8 deletions clients/go-tuf/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ github.com/google/go-containerregistry v0.19.1 h1:yMQ62Al6/V0Z7CqIrrS1iYoA5/oQCm
github.com/google/go-containerregistry v0.19.1/go.mod h1:YCMFNQeeXeLF+dnhhWkqDItx/JSkH01j1Kis4PsjzFI=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jku/tuf-conformance/clients/go-tuf-metadata v0.0.0-20240430071659-3e958fed3625 h1:1wUxv3C6ReYvqYHP5ojn2W72gGdvsWsKkZsaEtE6ngI=
github.com/jku/tuf-conformance/clients/go-tuf-metadata v0.0.0-20240430071659-3e958fed3625/go.mod h1:8TCo1ayA14bLUx2AGF64I4E70dWM1DfPHNT+RVRw4sU=
github.com/jmhodges/clock v1.2.0 h1:eq4kys+NI0PLngzaHEe7AmPT90XMGIEySD1JfV1PDIs=
github.com/jmhodges/clock v1.2.0/go.mod h1:qKjhA7x7u/lQpPB1XAqX1b1lCI/w3/fNuYpI/ZjLynI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
Expand All @@ -45,8 +43,6 @@ github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI
github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI=
github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY=
github.com/rdimitrov/go-tuf-metadata v0.0.0-20230710113934-fe6fba86596c h1:QuU9aronrPDm1yQ20V5wijw8ZIzfSeBfp+h/dqcv2s0=
github.com/rdimitrov/go-tuf-metadata v0.0.0-20230710113934-fe6fba86596c/go.mod h1:p60r+KnkqxhjzzHdrOWYL6LK+US8BZQV+w6w1lVSBtA=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
Expand All @@ -64,8 +60,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/theupdateframework/go-tuf/v2 v2.0.0-20240617113600-41866142c66a h1:G5xNgSjAX9PSv1ZLlIqXTUFQUs/gr2c5RyG/Jc3Dx7Q=
github.com/theupdateframework/go-tuf/v2 v2.0.0-20240617113600-41866142c66a/go.mod h1:baB22nBHeHBCeuGZcIlctNq4P61PcOdyARlplg5xmLA=
github.com/theupdateframework/go-tuf/v2 v2.0.0-20240618160255-f1d8916f08e4 h1:8iJggHYAJTCAzss7V2GdKOQ6k8ieAx2upKUQH296N0Y=
github.com/theupdateframework/go-tuf/v2 v2.0.0-20240618160255-f1d8916f08e4/go.mod h1:baB22nBHeHBCeuGZcIlctNq4P61PcOdyARlplg5xmLA=
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 h1:e/5i7d4oYZ+C1wj2THlRK+oAhjeS/TRQwMfkIuet3w0=
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399/go.mod h1:LdwHTNJT99C5fTAzDz0ud328OgXz+gierycbcIx2fRs=
go.opentelemetry.io/otel v1.15.0 h1:NIl24d4eiLJPM0vKn4HjLYM+UZf6gSfi9Z+NmCxkWbk=
Expand All @@ -74,8 +70,6 @@ go.opentelemetry.io/otel/trace v1.15.0 h1:5Fwje4O2ooOxkfyqI/kJwxWotggDLix4BSAvpE
go.opentelemetry.io/otel/trace v1.15.0/go.mod h1:CUsmE2Ht1CRkvE8OsMESvraoZrrcgD1J2W8GV1ev0Y4=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug=
golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
Expand Down
2 changes: 1 addition & 1 deletion tuf_conformance/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_new_targets_expired(client: ClientRunner, server: SimulatorServer) -> N
# Client should not bump targets version, because it has expired
assert client._assert_version_equals(Targets.type, 1)

def tttest_expired_metadata(client: ClientRunner, server: SimulatorServer) -> None:
def test_expired_metadata(client: ClientRunner, server: SimulatorServer) -> None:
"""Verifies that expired local timestamp/snapshot can be used for
updating from remote.
Expand Down

0 comments on commit a3e3a4a

Please sign in to comment.