Skip to content

Fix broken tests#273

Open
hongkailiu wants to merge 1 commit intocamallo:masterfrom
hongkailiu:fix-broken-tests-new-upstream
Open

Fix broken tests#273
hongkailiu wants to merge 1 commit intocamallo:masterfrom
hongkailiu:fix-broken-tests-new-upstream

Conversation

@hongkailiu
Copy link
Collaborator

https://issues.redhat.com/browse/OTA-1552

From the CI test:

failures:
    net::docker_io::test_dockerio_anonymous_auth
    net::quay_io::test_quayio_auth_layer_blob
    net::quay_io::test_quayio_auth_login
    net::quay_io::test_quayio_auth_manifest
    net::quay_io::test_quayio_auth_manifestref
    net::quay_io::test_quayio_auth_manifestref_missing
    net::quay_io::test_quayio_auth_tags

test result: FAILED. 16 passed; 7 failed; 1 ignored; 0 measured; 0 filtered out; finished in 1.39s

there are 7 tests failing in our CI job. net::docker_io::test_dockerio_anonymous_auth is fixed by #269 and the remained six are fixed by this PR.


The trick of getting an image for application/vnd.docker.distribution.manifest.v1+prettyjws which is required by net::quay_io::test_quayio_auth_manifest:

assert_eq!(has_manifest, Some(MediaTypes::ManifestV2S1Signed));

I tried with GPG sign with podman podman push --sign-by hongkliu@redhat.com quay.io/openshift-ota/cincinnati-test:0.0.1 --authfile /tmp/hk.json but it did not work.

So I noticed this PUBLIC image:

let image = "coreos/alpine-sh";
let reference = "latest";
let fut = dclient.has_manifest(image, reference, None);
let has_manifest = runtime.block_on(fut).unwrap();
assert_eq!(has_manifest, Some(MediaTypes::ManifestV2S1Signed));

and check with

$ curl -I -sH 'Accept: application/vnd.docker.distribution.manifest.v1+prettyjws' https://quay.io/v2/coreos/alpine-sh/manifests/latest | grep content-type
content-type: application/vnd.docker.distribution.manifest.v1+prettyjws

Great. It has the expected type. Then I copied the image over and net::quay_io::test_quayio_auth_manifest becomes green.

$ skopeo copy --dest-authfile /tmp/hk.json docker://quay.io/coreos/alpine-sh:latest docker://quay.io/openshift-ota/cincinnati-test:0.0.1

Other changes in the PR are the adjustments for the new image.

Hindsight is that it is very unlikely we have this type of images for OpenShift releases: neither cosign nor gpg signs images with that type. But maybe other projects relies on this. So keeping the type of image in the test intact might be a good idea.

@hongkailiu
Copy link
Collaborator Author

Replacing #271 which was closed unexpectedly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant