@@ -204,7 +204,7 @@ def test_xattr_ignored(
204204 )
205205
206206
207- def test_setxattr_new_file (
207+ def test_xattr_new_file (
208208 monitored_dir : str ,
209209 server : FileActivityService ,
210210):
@@ -238,6 +238,7 @@ def test_setxattr_new_file(
238238 )
239239
240240 os .setxattr (test_file , 'user.new_file' , b'value' )
241+ os .removexattr (test_file , 'user.new_file' )
241242
242243 server .wait_events (
243244 skip_xattr = False ,
@@ -249,6 +250,13 @@ def test_setxattr_new_file(
249250 host_path = test_file ,
250251 xattr_name = 'user.new_file' ,
251252 ),
253+ Event (
254+ process = process ,
255+ event_type = EventType .XATTR_REMOVE ,
256+ file = '' ,
257+ host_path = test_file ,
258+ xattr_name = 'user.new_file' ,
259+ ),
252260 ],
253261 )
254262
@@ -264,7 +272,7 @@ def test_setxattr_new_file(
264272 pytest .param (b'xattr\xff \xfe .txt' , id = 'InvalidUTF8' ),
265273 ],
266274)
267- def test_setxattr_utf8_filenames (
275+ def test_xattr_utf8_filenames (
268276 monitored_dir : str ,
269277 server : FileActivityService ,
270278 filename : str | bytes ,
@@ -301,6 +309,7 @@ def test_setxattr_utf8_filenames(
301309 )
302310
303311 os .setxattr (fut , 'user.utf8_test' , b'value' )
312+ os .removexattr (fut , 'user.utf8_test' )
304313
305314 server .wait_events (
306315 skip_xattr = False ,
@@ -312,5 +321,12 @@ def test_setxattr_utf8_filenames(
312321 host_path = fut_str ,
313322 xattr_name = 'user.utf8_test' ,
314323 ),
324+ Event (
325+ process = process ,
326+ event_type = EventType .XATTR_REMOVE ,
327+ file = '' ,
328+ host_path = fut_str ,
329+ xattr_name = 'user.utf8_test' ,
330+ ),
315331 ],
316332 )
0 commit comments