Skip to content

Commit f91c469

Browse files
committed
fix: Add missing ssh_connection_config field to test and example files
Priority: HIGH Issue: Build failure due to missing field in InteractiveCommand struct Review-Iteration: 1 The PR added ssh_connection_config field to InteractiveCommand but missed updating the example file and test files that instantiate this struct.
1 parent aa92c1d commit f91c469

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

examples/interactive_demo.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use bssh::config::{Config, InteractiveConfig};
1919
use bssh::node::Node;
2020
use bssh::pty::PtyConfig;
2121
use bssh::ssh::known_hosts::StrictHostKeyChecking;
22+
use bssh::ssh::tokio_client::SshConnectionConfig;
2223
use std::path::PathBuf;
2324

2425
#[tokio::main]
@@ -59,6 +60,7 @@ async fn main() -> anyhow::Result<()> {
5960
jump_hosts: None,
6061
pty_config: PtyConfig::default(),
6162
use_pty: None,
63+
ssh_connection_config: SshConnectionConfig::default(),
6264
};
6365

6466
println!("Starting interactive session...");

tests/interactive_integration_test.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use bssh::config::{Config, InteractiveConfig};
1919
use bssh::node::Node;
2020
use bssh::pty::PtyConfig;
2121
use bssh::ssh::known_hosts::StrictHostKeyChecking;
22+
use bssh::ssh::tokio_client::SshConnectionConfig;
2223
use std::path::PathBuf;
2324
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
2425
use std::sync::Arc;
@@ -52,6 +53,7 @@ fn test_interactive_command_builder() {
5253
pty_config: PtyConfig::default(),
5354
use_pty: None,
5455
jump_hosts: None,
56+
ssh_connection_config: SshConnectionConfig::default(),
5557
};
5658

5759
assert!(!cmd.single_node);
@@ -86,6 +88,7 @@ fn test_history_file_handling() {
8688
pty_config: PtyConfig::default(),
8789
use_pty: None,
8890
jump_hosts: None,
91+
ssh_connection_config: SshConnectionConfig::default(),
8992
};
9093

9194
assert_eq!(cmd.history_file, history_path);
@@ -183,6 +186,7 @@ async fn test_interactive_with_unreachable_nodes() {
183186
pty_config: PtyConfig::default(),
184187
use_pty: None,
185188
jump_hosts: None,
189+
ssh_connection_config: SshConnectionConfig::default(),
186190
};
187191

188192
// This should fail to connect
@@ -217,6 +221,7 @@ async fn test_interactive_with_no_nodes() {
217221
pty_config: PtyConfig::default(),
218222
use_pty: None,
219223
jump_hosts: None,
224+
ssh_connection_config: SshConnectionConfig::default(),
220225
};
221226

222227
let result = cmd.execute().await;
@@ -261,6 +266,7 @@ fn test_mode_configuration() {
261266
pty_config: PtyConfig::default(),
262267
use_pty: None,
263268
jump_hosts: None,
269+
ssh_connection_config: SshConnectionConfig::default(),
264270
};
265271

266272
assert!(single_cmd.single_node);
@@ -286,6 +292,7 @@ fn test_mode_configuration() {
286292
pty_config: PtyConfig::default(),
287293
use_pty: None,
288294
jump_hosts: None,
295+
ssh_connection_config: SshConnectionConfig::default(),
289296
};
290297

291298
assert!(!multi_cmd.single_node);
@@ -314,6 +321,7 @@ fn test_working_directory_config() {
314321
pty_config: PtyConfig::default(),
315322
use_pty: None,
316323
jump_hosts: None,
324+
ssh_connection_config: SshConnectionConfig::default(),
317325
};
318326

319327
assert_eq!(cmd_with_dir.work_dir, Some("/var/www".to_string()));
@@ -337,6 +345,7 @@ fn test_working_directory_config() {
337345
pty_config: PtyConfig::default(),
338346
use_pty: None,
339347
jump_hosts: None,
348+
ssh_connection_config: SshConnectionConfig::default(),
340349
};
341350

342351
assert_eq!(cmd_without_dir.work_dir, None);
@@ -372,6 +381,7 @@ fn test_prompt_format() {
372381
pty_config: PtyConfig::default(),
373382
use_pty: None,
374383
jump_hosts: None,
384+
ssh_connection_config: SshConnectionConfig::default(),
375385
};
376386

377387
assert_eq!(cmd.prompt_format, format);

tests/interactive_test.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use bssh::config::{Config, InteractiveConfig};
1717
use bssh::node::Node;
1818
use bssh::pty::PtyConfig;
1919
use bssh::ssh::known_hosts::StrictHostKeyChecking;
20+
use bssh::ssh::tokio_client::SshConnectionConfig;
2021
use std::path::PathBuf;
2122

2223
#[tokio::test]
@@ -40,6 +41,7 @@ async fn test_interactive_command_creation() {
4041
pty_config: PtyConfig::default(),
4142
use_pty: None,
4243
jump_hosts: None,
44+
ssh_connection_config: SshConnectionConfig::default(),
4345
};
4446

4547
assert!(!cmd.single_node);
@@ -68,6 +70,7 @@ async fn test_interactive_with_no_nodes() {
6870
pty_config: PtyConfig::default(),
6971
use_pty: None,
7072
jump_hosts: None,
73+
ssh_connection_config: SshConnectionConfig::default(),
7174
};
7275

7376
let result = cmd.execute().await;

0 commit comments

Comments
 (0)