Skip to content

Commit

Permalink
more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Dec 9, 2021
1 parent 32126ff commit a785adf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions clab/authz_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func (c *CLab) CreateAuthzKeysFile() error {
return err
}
log.Warn(filepath.Join(c.Dir.Lab, authzFName))
log.Warn(b.String())

// ensure authz_keys will have the permissions allowing it to be read by anyone
return os.Chmod(p, 0644)
Expand Down
2 changes: 2 additions & 0 deletions nodes/srl/srl.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ func (s *srl) Init(cfg *types.NodeConfig, opts ...nodes.NodeOption) error {

// mount authorized_keys file to enable passwordless login
authzKeysPath := filepath.Join(filepath.Dir(s.cfg.LabDir), "authorized_keys")
log.Warn("authzKeysPath:", authzKeysPath)
if utils.FileExists(authzKeysPath) {
log.Warn("authzKeyFile exists, mounting")
s.cfg.Binds = append(s.cfg.Binds, fmt.Sprint(authzKeysPath, ":/root/.ssh/authorized_keys:ro"))
s.cfg.Binds = append(s.cfg.Binds, fmt.Sprint(authzKeysPath, ":/home/linuxadmin/.ssh/authorized_keys:ro"))
s.cfg.Binds = append(s.cfg.Binds, fmt.Sprint(authzKeysPath, ":/home/admin/.ssh/authorized_keys:ro"))
Expand Down
13 changes: 10 additions & 3 deletions tests/02-basic-srl/01-two-srls.robot
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,18 @@ Ensure srl1 is reachable over ssh
... username=admin
... password=admin
... try_for=10
# Ensure srl1 is reachable over ssh with public key auth
# ${rc} ${output} = Run And Return Rc And Output
# ... sudo docker inspect clab-${lab-name}-srl1
# Log ${output}
# Log ${key-path}
# Common.Login via SSH with public key
# ... address=clab-${lab-name}-srl1
# ... username=root
# ... keyfile=${key-path}
# ... try_for=10

Ensure srl1 is reachable over ssh with public key auth
${rc} ${output} = Run And Return Rc And Output
... sudo docker inspect clab-${lab-name}-srl1
Log ${output}
Log ${key-path}
Common.Login via SSH with public key
... address=clab-${lab-name}-srl1
Expand Down

0 comments on commit a785adf

Please sign in to comment.