chore: update test files for v2.1.0 (#836)

Similar to #758, we are updating the test files.

Errors for checking the tag in attestations are slightly different. Unit
tests are adjusted with the new test cases.

---------

Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
This commit is contained in:
Ramon Petgrave
2025-02-27 14:33:44 -05:00
committed by GitHub
parent 9108dc2890
commit b53bd9415b
73 changed files with 198 additions and 2 deletions

View File

@@ -787,21 +787,39 @@ func Test_runVerifyGHAArtifactImage(t *testing.T) {
err: serrors.ErrorInvalidRef,
},
{
name: "tag no match empty tag workflow_dispatch > v1.9.0",
name: "tag no match empty tag workflow_dispatch > v1.9.0, <= v2.0.0",
artifact: "container_workflow_dispatch",
source: "github.com/slsa-framework/example-package",
ptag: pString("v1.2.3"),
minversion: "v1.9.0",
maxversion: "v2.0.0",
err: serrors.ErrorMismatchTag,
},
{
name: "versioned tag no match empty tag workflow_dispatch > v1.9.0",
name: "tag no match empty tag workflow_dispatch > v2.0.0",
artifact: "container_workflow_dispatch",
source: "github.com/slsa-framework/example-package",
ptag: pString("v1.2.3"),
minversion: "v2.0.0",
err: serrors.ErrorInvalidRef,
},
{
name: "versioned tag no match empty tag workflow_dispatch > v1.9.0, <= v2.0.0",
artifact: "container_workflow_dispatch",
source: "github.com/slsa-framework/example-package",
pversiontag: pString("v1"),
minversion: "v1.9.0",
maxversion: "v2.0.0",
err: serrors.ErrorMismatchVersionedTag,
},
{
name: "versioned tag no match empty tag workflow_dispatch > v2.0.0",
artifact: "container_workflow_dispatch",
source: "github.com/slsa-framework/example-package",
pversiontag: pString("v1"),
minversion: "v2.0.0",
err: serrors.ErrorInvalidRef,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
hello

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
hello

View File

@@ -0,0 +1 @@
hello

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
hello

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
sha256:234e2c830c2fb31ac5671789d22adfe44d30c3ee831d01beae5e237841a13122

View File

@@ -0,0 +1,28 @@
{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.index.v1+json",
"manifests": [
{
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"digest": "sha256:d1fc0de9c6a33e502c488221644de1736c53d8ddb59b0e41b4946fb26af50e69",
"size": 2557,
"platform": {
"architecture": "amd64",
"os": "linux"
}
},
{
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"digest": "sha256:a79645dc6fd76a0db9c9c04f5ba722ecb7d1fa8cdfc1d848d931d884cbab02ea",
"size": 566,
"annotations": {
"vnd.docker.reference.digest": "sha256:d1fc0de9c6a33e502c488221644de1736c53d8ddb59b0e41b4946fb26af50e69",
"vnd.docker.reference.type": "attestation-manifest"
},
"platform": {
"architecture": "unknown",
"os": "unknown"
}
}
]
}

View File

@@ -0,0 +1 @@
{"architecture":"amd64","config":{"User":"0","Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt"],"Entrypoint":["/app"],"WorkingDir":"/","Labels":{"org.opencontainers.image.created":"2025-02-25T21:57:05.844Z","org.opencontainers.image.description":"","org.opencontainers.image.licenses":"Apache-2.0","org.opencontainers.image.revision":"4d329c75e7ec1725f7c9ce917a8799d408d06be3","org.opencontainers.image.source":"https://github.com/slsa-framework/example-package","org.opencontainers.image.title":"example-package","org.opencontainers.image.url":"https://github.com/slsa-framework/example-package","org.opencontainers.image.version":"main"}},"created":"2025-02-25T21:57:29.579251262Z","history":[{"created":"0001-01-01T00:00:00Z"},{"created":"0001-01-01T00:00:00Z"},{"created":"0001-01-01T00:00:00Z"},{"created":"0001-01-01T00:00:00Z"},{"created":"0001-01-01T00:00:00Z"},{"created":"0001-01-01T00:00:00Z"},{"created":"0001-01-01T00:00:00Z"},{"created":"0001-01-01T00:00:00Z"},{"created":"0001-01-01T00:00:00Z"},{"created":"0001-01-01T00:00:00Z"},{"created":"0001-01-01T00:00:00Z"},{"created":"2025-02-25T21:57:29.579251262Z","created_by":"COPY /app/app /app # buildkit","comment":"buildkit.dockerfile.v0"},{"created":"2025-02-25T21:57:29.579251262Z","created_by":"ENTRYPOINT [\"/app\"]","comment":"buildkit.dockerfile.v0","empty_layer":true}],"os":"linux","rootfs":{"type":"layers","diff_ids":["sha256:f920c5680b0b677741c5500dc365a9b074aa263ab43c3eb6be6a465b1caadd8e","sha256:8fa10c0194df9b7c054c90dbe482585f768a54428fc90a5b78a0066a123b1bba","sha256:a80545a98dcd0866ae5eeadc9a28dec703b1e54a01ce8ff245e83f48261fe575","sha256:4d049f83d9cf21d1f5cc0e11deaf36df02790d0e60c1a3829538fb4b61685368","sha256:af5aa97ebe6ce1604747ec1e21af7136ded391bcabe4acef882e718a87c86bcc","sha256:6f1cdceb6a3146f0ccb986521156bef8a422cdbb0863396f7f751f575ba308f4","sha256:bbb6cacb8c82e4da4e8143e03351e939eab5e21ce0ef333c42e637af86c5217b","sha256:2a92d6ac9e4fcc274d5168b217ca4458a9fec6f094ead68d99c77073f08caac1","sha256:1a73b54f556b477f0a8b939d13c504a3b4f4db71f7a09c63afbc10acb3de5849","sha256:f4aee9e53c42a22ed82451218c3ea03d1eea8d6ca8fbe8eb4e950304ba8a8bb3","sha256:b336e209998fa5cf0eec3dabf93a21194198a35f4f75612d8da03693f8c30217","sha256:1b1886b9acf4ab23bfb87940146ddb1cfdad8babe6b602e75ed168e23eb66686"]}}

View File

@@ -0,0 +1 @@
{"architecture":"unknown","os":"unknown","config":{},"rootfs":{"type":"layers","diff_ids":["sha256:8d63b5e440cc7cfa68622b4a3cae2dbe215f8f8dcc9f2fa4ffd3078d40d61a84"]}}

View File

@@ -0,0 +1 @@
{"_type":"https://in-toto.io/Statement/v0.1","predicateType":"https://slsa.dev/provenance/v0.2","subject":[{"name":"pkg:docker/ghcr.io/slsa-framework/example-package.verifier-e2e.all.tag.main.default.slsa3@main?platform=linux%2Famd64","digest":{"sha256":"d1fc0de9c6a33e502c488221644de1736c53d8ddb59b0e41b4946fb26af50e69"}}],"predicate":{"builder":{"id":""},"buildType":"https://mobyproject.org/buildkit@v1","materials":[{"uri":"pkg:docker/golang@1.21?digest=sha256:4746d26432a9117a5f58e95cb9f954ddf0de128e9d5816886514199316e4a2fb\u0026platform=linux%2Famd64","digest":{"sha256":"4746d26432a9117a5f58e95cb9f954ddf0de128e9d5816886514199316e4a2fb"}},{"uri":"pkg:docker/gcr.io/distroless/static?digest=sha256:3f2b64ef97bd285e36132c684e6b2ae8f2723293d09aae046196cca64251acac\u0026platform=linux%2Famd64","digest":{"sha256":"3f2b64ef97bd285e36132c684e6b2ae8f2723293d09aae046196cca64251acac"}},{"uri":"https://github.com/slsa-framework/example-package.git#4d329c75e7ec1725f7c9ce917a8799d408d06be3","digest":{"sha1":"4d329c75e7ec1725f7c9ce917a8799d408d06be3"}}],"invocation":{"configSource":{"uri":"https://github.com/slsa-framework/example-package.git#4d329c75e7ec1725f7c9ce917a8799d408d06be3","digest":{"sha1":"4d329c75e7ec1725f7c9ce917a8799d408d06be3"},"entryPoint":"Dockerfile"},"parameters":{"frontend":"dockerfile.v0"},"environment":{"platform":"linux/amd64"}},"metadata":{"buildInvocationID":"i2zs9o1wwh74vxm7k1kobli75","buildStartedOn":"2025-02-25T21:57:06.800879795Z","buildFinishedOn":"2025-02-25T21:57:29.66049539Z","completeness":{"parameters":false,"environment":true,"materials":true},"reproducible":false,"https://mobyproject.org/buildkit@v1#metadata":{}}}}

View File

@@ -0,0 +1 @@
{"architecture":"","created":"0001-01-01T00:00:00Z","history":[{"created":"0001-01-01T00:00:00Z"}],"os":"","rootfs":{"type":"layers","diff_ids":["sha256:e163b472f2e5d66e5a2a45e26e020c51a0d2da7dc8b567b31fc2ebfd33dbc33a"]},"config":{}}

View File

@@ -0,0 +1,19 @@
{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"config": {
"mediaType": "application/vnd.oci.image.config.v1+json",
"digest": "sha256:86c42567c8b6c16e73362c1aac3b0054744e29bd2f922b3e9cbcbb6b96fd7aae",
"size": 167
},
"layers": [
{
"mediaType": "application/vnd.in-toto+json",
"digest": "sha256:8d63b5e440cc7cfa68622b4a3cae2dbe215f8f8dcc9f2fa4ffd3078d40d61a84",
"size": 1664,
"annotations": {
"in-toto.io/predicate-type": "https://slsa.dev/provenance/v0.2"
}
}
]
}

View File

@@ -0,0 +1,71 @@
{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"config": {
"mediaType": "application/vnd.oci.image.config.v1+json",
"digest": "sha256:533ae3a04dfa4bc6818f734589a6d80816ab8f6f24f5dabce5a05f1df10ebb92",
"size": 2359
},
"layers": [
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:688513194d7a0f0d77e4a3692748d21c4ccd1af6a5ff9012f18f053ed9573c13",
"size": 104238
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:bfb59b82a9b65e47d485e53b3e815bca3b3e21a095bd0cb88ced9ac0b48062bf",
"size": 13356
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:efa9d1d5d3a286c60a7261496166fdf31cec2284dafe7eef7cda89eba2f675d6",
"size": 541994
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:a62778643d563b511190663ef9a77c30d46d282facfdce4f3a7aecc03423c1f3",
"size": 67
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:7c12895b777bcaa8ccae0605b4de635b68fc32d60fa08f421dc3818bf55ee212",
"size": 188
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:3214acf345c0cc6bbdb56b698a41ccdefc624a09d6beb0d38b5de0b2303ecaf4",
"size": 123
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:5664b15f108bf9436ce3312090a767300800edbbfd4511aa1a6d64357024d5dd",
"size": 168
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:0bab15eea81d0fe6ab56ebf5fba14e02c4c1775a7f7436fbddd3505add4e18fa",
"size": 93
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:4aa0ea1413d37a58615488592a0b827ea4b2e48fa5a77cf707d0e35f025e613f",
"size": 385
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:da7816fa955ea24533c388143c78804c28682eef99b4ee3723b548c70148bba6",
"size": 321
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:9aee425378d2c16cd44177dc54a274b312897f5860a8e78fdfda555a0d79dd71",
"size": 130495
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:f3fe5c5572e51deec42a89217be61408d662771be49ab28f5874a1268e286df3",
"size": 651235
}
]
}

View File

@@ -0,0 +1,22 @@
{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.index.v1+json",
"manifests": [
{
"mediaType": "application/vnd.oci.image.index.v1+json",
"size": 856,
"digest": "sha256:234e2c830c2fb31ac5671789d22adfe44d30c3ee831d01beae5e237841a13122",
"annotations": {
"kind": "dev.cosignproject.cosign/imageIndex"
}
},
{
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"size": 10623,
"digest": "sha256:21454caf3a160dfbe6359f0501aa8401c6c0f2c7a8b71380ea21f8c4b48b64fe",
"annotations": {
"kind": "dev.cosignproject.cosign/atts"
}
}
]
}

View File

@@ -0,0 +1,3 @@
{
"imageLayoutVersion": "1.0.0"
}

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long