Update some tests

pull/206/head
Chip Senkbeil 11 months ago
parent 6df19dfd9d
commit 5753e5ebd5
No known key found for this signature in database
GPG Key ID: 35EF1F8EC72A4131

@ -4,8 +4,7 @@ use std::time::Duration;
use async_trait::async_trait;
use distant_core::net::auth::msg::*;
use distant_core::net::auth::{
AuthHandler, AuthMethodHandler, NoneAuthenticationMethod, PromptAuthMethodHandler,
SingleAuthHandler,
AuthHandler, AuthMethodHandler, PromptAuthMethodHandler, SingleAuthHandler,
};
use distant_core::net::client::{Client as NetClient, ClientConfig, ReconnectStrategy};
use distant_core::net::manager::ManagerClient;
@ -146,16 +145,11 @@ impl<T: AuthHandler + Clone> Client<T> {
pub struct JsonAuthHandler {
tx: MsgSender,
rx: MsgReceiver,
skip: bool,
}
impl JsonAuthHandler {
pub fn new(tx: MsgSender, rx: MsgReceiver) -> Self {
Self {
tx,
rx,
skip: false,
}
Self { tx, rx }
}
}
@ -171,23 +165,6 @@ impl AuthHandler for JsonAuthHandler {
&mut self,
initialization: Initialization,
) -> io::Result<InitializationResponse> {
// NOTE: This is a hack to skip the need for authentication prompting when a "none"
// method is available as the server should then reply with the on_finished
// status automatically.
/*if initialization
.methods
.iter()
.any(|id| id == NoneAuthenticationMethod::ID)
{
self.skip = true;
// NOTE: We only send back the none auth method to ensure that it is performed
// first to avoid blocking waiting on failing a different method.
return Ok(InitializationResponse {
methods: vec![NoneAuthenticationMethod::ID.to_string()],
});
}*/
self.tx
.send_blocking(&Authentication::Initialization(initialization))?;
let response = self.rx.recv_blocking::<AuthenticationResponse>()?;
@ -202,20 +179,12 @@ impl AuthHandler for JsonAuthHandler {
}
async fn on_start_method(&mut self, start_method: StartMethod) -> io::Result<()> {
/*if self.skip {
return Ok(());
}*/
self.tx
.send_blocking(&Authentication::StartMethod(start_method))?;
Ok(())
}
async fn on_finished(&mut self) -> io::Result<()> {
/*if self.skip {
return Ok(());
}*/
self.tx.send_blocking(&Authentication::Finished)?;
Ok(())
}

@ -1,2 +1,4 @@
#![allow(dead_code)]
pub mod fixtures;
pub mod utils;

@ -1,5 +1,4 @@
use assert_fs::prelude::*;
use predicates::prelude::*;
use rstest::*;
mod common;
@ -32,20 +31,20 @@ fn should_handle_large_volume_of_requests(ctx: DistantManagerCtx) {
#[rstest]
#[test_log::test]
#[ignore]
fn should_handle_wide_spread_of_clients(ctx: DistantManagerCtx) {
fn should_handle_wide_spread_of_clients(_ctx: DistantManagerCtx) {
todo!();
}
#[rstest]
#[test_log::test]
#[ignore]
fn should_handle_abrupt_client_disconnects(ctx: DistantManagerCtx) {
fn should_handle_abrupt_client_disconnects(_ctx: DistantManagerCtx) {
todo!();
}
#[rstest]
#[test_log::test]
#[ignore]
fn should_handle_badly_killing_client_shell_with_interactive_process(ctx: DistantManagerCtx) {
fn should_handle_badly_killing_client_shell_with_interactive_process(_ctx: DistantManagerCtx) {
todo!();
}

Loading…
Cancel
Save