Bug 841066 - "rhc domain status" should not show "Your public key is not loaded into a running ssh-agent" when local and remote public key dismatch
Summary: "rhc domain status" should not show "Your public key is not loaded into a run...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 2.x
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Clayton Coleman
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-18 02:53 UTC by jizhao
Modified: 2015-05-15 02:00 UTC (History)
4 users (show)

Fixed In Version: fork_ami_US2597_US2599_US2813_US2817_US2872_US2816_US2814_209
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-06 18:48:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description jizhao 2012-07-18 02:53:55 UTC
Description of problem:
Create domain, remove the ssh keys and generate a new pair. Load the new keys into ssh-agent and run "rhc domain status". It says "Your public key is not loaded into a running ssh-agent". The error information is incorrect.

Version-Release number of selected component (if applicable):
rhc-0.96.2-1.el6_3.noarch


How reproducible:
Always

Steps to Reproduce:
1.Create domain
2.Remove the ssh keys and generate a new pair.
$ rm ~/.ssh/id_rsa ~/.ssh/id_rsa.pub
$ ssh-keygen -t rsa -f ~/.ssh/id_rsa
3.Run ssh-agent and load the new keys in it
$ eval `ssh-agent`
$ ssh-add ~/.ssh/id_rsa
4.Run "rhc domain status".
  
Actual results:
<------------output------------->
F
===============================================================================
Failure:
test_03_remote_ssh_keys(Test3_SSH) [/usr/lib/ruby/gems/1.8/gems/rhc-0.96.2/bin/rhc-chk:400]:
Your public key is not loaded into a running ssh-agent 
If this is your only error, your connection may still work, depending on your SSH configuration.
<false> is not true.
===============================================================================
.

Finished in 14.603237 seconds.

7 tests, 9 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
85.7143% passed
<------------------------------>

Expected results:
The error message should be something like "~/.ssh/id_rsa.pub didn't match your remote pub key"

Additional info:
After updating sshkey, "rhc domain status" behaves correctly:
$ rhc sshkey update -i default -k ~/.ssh/id_rsa.pub

Comment 1 John (J5) Palmieri 2012-10-09 17:43:19 UTC
We don't check sshkeys during domain status in the rewrite.

Comment 2 jizhao 2012-10-10 04:54:48 UTC
Verify this bug according to comment 1.

Comment 3 jizhao 2012-10-10 05:05:41 UTC
(In reply to comment #2)
> Verify this bug according to comment 1.

Verify this bug on devenv_2304

Version/Release:
devenv_2304
rhc-0.99.5

Steps to verify:
1.Create domain
2.Remove the ssh keys and generate a new pair.
$ rm ~/.ssh/id_rsa ~/.ssh/id_rsa.pub
$ ssh-keygen -t rsa -f ~/.ssh/id_rsa
3.Run ssh-agent and load the new keys in it
$ eval `ssh-agent`
$ ssh-add ~/.ssh/id_rsa
4.Run "rhc domain status".

Actual results:
<------------------------output---------------------------->
Loaded suite /usr/bin/rhc-chk
Started
.....F
===============================================================================
Failure:
  Your public key is not loaded into a running ssh-agent 
  If this is your only error, your connection may still work, depending on your SSH configuration.
  <false> is not true.
test_03_remote_ssh_keys(Test3_SSH)
/usr/lib/ruby/gems/1.8/gems/rhc-0.99.5/bin/rhc-chk:400:in `test_03_remote_ssh_keys'
     397:     require_remote_keys("whether your local SSH keys match the ones in your account")
     398:     require_agent_keys(false)
     399: 
  => 400:     assert !(@@remote_pub_keys & [agent_key_fingerprints,libra_public_key].flatten).empty? ,error_for(:pubkey_not_loaded," ")
     401:   end
     402: 
     403:   def test_04_ssh_connect
===============================================================================
.

Finished in 6.605408 seconds.

7 tests, 9 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
85.7143% passed

1.06 tests/s, 1.36 assertions/s
<---------------------------------------------------->


Note You need to log in before you can comment on or make changes to this bug.