Add a new scenario to add an SSH key, perform Git actions with it, and remove an SSH key

This will automatize the SSH part of https://docs.google.com/spreadsheets/d/15AtBb6s2p_HvtUe5G9GUSc2ngt69X8dO-418zMuT4us/edit?ts=5b07999b#gid=0 (internal document).

Steps of the automated QA scenario:

Part 1

  1. Create an SSH (e.g. ED25519) keys pair (note: we already have Runtime::Key subclasses)
  2. Add its public key to a user => assert that the key has been created

Part 2

  1. Create a project
  2. git clone the project using the SSH URL (note: we already have a similar Repository::Push factory, and a similar clone scenario)
  • We will need to use the private key created in 1. either using the GIT_SSH_COMMAND environment variable, i.e. GIT_SSH_COMMAND='ssh -i /path/to/private/key' git clone ... or setting the core.sshCommand Git config (might be better so that we do it only once)
  1. Make a change to the project (e.g. add a README.md)
  2. git push to the project => assert that the new file is visible in the project's home page and that its content is the expected one (note: we already have a similar Repository::Push factory, and a similar push scenario)
  3. Remove the SSH key
Edited by Rémy Coutable