Skip to content

Commit

Permalink
Look for the correct ssh key in end-to-end test
Browse files Browse the repository at this point in the history
  • Loading branch information
zephraph committed Jan 30, 2024
1 parent e963f41 commit 40bc4a4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions end-to-end-tests/src/instance_launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async fn instance_launch() -> Result<()> {
.body(SshKeyCreate {
name: ssh_key_name.clone(),
description: String::new(),
public_key: public_key_str,
public_key: public_key_str.clone(),
})
.send()
.await?;
Expand Down Expand Up @@ -132,7 +132,10 @@ async fn instance_launch() -> Result<()> {
.split_once("-----BEGIN SSH HOST KEY KEYS-----")
.and_then(|(_, s)| s.split_once("-----END SSH HOST KEY KEYS-----"))
.and_then(|(lines, _)| {
lines.trim().lines().find(|line| line.starts_with("ssh-ed25519"))
lines
.trim()
.lines()
.find(|line| line.contains(public_key_str.clone().as_str()))
})
.and_then(|line| line.split_whitespace().nth(1))
.context("failed to get SSH host key from serial console")?;
Expand Down

0 comments on commit 40bc4a4

Please sign in to comment.