Debian Codegraph @

src/test.rs

raw symbols SCIP
1 use craterust-analyzer cargo linux-audit-parser 0.2.8 crate/::*;
2
3 #[cfg(feature = "serde")]
4 use serde_testrust-analyzer cargo serde_test 1.0.177 crate/::{assert_de_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_de_tokens()., assert_ser_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_ser_tokens()., Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#};
5
6 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
7 fn parserrust-analyzer cargo linux-audit-parser 0.2.8 test/parser().() {
8 // ensure that constant init works
9 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("--{}--", MessageTyperust-analyzer cargo linux-audit-parser 0.2.8 message_type/MessageType#::EOErust-analyzer cargo linux-audit-parser 0.2.8 message_type/impl#[MessageType]EOE.), "--EOE--");
10 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("--{}--", MessageTyperust-analyzer cargo linux-audit-parser 0.2.8 message_type/MessageType#(9999)), "--UNKNOWN[9999]--");
11
12 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-eoe.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
13 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(msg.tyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#ty., MessageTyperust-analyzer cargo linux-audit-parser 0.2.8 message_type/MessageType#::EOErust-analyzer cargo linux-audit-parser 0.2.8 message_type/impl#[MessageType]EOE.);
14 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
15 msg.idrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#id.,
16 EventIDrust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID# {
17 timestamprust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID#timestamp.: 1615225617302,
18 sequencerust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID#sequence.: 25836
19 }
20 );
21
22 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-syscall.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
23 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(msg.tyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#ty., MessageTyperust-analyzer cargo linux-audit-parser 0.2.8 message_type/MessageType#::SYSCALLrust-analyzer cargo linux-audit-parser 0.2.8 message_type/impl#[MessageType]SYSCALL.);
24 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
25 msg.idrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#id.,
26 EventIDrust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID# {
27 timestamprust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID#timestamp.: 1615114232375,
28 sequencerust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID#sequence.: 15558
29 }
30 );
31 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
32 msg.bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body.
33 .into_iterrust-analyzer cargo linux-audit-parser 0.2.8 body/impl#[`Body<'a>`][IntoIterator]into_iter().()
34 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(k, v)| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{k:?}: {v:?}"))
35 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(),
36 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!(
37 "arch: Num:<0xc000003e>",
38 "syscall: Num:<59>",
39 "success: Str:<yes>",
40 "exit: Num:<0>",
41 "a0: Num:<0x63b29337fd18>",
42 "a1: Num:<0x63b293387d58>",
43 "a2: Num:<0x63b293375640>",
44 "a3: Num:<0xfffffffffffff000>",
45 "items: Num:<2>",
46 "ppid: Num:<10883>",
47 "pid: Num:<10884>",
48 "auid: Num:<1000>",
49 "uid: Num:<0>",
50 "gid: Num:<0>",
51 "euid: Num:<0>",
52 "suid: Num:<0>",
53 "fsuid: Num:<0>",
54 "egid: Num:<0>",
55 "sgid: Num:<0>",
56 "fsgid: Num:<0>",
57 "tty: Str:<pts1>",
58 "ses: Num:<1>",
59 "comm: Str:<whoami>",
60 "exe: Str:</usr/bin/whoami>",
61 "key: Empty",
62 "ARCH: Str:<x86_64>",
63 "SYSCALL: Str:<execve>",
64 "AUID: Str:<user>",
65 "UID: Str:<root>",
66 "GID: Str:<root>",
67 "EUID: Str:<root>",
68 "SUID: Str:<root>",
69 "FSUID: Str:<root>",
70 "EGID: Str:<root>",
71 "SGID: Str:<root>",
72 "FSGID: Str:<root>",
73 )
74 );
75
76 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-execve.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
77 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(msg.tyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#ty., MessageTyperust-analyzer cargo linux-audit-parser 0.2.8 message_type/MessageType#::EXECVErust-analyzer cargo linux-audit-parser 0.2.8 message_type/impl#[MessageType]EXECVE.);
78 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
79 msg.idrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#id.,
80 EventIDrust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID# {
81 timestamprust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID#timestamp.: 1614788539386,
82 sequencerust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID#sequence.: 13232
83 }
84 );
85 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
86 msg.bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body.
87 .into_iterrust-analyzer cargo linux-audit-parser 0.2.8 body/impl#[`Body<'a>`][IntoIterator]into_iter().()
88 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(k, v)| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{k:?}: {v:?}"))
89 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(),
90 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!("argc: Num:<0>", "a0: Str:<whoami>")
91 );
92
93 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-path.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
94 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(msg.tyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#ty., MessageTyperust-analyzer cargo linux-audit-parser 0.2.8 message_type/MessageType#::PATHrust-analyzer cargo linux-audit-parser 0.2.8 message_type/impl#[MessageType]PATH.);
95 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
96 msg.idrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#id.,
97 EventIDrust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID# {
98 timestamprust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID#timestamp.: 1614788539386,
99 sequencerust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID#sequence.: 13232
100 }
101 );
102 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
103 msg.bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body.
104 .into_iterrust-analyzer cargo linux-audit-parser 0.2.8 body/impl#[`Body<'a>`][IntoIterator]into_iter().()
105 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(k, v)| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{k:?}: {v:?}"))
106 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(),
107 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!(
108 "item: Num:<0>",
109 "name: Str:</usr/bin/whoami>",
110 "inode: Num:<261214>",
111 "dev: Str:<ca:03>",
112 "mode: Num:<0o100755>",
113 "ouid: Num:<0>",
114 "ogid: Num:<0>",
115 "rdev: Str:<00:00>",
116 "nametype: Str:<NORMAL>",
117 "cap_fp: Num:<0x0>",
118 "cap_fi: Num:<0x0>",
119 "cap_fe: Num:<0>",
120 "cap_fver: Num:<0x0>",
121 )
122 );
123
124 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-path-enriched.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
125 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(msg.tyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#ty., MessageTyperust-analyzer cargo linux-audit-parser 0.2.8 message_type/MessageType#::PATHrust-analyzer cargo linux-audit-parser 0.2.8 message_type/impl#[MessageType]PATH.);
126 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
127 msg.idrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#id.,
128 EventIDrust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID# {
129 timestamprust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID#timestamp.: 1615113648978,
130 sequencerust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID#sequence.: 15219
131 }
132 );
133 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
134 msg.bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body.
135 .into_iterrust-analyzer cargo linux-audit-parser 0.2.8 body/impl#[`Body<'a>`][IntoIterator]into_iter().()
136 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(k, v)| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{k:?}: {v:?}"))
137 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(),
138 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!(
139 "item: Num:<1>",
140 "name: Str:</lib64/ld-linux-x86-64.so.2>",
141 "inode: Num:<262146>",
142 "dev: Str:<ca:03>",
143 "mode: Num:<0o100755>",
144 "ouid: Num:<0>",
145 "ogid: Num:<0>",
146 "rdev: Str:<00:00>",
147 "nametype: Str:<NORMAL>",
148 "cap_fp: Num:<0x0>",
149 "cap_fi: Num:<0x0>",
150 "cap_fe: Num:<0>",
151 "cap_fver: Num:<0x0>",
152 "OUID: Str:<root>",
153 "OGID: Str:<root>",
154 )
155 );
156
157 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-acct.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
158 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(msg.tyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#ty., MessageTyperust-analyzer cargo linux-audit-parser 0.2.8 message_type/MessageType#::USER_ACCTrust-analyzer cargo linux-audit-parser 0.2.8 message_type/impl#[MessageType]USER_ACCT.);
159 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
160 msg.idrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#id.,
161 EventIDrust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID# {
162 timestamprust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID#timestamp.: 1615113648981,
163 sequencerust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID#sequence.: 15220
164 }
165 );
166 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
167 msg.bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body.
168 .into_iterrust-analyzer cargo linux-audit-parser 0.2.8 body/impl#[`Body<'a>`][IntoIterator]into_iter().()
169 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(k, v)| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{k:?}: {v:?}"))
170 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(),
171 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!(
172 "pid: Num:<9460>",
173 "uid: Num:<1000>",
174 "auid: Num:<1000>",
175 "ses: Num:<1>",
176 "msg: Map:<op=Str:<PAM:accounting> grantors=Str:<pam_permit> acct=Str:<user> exe=Str:</usr/bin/sudo> hostname=Empty addr=Empty terminal=Str:</dev/pts/1> res=Str:<success>>",
177 "UID: Str:<user>",
178 "AUID: Str:<user>",
179 )
180 );
181
182 let msg = Parserrust-analyzer cargo linux-audit-parser 0.2.8 parser/Parser# {
183 enrichedrust-analyzer cargo linux-audit-parser 0.2.8 parser/Parser#enriched.: false,
184 split_msgrust-analyzer cargo linux-audit-parser 0.2.8 parser/Parser#split_msg.: false,
185 }
186 .parserust-analyzer cargo linux-audit-parser 0.2.8 parser/impl#[Parser]parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-acct.txt"))
187 .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
188 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
189 msg.bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body.
190 .into_iterrust-analyzer cargo linux-audit-parser 0.2.8 body/impl#[`Body<'a>`][IntoIterator]into_iter().()
191 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(k, v)| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{k:?}: {v:?}"))
192 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(),
193 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!(
194 "pid: Num:<9460>",
195 "uid: Num:<1000>",
196 "auid: Num:<1000>",
197 "ses: Num:<1>",
198 r#"msg: Str:<op=PAM:accounting grantors=pam_permit acct="user" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success>"#,
199 )
200 );
201
202 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-unknown.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
203 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(msg.tyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#ty., MessageTyperust-analyzer cargo linux-audit-parser 0.2.8 message_type/MessageType#::BPFrust-analyzer cargo linux-audit-parser 0.2.8 message_type/impl#[MessageType]BPF.);
204 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
205 msg.idrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#id.,
206 EventIDrust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID# {
207 timestamprust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID#timestamp.: 1626883065201,
208 sequencerust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID#sequence.: 216697
209 }
210 );
211
212 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-avc-denied.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
213 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(msg.tyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#ty., MessageTyperust-analyzer cargo linux-audit-parser 0.2.8 message_type/MessageType#::AVCrust-analyzer cargo linux-audit-parser 0.2.8 message_type/impl#[MessageType]AVC.);
214 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
215 msg.bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body.
216 .into_iterrust-analyzer cargo linux-audit-parser 0.2.8 body/impl#[`Body<'a>`][IntoIterator]into_iter().()
217 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(k, v)| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{k:?}: {v:?}"))
218 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(),
219 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!(
220 "pid: Num:<15381>",
221 "comm: Str:<laurel>",
222 "capability: Num:<7>",
223 "scontext: Str:<system_u:system_r:auditd_t:s0>",
224 "tcontext: Str:<system_u:system_r:auditd_t:s0>",
225 "tclass: Str:<capability>",
226 "permissive: Num:<1>",
227 "denied: List:<setuid>",
228 )
229 );
230
231 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-avc-granted.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
232 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(msg.tyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#ty., MessageTyperust-analyzer cargo linux-audit-parser 0.2.8 message_type/MessageType#::AVCrust-analyzer cargo linux-audit-parser 0.2.8 message_type/impl#[MessageType]AVC.);
233 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
234 msg.bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body.
235 .into_iterrust-analyzer cargo linux-audit-parser 0.2.8 body/impl#[`Body<'a>`][IntoIterator]into_iter().()
236 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(k, v)| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{k:?}: {v:?}"))
237 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(),
238 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!(
239 "pid: Num:<11209>",
240 "comm: Str:<tuned>",
241 "scontext: Str:<system_u:system_r:tuned_t:s0>",
242 "tcontext: Str:<system_u:object_r:security_t:s0>",
243 "tclass: Str:<security>",
244 "granted: List:<setsecparam>",
245 )
246 );
247
248 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-netlabel.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
249 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(msg.tyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#ty., MessageTyperust-analyzer cargo linux-audit-parser 0.2.8 message_type/MessageType#::MAC_UNLBL_ALLOWrust-analyzer cargo linux-audit-parser 0.2.8 message_type/impl#[MessageType]MAC_UNLBL_ALLOW.);
250 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
251 msg.bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body.
252 .into_iterrust-analyzer cargo linux-audit-parser 0.2.8 body/impl#[`Body<'a>`][IntoIterator]into_iter().()
253 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(k, v)| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{k:?}: {v:?}"))
254 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(),
255 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!(
256 "auid: Num:<0>",
257 "ses: Num:<0>",
258 // FIXME: strings should be numbers
259 "unlbl_accept: Str:<1>",
260 "old: Str:<0>",
261 "AUID: Str:<root>",
262 "netlabel: Empty",
263 )
264 );
265
266 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-broken-subj1.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
267 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
268 msg.bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body.
269 .into_iterrust-analyzer cargo linux-audit-parser 0.2.8 body/impl#[`Body<'a>`][IntoIterator]into_iter().()
270 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(k, v)| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{k:?}: {v:?}"))
271 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(),
272 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!(
273 "arch: Num:<0xc000003e>",
274 "syscall: Num:<59>",
275 "success: Str:<yes>",
276 "exit: Num:<0>",
277 "a0: Num:<0x55b26d44a6a0>",
278 "a1: Num:<0x55b26d44a878>",
279 "a2: Num:<0x55b26d44a8e8>",
280 "a3: Num:<0x7faeccab5850>",
281 "items: Num:<2>",
282 "ppid: Num:<659>",
283 "pid: Num:<661>",
284 "auid: Num:<4294967295>",
285 "uid: Num:<0>",
286 "gid: Num:<0>",
287 "euid: Num:<0>",
288 "suid: Num:<0>",
289 "fsuid: Num:<0>",
290 "egid: Num:<0>",
291 "sgid: Num:<0>",
292 "fsgid: Num:<0>",
293 "tty: Str:<(none)>",
294 "ses: Num:<4294967295>",
295 "comm: Str:<dhclient>",
296 "exe: Str:</sbin/dhclient>",
297 "subj: Str:</{,usr/}sbin/dhclient>",
298 "key: Empty",
299 )
300 );
301
302 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-broken-subj2.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
303 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
304 msg.bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body.
305 .into_iterrust-analyzer cargo linux-audit-parser 0.2.8 body/impl#[`Body<'a>`][IntoIterator]into_iter().()
306 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(k, v)| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{k:?}: {v:?}"))
307 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(),
308 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!(
309 "arch: Num:<0xc000003e>",
310 "syscall: Num:<49>",
311 "success: Str:<yes>",
312 "exit: Num:<0>",
313 "a0: Num:<0x15>",
314 "a1: Num:<0x55c5e046e264>",
315 "a2: Num:<0x1c>",
316 "a3: Num:<0x7ffc8fab77ec>",
317 "items: Num:<0>",
318 "ppid: Num:<1899774>",
319 "pid: Num:<1899780>",
320 "auid: Num:<4294967295>",
321 "uid: Num:<0>",
322 "gid: Num:<0>",
323 "euid: Num:<0>",
324 "suid: Num:<0>",
325 "fsuid: Num:<0>",
326 "egid: Num:<0>",
327 "sgid: Num:<0>",
328 "fsgid: Num:<0>",
329 "tty: Str:<(none)>",
330 "ses: Num:<4294967295>",
331 "comm: Str:<ntpd>",
332 "exe: Str:</usr/sbin/ntpd>",
333 "subj: Str:<=/usr/sbin/ntpd (enforce)>",
334 "key: Empty",
335 )
336 );
337
338 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-broken-avc-info.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
339 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
340 msg.bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body.
341 .into_iterrust-analyzer cargo linux-audit-parser 0.2.8 body/impl#[`Body<'a>`][IntoIterator]into_iter().()
342 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(k, v)| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{k:?}: {v:?}"))
343 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(),
344 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!(
345 "apparmor: Str:<STATUS>",
346 "operation: Str:<profile_replace>",
347 "info: Str:<same as current profile, skipping>",
348 "profile: Str:<unconfined>",
349 "name: Str:<snap-update-ns.amazon-ssm-agent>",
350 "pid: Num:<3981295>",
351 "comm: Str:<apparmor_parser>",
352 )
353 );
354
355 for enriched in [true, false] {
356 for split_msg in [true, false] {
357 for (n, line) in [
358 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-acct-lock.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
359 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-add-group.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
360 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-add-user.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
361 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-anom-abend-2.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
362 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-anom-abend.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
363 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-avc-denied.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
364 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-avc-granted.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
365 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-bpf.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
366 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-broken-avc-info.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
367 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-broken-subj1.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
368 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-broken-subj2.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
369 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-chgrp-id.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
370 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-cred-acq.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
371 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-cred-disp.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
372 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-cred-refr.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
373 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-crypto-key-user.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
374 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-crypto-param-change-user.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
375 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-crypto-session.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
376 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-daemon-end-2.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
377 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-daemon-end.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
378 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-daemon-start.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
379 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-del-group.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
380 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-del-user.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
381 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-eoe.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
382 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-execve.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
383 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-grp-mgmt.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
384 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-mac-policy-load.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
385 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-netfilter.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
386 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-netlabel.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
387 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-path-enriched.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
388 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-path.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
389 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-sockaddr-unix-2.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
390 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-sockaddr-unix.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
391 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-sockaddr-unknown-1.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
392 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-sockaddr-unknown-2.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
393 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-sockaddr-unknown-3.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
394 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-software-update.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
395 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-syscall.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
396 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-tty.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
397 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-unknown.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
398 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-uringop.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
399 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-acct.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
400 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-auth-2.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
401 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-auth.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
402 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-avc-1.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
403 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-avc-2.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
404 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-chauthtok.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
405 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-end.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
406 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-err.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
407 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-login.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
408 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-logout.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
409 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-mgmt.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
410 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-role-change.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
411 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-selinux-err.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
412 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-start.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
413 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-usys-config.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
414 ]
415 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
416 .enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().()
417 {
418 Parserrust-analyzer cargo linux-audit-parser 0.2.8 parser/Parser# {
419 enrichedrust-analyzer cargo linux-audit-parser 0.2.8 parser/Parser#enriched.,
420 split_msgrust-analyzer cargo linux-audit-parser 0.2.8 parser/Parser#split_msg.,
421 }
422 .parserust-analyzer cargo linux-audit-parser 0.2.8 parser/impl#[Parser]parse().(line)
423 .unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_or_else().(|_| {
424 panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("failed to parse {n} (enriched={enriched}, split_msg={split_msg}")
425 });
426 }
427 }
428 }
429 }
430
431 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
432 fn test_msg_kvrust-analyzer cargo linux-audit-parser 0.2.8 test/test_msg_kv().() {
433 let p = Parserrust-analyzer cargo linux-audit-parser 0.2.8 parser/Parser# {
434 split_msgrust-analyzer cargo linux-audit-parser 0.2.8 parser/Parser#split_msg.: true,
435 ..Parserrust-analyzer cargo linux-audit-parser 0.2.8 parser/Parser#::defaultrust-analyzer cargo linux-audit-parser 0.2.8 parser/impl#[Parser][Default]default().()
436 };
437 for (n, line) in [
438 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-acct-lock.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
439 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-add-group.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
440 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-add-user.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
441 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-chgrp-id.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
442 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-cred-acq.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
443 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-cred-disp.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
444 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-cred-refr.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
445 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-crypto-key-user.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
446 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-crypto-session.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
447 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-crypto-param-change-user.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
448 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-daemon-end-2.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
449 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-del-group.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
450 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-del-user.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
451 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-grp-mgmt.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
452 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-software-update.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
453 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-acct.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
454 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-auth.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
455 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-auth-2.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
456 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-chauthtok.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
457 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-end.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
458 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-err.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
459 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-login.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
460 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-logout.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
461 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-mgmt.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
462 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-role-change.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
463 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-start.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
464 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-usys-config.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
465 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-avc-1.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
466 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-avc-2.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
467 &include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-user-selinux-err.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
468 ]
469 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
470 .enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().()
471 {
472 let Messagerust-analyzer cargo linux-audit-parser 0.2.8 message/Message# {
473 noderust-analyzer cargo linux-audit-parser 0.2.8 message/Message#node.: _,
474 tyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#ty.: _,
475 idrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#id.,
476 bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body.,
477 } = p.parserust-analyzer cargo linux-audit-parser 0.2.8 parser/impl#[Parser]parse().(line).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
478 printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("test {n}: {id}: {body:?}");
479 let msg = body
480 .getrust-analyzer cargo linux-audit-parser 0.2.8 body/impl#[`Body<'_>`]get().("msg")
481 .unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or_else().(|| panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("test {n}: {id}: Field msg not found"));
482 match msg {
483 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Maprust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Map#(_) => {}
484 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Strrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Str#(_, _) => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("test {n}: {id}: Field msg was parsed as string"),
485 _ => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("test {n}: {id}: Field msg was parsed as something else"),
486 }
487 }
488 }
489
490 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
491 fn breakage_sockaddr_unknownrust-analyzer cargo linux-audit-parser 0.2.8 test/breakage_sockaddr_unknown().() {
492 parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(
493 include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-sockaddr-unknown-1.txt"),
494 false,
495 )
496 .expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("can't parse line-sockaddr-unknown-1.txt");
497 parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(
498 include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-sockaddr-unknown-2.txt"),
499 false,
500 )
501 .expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("can't parse line-sockaddr-unknown-2.txt");
502 parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(
503 include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-sockaddr-unknown-3.txt"),
504 false,
505 )
506 .expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("can't parse line-sockaddr-unknown-3.txt");
507 }
508
509 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
510 #[cfg(feature = "serde")]
511 fn serde_messagetyperust-analyzer cargo linux-audit-parser 0.2.8 test/serde_messagetype().() {
512 assert_ser_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_ser_tokens().(&MessageTyperust-analyzer cargo linux-audit-parser 0.2.8 message_type/MessageType#::SYSCALLrust-analyzer cargo linux-audit-parser 0.2.8 message_type/impl#[MessageType]SYSCALL., &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("SYSCALL")]);
513 assert_ser_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_ser_tokens().(&MessageTyperust-analyzer cargo linux-audit-parser 0.2.8 message_type/MessageType#(20000), &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("UNKNOWN[20000]")]);
514 }
515
516 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
517 #[cfg(feature = "serde")]
518 fn serde_keyrust-analyzer cargo linux-audit-parser 0.2.8 test/serde_key().() {
519 for (obj, tok) in &[
520 (&Keyrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#::Namerust-analyzer cargo linux-audit-parser 0.2.8 key/Key#Name#(b"foo"[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()), &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("foo")]),
521 (&Keyrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#::NameUIDrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#NameUID#(b"euid"[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()), &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("euid")]),
522 (&Keyrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#::NameGIDrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#NameGID#(b"egid"[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()), &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("egid")]),
523 (&Keyrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#::Commonrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#Common#(Commonrust-analyzer cargo linux-audit-parser 0.2.8 key/Common#::Archrust-analyzer cargo linux-audit-parser 0.2.8 key/Common#Arch#), &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("arch")]),
524 (&Keyrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#::Argrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#Arg#(1, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#), &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("a1")]),
525 (&Keyrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#::Argrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#Arg#(2, Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(3)), &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("a2[3]")]),
526 (&Keyrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#::ArgLenrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#ArgLen#(2), &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("a2_len")]),
527 ] {
528 assert_ser_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_ser_tokens().(obj, *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().tok);
529 assert_de_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_de_tokens().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().obj, *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().tok);
530 }
531
532 for (obj, tok) in &[
533 (
534 &Keyrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#::NameTranslatedrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#NameTranslated#(b"foo"[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
535 &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("FOO")],
536 ),
537 (&Keyrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#::Literalrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#Literal#("foo"), &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("foo")]),
538 ] {
539 assert_ser_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_ser_tokens().(obj, *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().tok);
540 }
541 }
542
543 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
544 #[cfg(feature = "serde")]
545 fn serde_valuerust-analyzer cargo linux-audit-parser 0.2.8 test/serde_value().() {
546 for q in &[Quoterust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#::Nonerust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#None#, Quoterust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#::Singlerust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#Single#, Quoterust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#::Doublerust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#Double#] {
547 assert_ser_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_ser_tokens().(&Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Strrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Str#(&b"foo"[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().q), &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Bytesrust-analyzer cargo serde_test 1.0.177 token/Token#Bytes#(b"foo")]);
548 }
549 assert_ser_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_ser_tokens().(
550 &Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Strrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Str#(&b"foo"[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., Quoterust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#::Bracesrust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#Braces#),
551 &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Bytesrust-analyzer cargo serde_test 1.0.177 token/Token#Bytes#(b"{foo}")],
552 );
553
554 for (obj, tok) in &[
555 (Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Emptyrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Empty#, &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Unitrust-analyzer cargo serde_test 1.0.177 token/Token#Unit#][rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().),
556 (Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Ownedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Owned#(b"foo".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()), &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Bytesrust-analyzer cargo serde_test 1.0.177 token/Token#Bytes#(b"foo")]),
557 (Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Number#(Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Hexrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Hex#(16)), &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("0x10")]),
558 (Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Number#(Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Octrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Oct#(16)), &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("0o20")]),
559 (Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Number#(Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Decrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Dec#(16)), &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::I64rust-analyzer cargo serde_test 1.0.177 token/Token#I64#(16)]),
560 (
561 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Listrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#List#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![]),
562 &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Seqrust-analyzer cargo serde_test 1.0.177 token/Token#Seq# { lenrust-analyzer cargo serde_test 1.0.177 token/Token#Seq#len.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(0) }, Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::SeqEndrust-analyzer cargo serde_test 1.0.177 token/Token#SeqEnd#][rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().,
563 ),
564 (
565 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Listrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#List#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![
566 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Ownedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Owned#(b"foo".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()),
567 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Ownedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Owned#(b"bar".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()),
568 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Ownedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Owned#(b"baz".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()),
569 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::fromrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'_>`][`From<i64>`]from().(42),
570 ]),
571 &[
572 Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Seqrust-analyzer cargo serde_test 1.0.177 token/Token#Seq# { lenrust-analyzer cargo serde_test 1.0.177 token/Token#Seq#len.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(4) },
573 Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Bytesrust-analyzer cargo serde_test 1.0.177 token/Token#Bytes#(b"foo"),
574 Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Bytesrust-analyzer cargo serde_test 1.0.177 token/Token#Bytes#(b"bar"),
575 Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Bytesrust-analyzer cargo serde_test 1.0.177 token/Token#Bytes#(b"baz"),
576 Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::I64rust-analyzer cargo serde_test 1.0.177 token/Token#I64#(42),
577 Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::SeqEndrust-analyzer cargo serde_test 1.0.177 token/Token#SeqEnd#,
578 ][rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().,
579 ),
580 (
581 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Maprust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Map#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![]),
582 &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Maprust-analyzer cargo serde_test 1.0.177 token/Token#Map# { lenrust-analyzer cargo serde_test 1.0.177 token/Token#Map#len.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(0) }, Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::MapEndrust-analyzer cargo serde_test 1.0.177 token/Token#MapEnd#][rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().,
583 ),
584 (
585 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Maprust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Map#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![(
586 Keyrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#::Namerust-analyzer cargo linux-audit-parser 0.2.8 key/Key#Name#(b"foo"[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
587 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Ownedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Owned#(b"bar".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()),
588 )]),
589 &[
590 Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Maprust-analyzer cargo serde_test 1.0.177 token/Token#Map# { lenrust-analyzer cargo serde_test 1.0.177 token/Token#Map#len.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(1) },
591 Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("foo"),
592 Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Bytesrust-analyzer cargo serde_test 1.0.177 token/Token#Bytes#(b"bar"),
593 Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::MapEndrust-analyzer cargo serde_test 1.0.177 token/Token#MapEnd#,
594 ][rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().,
595 ),
596 ] {
597 assert_ser_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_ser_tokens().(obj, &tok[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().);
598 assert_de_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_de_tokens().(obj, &tok[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().);
599 }
600 }
601
602 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
603 #[cfg(feature = "serde")]
604 fn serde_numberrust-analyzer cargo linux-audit-parser 0.2.8 test/serde_number().() {
605 for (n, t) in &[
606 (Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Decrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Dec#(10), Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::I64rust-analyzer cargo serde_test 1.0.177 token/Token#I64#(10)),
607 (Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Hexrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Hex#(0x10), Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("0x10")),
608 (Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Octrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Oct#(0o10), Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("0o10")),
609 ] {
610 assert_ser_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_ser_tokens().(n, &[*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().t]);
611 assert_de_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_de_tokens().(n, &[*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().t]);
612 }
613 assert_de_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_de_tokens().(&Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Decrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Dec#(10), &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::U64rust-analyzer cargo serde_test 1.0.177 token/Token#U64#(10)]);
614 }
615
616 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
617 #[cfg(feature = "serde")]
618 fn serde_event_idrust-analyzer cargo linux-audit-parser 0.2.8 test/serde_event_id().() {
619 let obj = EventIDrust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID# {
620 timestamprust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID#timestamp.: 1615225617302,
621 sequencerust-analyzer cargo linux-audit-parser 0.2.8 event_id/EventID#sequence.: 25836,
622 };
623 let tok = Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("1615225617.302:25836");
624
625 assert_ser_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_ser_tokens().(&obj, &[tok]);
626 assert_de_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_de_tokens().(&obj, &[tok]);
627 }
628
629 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
630 #[cfg(feature = "serde")]
631 fn serde_message_typerust-analyzer cargo linux-audit-parser 0.2.8 test/serde_message_type().() {
632 for (m, t) in &[
633 (MessageTyperust-analyzer cargo linux-audit-parser 0.2.8 message_type/MessageType#::SYSCALLrust-analyzer cargo linux-audit-parser 0.2.8 message_type/impl#[MessageType]SYSCALL., Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("SYSCALL")),
634 (MessageTyperust-analyzer cargo linux-audit-parser 0.2.8 message_type/MessageType#(9999), Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("UNKNOWN[9999]")),
635 ] {
636 assert_ser_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_ser_tokens().(m, &[*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().t]);
637 assert_de_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_de_tokens().(m, &[*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().t]);
638 }
639 }
640
641 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
642 #[cfg(feature = "serde")]
643 fn serde_messagerust-analyzer cargo linux-audit-parser 0.2.8 test/serde_message().() {
644 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-eoe.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
645 assert_ser_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_ser_tokens().(&msg.bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body., &[Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Maprust-analyzer cargo serde_test 1.0.177 token/Token#Map# { lenrust-analyzer cargo serde_test 1.0.177 token/Token#Map#len.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(0) }, Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::MapEndrust-analyzer cargo serde_test 1.0.177 token/Token#MapEnd#]);
646
647 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-execve.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
648 assert_ser_tokensrust-analyzer cargo serde_test 1.0.177 assert/assert_ser_tokens().(
649 &msg.bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body.,
650 &[
651 Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Maprust-analyzer cargo serde_test 1.0.177 token/Token#Map# { lenrust-analyzer cargo serde_test 1.0.177 token/Token#Map#len.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(2) },
652 Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("argc"),
653 Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::I64rust-analyzer cargo serde_test 1.0.177 token/Token#I64#(0),
654 Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Stringrust-analyzer cargo serde_test 1.0.177 token/Token#String#("a0"),
655 Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::Bytesrust-analyzer cargo serde_test 1.0.177 token/Token#Bytes#(b"whoami"),
656 Tokenrust-analyzer cargo serde_test 1.0.177 token/Token#::MapEndrust-analyzer cargo serde_test 1.0.177 token/Token#MapEnd#,
657 ],
658 );
659 }
660
661 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
662 fn parse_uringoprust-analyzer cargo linux-audit-parser 0.2.8 test/parse_uringop().() {
663 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-uringop.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
664 printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("{msg:?}");
665 let v = msg
666 .bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body.
667 .getrust-analyzer cargo linux-audit-parser 0.2.8 body/impl#[`Body<'_>`]get().("uring_op")
668 .unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or_else().(|| panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("{}: uring_op not found", msg.idrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#id.));
669 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().v, Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Number#(Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Decrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Dec#(18)));
670 }
671
672 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
673 fn parse_bpfrust-analyzer cargo linux-audit-parser 0.2.8 test/parse_bpf().() {
674 let msg = parserust-analyzer cargo linux-audit-parser 0.2.8 parser/parse().(include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-bpf.txt"), false).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
675 printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("{msg:?}");
676 let v = msg
677 .bodyrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#body.
678 .getrust-analyzer cargo linux-audit-parser 0.2.8 body/impl#[`Body<'_>`]get().("prog-id")
679 .unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or_else().(|| panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("{}: prog-id not found", msg.idrust-analyzer cargo linux-audit-parser 0.2.8 message/Message#id.));
680 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().v, Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Number#(Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Decrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Dec#(75)));
681 }
682
683 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
684
685 fn specialrust-analyzer cargo linux-audit-parser 0.2.8 test/special().() {
686 Parserrust-analyzer cargo linux-audit-parser 0.2.8 parser/Parser# {
687 enrichedrust-analyzer cargo linux-audit-parser 0.2.8 parser/Parser#enriched.: false,
688 split_msgrust-analyzer cargo linux-audit-parser 0.2.8 parser/Parser#split_msg.: false,
689 }
690 .parserust-analyzer cargo linux-audit-parser 0.2.8 parser/impl#[Parser]parse().(&include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("testdata/line-daemon-start.txt")[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().)
691 .unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_or_else().(|e| panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("{e}"));
692 }