Skip to content

Commit b9cb83b

Browse files
committed
Extended test_setxattr_ignored with removexattr and renamed it
1 parent 71934ae commit b9cb83b

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

tests/test_xattr.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def test_setxattr_multiple(
150150
)
151151

152152

153-
def test_setxattr_ignored(
153+
def test_xattr_ignored(
154154
test_file: str,
155155
ignored_dir: str,
156156
server: FileActivityService,
@@ -176,7 +176,13 @@ def test_setxattr_ignored(
176176
# Set xattr on monitored file - should generate an event
177177
os.setxattr(test_file, 'user.monitored', b'value')
178178

179-
# Only the monitored file's xattr event should arrive
179+
# Remove xattr on ignored file - should NOT generate an event
180+
os.removexattr(ignored_file, 'user.ignored')
181+
182+
# Remove xattr on monitored file - should generate an event
183+
os.removexattr(test_file, 'user.monitored')
184+
185+
# Only the monitored file's xattr events should arrive
180186
server.wait_events(
181187
skip_xattr=False,
182188
events=[
@@ -187,6 +193,13 @@ def test_setxattr_ignored(
187193
host_path=test_file,
188194
xattr_name='user.monitored',
189195
),
196+
Event(
197+
process=process,
198+
event_type=EventType.XATTR_REMOVE,
199+
file='',
200+
host_path=test_file,
201+
xattr_name='user.monitored',
202+
),
190203
],
191204
)
192205

0 commit comments

Comments
 (0)