forked from lavina/lavina
uncommented test
This commit is contained in:
parent
d19014a7d1
commit
e83a2b5ffc
|
@ -220,55 +220,55 @@ async fn scenario_cap_short_negotiation() -> Result<()> {
|
||||||
server.server.terminate().await?;
|
server.server.terminate().await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// #[tokio::test]
|
#[tokio::test]
|
||||||
// async fn scenario_cap_sasl_fail() -> std::result::Result<()> {
|
async fn scenario_cap_sasl_fail() -> std::result::Result<()> {
|
||||||
// let mut server = TestServer::start().await?;
|
let mut server = TestServer::start().await?;
|
||||||
//
|
|
||||||
// // test scenario
|
// test scenario
|
||||||
//
|
|
||||||
// server.storage.create_user("tester").await?;
|
server.storage.create_user("tester").await?;
|
||||||
// server.storage.set_password("tester", "password").await?;
|
server.storage.set_password("tester", "password").await?;
|
||||||
//
|
|
||||||
// let mut stream = TcpStream::connect(server.server.addr).await?;
|
let mut stream = TcpStream::connect(server.server.addr).await?;
|
||||||
// let mut s = TestScope::new(&mut stream);
|
let mut s = TestScope::new(&mut stream);
|
||||||
//
|
|
||||||
// s.send("CAP LS 302").await?;
|
s.send("CAP LS 302").await?;
|
||||||
// s.send("NICK tester").await?;
|
s.send("NICK tester").await?;
|
||||||
// s.send("USER UserName 0 * :Real Name").await?;
|
s.send("USER UserName 0 * :Real Name").await?;
|
||||||
// s.expect(":testserver CAP * LS :sasl=PLAIN").await?;
|
s.expect(":testserver CAP * LS :sasl=PLAIN").await?;
|
||||||
// s.send("CAP REQ :sasl").await?;
|
s.send("CAP REQ :sasl").await?;
|
||||||
// s.expect(":testserver CAP tester ACK :sasl").await?;
|
s.expect(":testserver CAP tester ACK :sasl").await?;
|
||||||
// s.send("AUTHENTICATE SHA256").await?;
|
s.send("AUTHENTICATE SHA256").await?;
|
||||||
// s.expect(":testserver 904 tester :Unsupported mechanism").await?;
|
s.expect(":testserver 904 tester :Unsupported mechanism").await?;
|
||||||
// s.send("AUTHENTICATE PLAIN").await?;
|
s.send("AUTHENTICATE PLAIN").await?;
|
||||||
// s.expect(":testserver AUTHENTICATE +").await?;
|
s.expect(":testserver AUTHENTICATE +").await?;
|
||||||
// s.send("AUTHENTICATE dGVzdGVyAHRlc3RlcgBwYXNzd29yZDE=").await?;
|
s.send("AUTHENTICATE dGVzdGVyAHRlc3RlcgBwYXNzd29yZDE=").await?;
|
||||||
// s.expect(":testserver 904 tester :Bad credentials").await?;
|
s.expect(":testserver 904 tester :Bad credentials").await?;
|
||||||
// s.send("AUTHENTICATE dGVzdGVyAHRlc3RlcgBwYXNzd29yZA==").await?; // base64-encoded 'tester\x00tester\x00password'
|
s.send("AUTHENTICATE dGVzdGVyAHRlc3RlcgBwYXNzd29yZA==").await?; // base64-encoded 'tester\x00tester\x00password'
|
||||||
// s.expect(":testserver 900 tester tester tester :You are now logged in as tester").await?;
|
s.expect(":testserver 900 tester tester tester :You are now logged in as tester").await?;
|
||||||
// s.expect(":testserver 903 tester :SASL authentication successful").await?;
|
s.expect(":testserver 903 tester :SASL authentication successful").await?;
|
||||||
//
|
|
||||||
// s.send("CAP END").await?;
|
s.send("CAP END").await?;
|
||||||
//
|
|
||||||
// s.expect(":testserver 001 tester :Welcome to Kek Server").await?;
|
s.expect(":testserver 001 tester :Welcome to Kek Server").await?;
|
||||||
// s.expect(":testserver 002 tester :Welcome to Kek Server").await?;
|
s.expect(":testserver 002 tester :Welcome to Kek Server").await?;
|
||||||
// s.expect(":testserver 003 tester :Welcome to Kek Server").await?;
|
s.expect(":testserver 003 tester :Welcome to Kek Server").await?;
|
||||||
// s.expect(":testserver 004 tester testserver kek-0.1.alpha.3 r CFILPQbcefgijklmnopqrstvz").await?;
|
s.expect(":testserver 004 tester testserver kek-0.1.alpha.3 r CFILPQbcefgijklmnopqrstvz").await?;
|
||||||
// s.expect(":testserver 005 tester CHANTYPES=# :are supported by this server").await?;
|
s.expect(":testserver 005 tester CHANTYPES=# :are supported by this server").await?;
|
||||||
// s.expect_nothing().await?;
|
s.expect_nothing().await?;
|
||||||
// s.send("QUIT :Leaving").await?;
|
s.send("QUIT :Leaving").await?;
|
||||||
// s.expect(":testserver ERROR :Leaving the server").await?;
|
s.expect(":testserver ERROR :Leaving the server").await?;
|
||||||
// s.expect_eof().await?;
|
s.expect_eof().await?;
|
||||||
//
|
|
||||||
// stream.shutdown().await?;
|
stream.shutdown().await?;
|
||||||
//
|
|
||||||
// // wrap up
|
// wrap up
|
||||||
//
|
|
||||||
// server.server.terminate().await?;
|
server.server.terminate().await?;
|
||||||
// Ok(())
|
Ok(())
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn terminate_socket_scenario() -> Result<()> {
|
async fn terminate_socket_scenario() -> Result<()> {
|
||||||
|
|
Loading…
Reference in New Issue