Skip to content

Commit

Permalink
Fix failing integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
locka99 committed Mar 8, 2022
1 parent 985d383 commit 1f12b87
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
29 changes: 21 additions & 8 deletions integration/src/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ pub fn regular_client_test<T>(
session.disconnect();
}

pub fn inactive_session_client_test<T>(
pub fn invalid_session_client_test<T>(
client_endpoint: T,
identity_token: IdentityToken,
_rx_client_command: mpsc::Receiver<ClientCommand>,
Expand Down Expand Up @@ -531,6 +531,24 @@ pub fn inactive_session_client_test<T>(
session.disconnect();
}

pub fn invalid_token_test<T>(
client_endpoint: T,
identity_token: IdentityToken,
_rx_client_command: mpsc::Receiver<ClientCommand>,
mut client: Client,
) where
T: Into<EndpointDescription>,
{
// Connect to the server
let client_endpoint = client_endpoint.into();
info!(
"Client will try to connect to endpoint {:?}",
client_endpoint
);
let session = client.connect_to_endpoint(client_endpoint, identity_token);
assert!(session.is_err());
}

pub fn regular_server_test(rx_server_command: mpsc::Receiver<ServerCommand>, server: Server) {
trace!("Hello from server");
// Wrap the server - a little juggling is required to give one rc
Expand Down Expand Up @@ -590,7 +608,7 @@ pub fn connect_with_get_endpoints(port: u16) {
);
}

pub fn connect_with_invalid_active_session(
pub fn connect_with_invalid_token(
port: u16,
mut client_endpoint: EndpointDescription,
identity_token: IdentityToken,
Expand All @@ -600,12 +618,7 @@ pub fn connect_with_invalid_active_session(
connect_with_client_test(
port,
move |rx_client_command: mpsc::Receiver<ClientCommand>, client: Client| {
inactive_session_client_test(
client_endpoint,
identity_token,
rx_client_command,
client,
);
invalid_token_test(client_endpoint, identity_token, rx_client_command, client);
},
);
}
Expand Down
2 changes: 1 addition & 1 deletion integration/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ fn connect_basic128rsa15_with_username_password() {
#[test]
#[ignore]
fn connect_basic128rsa15_with_invalid_username_password() {
connect_with_invalid_active_session(
connect_with_invalid_token(
next_port(),
endpoint_basic128rsa15_sign_encrypt(),
client_invalid_user_token(),
Expand Down

0 comments on commit 1f12b87

Please sign in to comment.