[VAL-42] Login with ssh key fails Created: 20/Aug/19  Updated: 23/Aug/19  Resolved: 23/Aug/19

Status: Done
Project: Validation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Tapio Särkkä Assignee: Juha Kosonen
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Found a situation where bluval script login with ssh key fails in every case, even when the exact same login works otherwise (without running bluval script) from outside and inside the container.

 

Error message:

Login with public key failed for user 'root'.

 

Necessary workaround: needed to modify robot file that is used for the login (such as cyclictest.robot) by commenting line:

# Login With Public Key ${USERNAME} ${HOME}/.ssh/id_rsa

and appending line:

LOGIN ${USERNAME} ${PASSWORD}

and also appending password into the variables.yaml file, forcing password login instead of ssh key login.



 Comments   
Comment by Juha Kosonen [ 23/Aug/19 ]

In general, please do not edit data (like variables.yaml here) already attached in the JIRA, that complicates following the case. Just copy a new data.

The problem here is some sort of SSH key issue in paramiko related RFC4716 format [1]. I generated PEM formatted key and copied it to 10.22.109.44. This enabled robot to access the node via SSH.

And once passwordless sudo for user 'nokia' on 10.22.109.44 was enabled, test can be executed successful.

nokia@linux-bekd:~> sudo docker run -ti -v $HOME/.ssh:/root/.ssh -v $HOME/.kube/config:/root/.kube/config -v $HOME/juha/variables.yaml:/opt/akraino/validation/tests/variables.yaml -v $HOME/results:/opt/akraino/results -v $HOME/juha/cyclictest.robot:/opt/akraino/validation/tests/os/cyclictest/cyclictest.robot --name akr-juha akraino/validation:os-latest bin/sh -c 'cd /opt/akraino/validation/ && python bluval/bluval.py -l os rec' 
## Layer os
_OPTIONAL_ALSO False
Executing testcase cyclictest
show_stopper False
Invoking ['robot', '-V', '/opt/akraino/validation/tests/variables.yaml', '-d', '/opt/akraino/results/os/cyclictest', '/opt/akraino/validation/tests/os/cyclictest'] 
==============================================================================
Cyclictest
==============================================================================
Cyclictest.Cyclictest :: Cyclic latency test
==============================================================================
Latency Test | PASS |
------------------------------------------------------------------------------
Cyclictest.Cyclictest :: Cyclic latency test | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Cyclictest | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Output: /opt/akraino/results/os/cyclictest/output.xml
Log: /opt/akraino/results/os/cyclictest/log.html
Report: /opt/akraino/results/os/cyclictest/report.html
nokia@linux-bekd:~>

[1] https://github.com/paramiko/paramiko/issues/1135

Comment by Tapio Särkkä [ 22/Aug/19 ]

Sorry, I pasted the file incorrectly. The problem persists with both accounts 'nokia' and 'root'.

Comment by Juha Kosonen [ 22/Aug/19 ]

Here Robot test is using 'root' as a user as defined in variables.yaml. Please modify this (and docker command accordindly) since you're using different user.

Comment by Tapio Särkkä [ 22/Aug/19 ]

The bug occurs with a basic setup. Docker command to run the script:

 

sudo docker run -ti -v $HOME/.ssh:/root/.ssh -v $HOME/.kube/config:/root/.kube/config -v $VALIDATION_HOME/tests/variables.yaml:/opt/akraino/validation/tests/variables.yaml -v $AKRAINO_HOME/results:/opt/akraino/results -v $VALIDATION_HOME/tests/os/cyclictest:/opt/akraino/validation/tests/os/cyclictest akraino/validation:os-latest bin/sh -c 'cd /opt/akraino/validation/ && python bluval/bluval.py -l os rec'

 

Variables.yaml -file:

 

'host': '10.22.109.44', 'username': 'nokia', 'home': '/root', 'ssh_keyfile': '~/.ssh/id_rsa',  'sysinfo': 'PowerEdge R740xd', 'bios_revision': 1.3, 'base_uri': 'https://10.22.109.44/redfish/v1/', 'ipmiuser': 'nokia', 'ipmipwrd': '', 'host_mr': '10.22.109.44', 'host_wr1': 'worker_host_ip', 'host_wr2': 'worker_host_ip', 'host_wr3': 'worker_host_ip', 'host_wr4': 'worker_host_ip', 'macaddr': '46:d4:58:40:c0:52', 'chassis': 'serial_number', 'idracip': '10.22.109.45', 'bootseq': 'boot_input', 'biosver': 'bios_version', 'firmware': 'firmware_version', 'nodename': 'targetnode', 'rootuser': 'root', 'rootpswd': '', 'log_path': '/opt/akraino/results/k8s/conformance'

 

Login with ssh key regularly (ssh nokia@10.22.109.44) works both from inside and outside the container, but not with the robot.

 

 

Comment by Juha Kosonen [ 21/Aug/19 ]

Could you provide a more detailed description of the scenario and parameters you are using? Just executed cyclictest and it passed ok:

(validation) jukosone@ratel:~/omat/akraino/git/validation/bluval$ python bluval.py -l os rec
## Layer os
_OPTIONAL_ALSO False
Executing testcase cyclictest
show_stopper False
Invoking ['robot', '-V', '/home/jukosone/omat/akraino/git/validation/tests/variables.yaml', '-d', '/home/jukosone/omat/akraino/git/results/os/cyclictest', '/home/jukosone/omat/akraino/git/validation/tests/os/cyclictest']
==============================================================================
Cyclictest 
==============================================================================
Cyclictest.Cyclictest :: Cyclic latency test 
==============================================================================
Latency Test | PASS |
------------------------------------------------------------------------------
Cyclictest.Cyclictest :: Cyclic latency test | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Cyclictest | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Output: /home/jukosone/omat/akraino/git/results/os/cyclictest/output.xml
Log: /home/jukosone/omat/akraino/git/results/os/cyclictest/log.html
Report: /home/jukosone/omat/akraino/git/results/os/cyclictest/report.html
(validation) jukosone@ratel:~/omat/akraino/git/validation/bluval${code}
 
{code:java}
diff --git a/tests/variables.yaml b/tests/variables.yaml
index 42d6425..f01b0c5 100644
--- a/tests/variables.yaml
+++ b/tests/variables.yaml
@@ -24,9 +24,9 @@
 # this.
 
 ### Input variables cluster's master host
-host: aknode109 # cluster's master host address
-username: mm747b # user credentials
-home: /home/mm747b # Public keys location
+host: 10.22.109.9 # cluster's master host address
+username: cloudadmin # user credentials
+home: /home/jukosone/foo # Public keys location
 ssh_keyfile: ~/.ssh/id_rsa # Identity file for authentication
 
 ### Input variables for bios_version_dell.robot
(validation) jukosone@ratel:~/omat/akraino/git/validation/tests/os/cyclictest$ 

 

 

Generated at Sat Feb 10 06:06:51 UTC 2024 using Jira 9.4.5#940005-sha1:e3094934eac4fd8653cf39da58f39364fb9cc7c1.