Skip to content

Commit 65d55a4

Browse files
authored
test(s2n-quic-dc): add tests for map events (#2363)
1 parent fcdb914 commit 65d55a4

15 files changed

+3247
-1273
lines changed

dc/s2n-quic-dc/events/map.rs

+40
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ struct PathSecretMapBackgroundHandshakeRequested<'a> {
3131
struct PathSecretMapEntryInserted<'a> {
3232
peer_address: SocketAddress<'a>,
3333

34+
#[snapshot("[HIDDEN]")]
3435
credential_id: &'a [u8],
3536
}
3637

@@ -40,6 +41,7 @@ struct PathSecretMapEntryInserted<'a> {
4041
struct PathSecretMapEntryReady<'a> {
4142
peer_address: SocketAddress<'a>,
4243

44+
#[snapshot("[HIDDEN]")]
4345
credential_id: &'a [u8],
4446
}
4547

@@ -49,8 +51,10 @@ struct PathSecretMapEntryReady<'a> {
4951
struct PathSecretMapEntryReplaced<'a> {
5052
peer_address: SocketAddress<'a>,
5153

54+
#[snapshot("[HIDDEN]")]
5255
new_credential_id: &'a [u8],
5356

57+
#[snapshot("[HIDDEN]")]
5458
previous_credential_id: &'a [u8],
5559
}
5660

@@ -59,6 +63,8 @@ struct PathSecretMapEntryReplaced<'a> {
5963
/// Emitted when an UnknownPathSecret packet was sent
6064
struct UnknownPathSecretPacketSent<'a> {
6165
peer_address: SocketAddress<'a>,
66+
67+
#[snapshot("[HIDDEN]")]
6268
credential_id: &'a [u8],
6369
}
6470

@@ -67,6 +73,8 @@ struct UnknownPathSecretPacketSent<'a> {
6773
/// Emitted when an UnknownPathSecret packet was received
6874
struct UnknownPathSecretPacketReceived<'a> {
6975
peer_address: SocketAddress<'a>,
76+
77+
#[snapshot("[HIDDEN]")]
7078
credential_id: &'a [u8],
7179
}
7280

@@ -75,6 +83,8 @@ struct UnknownPathSecretPacketReceived<'a> {
7583
/// Emitted when an UnknownPathSecret packet was authentic and processed
7684
struct UnknownPathSecretPacketAccepted<'a> {
7785
peer_address: SocketAddress<'a>,
86+
87+
#[snapshot("[HIDDEN]")]
7888
credential_id: &'a [u8],
7989
}
8090

@@ -83,6 +93,8 @@ struct UnknownPathSecretPacketAccepted<'a> {
8393
/// Emitted when an UnknownPathSecret packet was rejected as invalid
8494
struct UnknownPathSecretPacketRejected<'a> {
8595
peer_address: SocketAddress<'a>,
96+
97+
#[snapshot("[HIDDEN]")]
8698
credential_id: &'a [u8],
8799
}
88100

@@ -91,14 +103,18 @@ struct UnknownPathSecretPacketRejected<'a> {
91103
/// Emitted when an UnknownPathSecret packet was dropped due to a missing entry
92104
struct UnknownPathSecretPacketDropped<'a> {
93105
peer_address: SocketAddress<'a>,
106+
107+
#[snapshot("[HIDDEN]")]
94108
credential_id: &'a [u8],
95109
}
96110

97111
#[event("path_secret_map:replay_definitely_detected")]
98112
#[subject(endpoint)]
99113
/// Emitted when credential replay was definitely detected
100114
struct ReplayDefinitelyDetected<'a> {
115+
#[snapshot("[HIDDEN]")]
101116
credential_id: &'a [u8],
117+
102118
key_id: u64,
103119
}
104120

@@ -107,8 +123,11 @@ struct ReplayDefinitelyDetected<'a> {
107123
/// Emitted when credential replay was potentially detected, but could not be verified
108124
/// due to a limiting tracking window
109125
struct ReplayPotentiallyDetected<'a> {
126+
#[snapshot("[HIDDEN]")]
110127
credential_id: &'a [u8],
128+
111129
key_id: u64,
130+
112131
gap: u64,
113132
}
114133

