concourse / semver-resource

automated semantic version bumping
Apache License 2.0
96 stars 105 forks source link

Check binary tests fail due to new default format of keys generated via ssh-keygen #76

Closed jspawar closed 6 years ago

jspawar commented 6 years ago

UAA team has forked from this repo and realized we recently started having some failures when running the test/check.sh tests during build of the Docker image. We have found that the same failure is exhibited in this repo as well.

Specifically, there is a test in test/check.sh called it_fails_if_key_has_password which attempts to run check given a private key encrypted with a passphrase. It appears the GitDriver attempts to inspect the contents of the private key to verify whether or not it is encrypted. Also, kind of related to this: there don't appear to be any unit tests for the GitDriver, don't know if we missed them or this was intentional?

Problem is that the newer generation of keys through ssh-keygen no longer contain headers indicating whether or not the key is encrypted. This invalidates the logic linked above by considering the key to be valid and being able to successfully fetch the version from the bucket when it shouldn't. (At least in that it_fails_if_key_has_password test)

We are looking into a fix for ourselves and can send one your way or hold off, up to y'all.

Thanks!

~ Jwal & @bruce-ricard

vito commented 6 years ago

thanks for noticing and fixing this!

there are no unit tests for the git driver as they really wouldn't reduce much risk; 90% of the operations are just shelling out, and if that's all stubbed out there's not much being tested. there are integration tests that operate at a higher level and they did indeed catch this breakage.