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

[crmsh-4.6] Fix: sh: Return the value of AuthorizationError.diagnose if it is not None #1365

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/crmsh-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ jobs:
timeout-minutes: 40
steps:
- uses: actions/checkout@v3
- name: functional test for user access
- name: functional test for ssh agent
run: |
echo '{ "exec-opts": ["native.cgroupdriver=systemd"] }' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker.service
Expand Down
1 change: 1 addition & 0 deletions crmsh/sh.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
ret = super().diagnose()
if not ret:
return 'Please configure passwordless authentication with "crm cluster init ssh" and "crm cluster join ssh"'
return ret

Check warning on line 75 in crmsh/sh.py

View check run for this annotation

Codecov / codecov/patch

crmsh/sh.py#L75

Added line #L75 was not covered by tests


class CommandFailure(Error):
Expand Down
6 changes: 6 additions & 0 deletions test/features/ssh_agent.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ Feature: ssh-agent support
And Run "test x3 == x$(sudo awk 'END {print NR}' ~hacluster/.ssh/authorized_keys)" OK
And Run "grep -E 'hosts = (root|alice)@hanode1' /root/.config/crm/crm.conf" OK on "hanode1,hanode2,hanode3"

# This test is not applicable for non-root user, since the root ssh key pair exists
@skip_non_root
Scenario: Verify expected error message when SSH_AUTH_SOCK is not set
When Try "crm cluster remove hanode3 -y" on "hanode1"
Then Expected "Environment variable SSH_AUTH_SOCK does not exist" in stderr

Scenario: Skip creating ssh key pairs with --use-ssh-agent and use -N
Given Run "crm cluster stop" OK on "hanode1,hanode2,hanode3"
When Run "SSH_AUTH_SOCK=/tmp/ssh-auth-sock crm cluster init --use-ssh-agent -y -N hanode2 -N hanode3" on "hanode1"
Expand Down
Loading