Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test cases complaining about key length #453

Merged
merged 3 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading