Skip to content

Commit

Permalink
Merge pull request #453 from MarketSquare/feature/448-fix-key-length
Browse files Browse the repository at this point in the history
Fix test cases complaining about key length
  • Loading branch information
Noordsestern authored Aug 30, 2024
2 parents 30d8944 + 336ac8d commit 0d7def1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
sudo useradd -m testkey -s /bin/bash
sudo -E su testkey -c "echo $'export PS1=\'\u@$HOSTNAME \W \$ \'' >> /home/testkey/.bashrc"
sudo -E su testkey -c "mkdir -p /home/testkey/.ssh"
sudo -E su testkey -c "ssh-keygen -f /home/testkey/.ssh/id_rsa -t rsa -N ''"
sudo -E su testkey -c "ssh-keygen -f /home/testkey/.ssh/id_rsa -t rsa -b 2048 -N ''"
sudo -E su testkey -c "cp /home/testkey/.ssh/id_rsa.pub /home/testkey/.ssh/authorized_keys"
sudo -E su testkey -c "chmod 644 /home/testkey/.ssh/id_rsa"
sudo -E su testkey -c "chmod 600 /home/testkey/.ssh/authorized_keys"
Expand Down
2 changes: 1 addition & 1 deletion atest/connections.robot
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Write In Teardown Should Not Hang If Auth Failed

Write Bare In Teardown Should Not Hang If Auth Failed
Open Connection ${HOST}
Run Keyword And Expect Error Login with public key failed* Login With Public Key invalid ${KEY}
Run Keyword And Expect Error Login with public key failed* Login With Public Key ${USERNAME} ${KEY}_invalid
[Teardown] Run Keyword And Expect Error *Cannot open session, you need to establish a connection first. Write Bare ls

Login With Agent
Expand Down
4 changes: 3 additions & 1 deletion atest/login.robot
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ Login With Public Key When Valid Username And Key
Login With Public Key ${KEY USERNAME} ${KEY}

Login With Public Key When Invalid Username
Run Keyword And Expect Error Login with public key failed for user '${INVALID USERNAME}'.
[Documentation] A username that does not exist on the target machine leads to a rather misleading error message about key lengths.
... See: https://github.com/fabric/fabric/issues/2182#issuecomment-1362940149
Run Keyword And Expect Error ValueError: q must be exactly 160, 224, or 256 bits long
... Login With Public Key ${INVALID USERNAME} ${KEY}

Login With Public Key When Invalid Key
Expand Down

0 comments on commit 0d7def1

Please sign in to comment.