diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-07-25 21:37:51 +0200 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-07-25 21:37:51 +0200 |
commit | 3b25c9ea70b2e953fc887abe66bd5e0cf94e61e7 (patch) | |
tree | ed185322aed9cfa339df468015a2c40e099c1a7f /src | |
parent | 5f6d7707f37ecb36423cf7bef62abd06d351e2de (diff) |
add PAP Authenticate-Ack serialization test
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -1091,4 +1091,30 @@ mod tests { ); Ok(()) } + + #[test] + fn test_serialize_pap_authenticate_ack() -> Result<()> { + let authenticate_ack = PPPoEFullPkt::new_ppp( + [0x00, 0x00, 0x5e, 0x00, 0x53, 0x02].into(), + [0x00, 0x00, 0x5e, 0x00, 0x53, 0x01].into(), + 1, + PPPFullPkt::new_pap(PAPFullPkt::new_authenticate_ack( + 0x41, + PAPString("ok".into()), + )), + ); + + let mut buf = Vec::new(); + authenticate_ack.serialize(&mut buf)?; + + assert_eq!( + &buf, + &[ + 0x00, 0x00, 0x5e, 0x00, 0x53, 0x02, 0x00, 0x00, 0x5e, 0x00, 0x53, 0x01, 0x88, 0x64, + 0x11, 0x00, 0x00, 0x01, 0x00, 0x09, 0xc0, 0x23, 0x02, 0x41, 0x00, 0x07, 0x02, 0x6f, + 0x6b + ] + ); + Ok(()) + } } |