@@ -117,6 +136,8 @@ struct ReplayPotentiallyDetected<'a> {
117136
/// Emitted when an ReplayDetected packet was sent
118137
struct ReplayDetectedPacketSent<'a> {
119138
peer_address: SocketAddress<'a>,
139+
140+
#[snapshot("[HIDDEN]")]
120141
credential_id: &'a [u8],
121142
}
122143

@@ -125,6 +146,8 @@ struct ReplayDetectedPacketSent<'a> {
125146
/// Emitted when an ReplayDetected packet was received
126147
struct ReplayDetectedPacketReceived<'a> {
127148
peer_address: SocketAddress<'a>,
149+
150+
#[snapshot("[HIDDEN]")]
128151
credential_id: &'a [u8],
129152
}
130153

@@ -133,7 +156,10 @@ struct ReplayDetectedPacketReceived<'a> {
133156
/// Emitted when an StaleKey packet was authentic and processed
134157
struct ReplayDetectedPacketAccepted<'a> {
135158
peer_address: SocketAddress<'a>,
159+
160+
#[snapshot("[HIDDEN]")]
136161
credential_id: &'a [u8],
162+
137163
key_id: u64,
138164
}
139165

@@ -142,6 +168,8 @@ struct ReplayDetectedPacketAccepted<'a> {
142168
/// Emitted when an ReplayDetected packet was rejected as invalid
143169
struct ReplayDetectedPacketRejected<'a> {
144170
peer_address: SocketAddress<'a>,
171+
172+
#[snapshot("[HIDDEN]")]
145173
credential_id: &'a [u8],
146174
}
147175

@@ -150,6 +178,8 @@ struct ReplayDetectedPacketRejected<'a> {
150178
/// Emitted when an ReplayDetected packet was dropped due to a missing entry
151179
struct ReplayDetectedPacketDropped<'a> {
152180
peer_address: SocketAddress<'a>,
181+
182+
#[snapshot("[HIDDEN]")]
153183
credential_id: &'a [u8],
154184
}
155185

@@ -158,6 +188,8 @@ struct ReplayDetectedPacketDropped<'a> {
158188
/// Emitted when an StaleKey packet was sent
159189
struct StaleKeyPacketSent<'a> {
160190
peer_address: SocketAddress<'a>,
191+
192+
#[snapshot("[HIDDEN]")]
161193
credential_id: &'a [u8],
162194
}
163195

@@ -166,6 +198,8 @@ struct StaleKeyPacketSent<'a> {
166198
/// Emitted when an StaleKey packet was received
167199
struct StaleKeyPacketReceived<'a> {
168200
peer_address: SocketAddress<'a>,
201+
202+
#[snapshot("[HIDDEN]")]
169203
credential_id: &'a [u8],
170204
}
171205

@@ -174,6 +208,8 @@ struct StaleKeyPacketReceived<'a> {
174208
/// Emitted when an StaleKey packet was authentic and processed
175209
struct StaleKeyPacketAccepted<'a> {
176210
peer_address: SocketAddress<'a>,
211+
212+
#[snapshot("[HIDDEN]")]
177213
credential_id: &'a [u8],
178214
}
179215

@@ -182,6 +218,8 @@ struct StaleKeyPacketAccepted<'a> {
182218
/// Emitted when an StaleKey packet was rejected as invalid
183219
struct StaleKeyPacketRejected<'a> {
184220
peer_address: SocketAddress<'a>,
221+
222+
#[snapshot("[HIDDEN]")]
185223
credential_id: &'a [u8],
186224
}
187225

@@ -190,5 +228,7 @@ struct StaleKeyPacketRejected<'a> {
190228
/// Emitted when an StaleKey packet was dropped due to a missing entry
191229
struct StaleKeyPacketDropped<'a> {
192230
peer_address: SocketAddress<'a>,
231+
232+
#[snapshot("[HIDDEN]")]
193233
credential_id: &'a [u8],
194234
}

0 commit comments

Comments
 (0)