# Re: \[PATCH v2 27/27\] selftests/landlock: Use EXPECT for checks that later steps do not need

- From: sashiko-bot@kernel.org
- Date: 2026-11-04 21:19:04 
- List: linux-security-module
- Page: https://ratatoskr.run/linux-security-module/2026/11/17864933
- Thread: https://ratatoskr.run/linux-security-module/2026/11/17864489/t.md

```text
> ASSERT aborts the test, so it should only be used when continuing after
> a failure is pointless.  Use EXPECT for checks whose outcome nothing
> later in the test depends on:
> 
> * errno values after a failed syscall,
> * test_open() and test_open_rel(), which leave no state behind,
> * WEXITSTATUS() of a child that has exited,
> * matches_log_fs() and matches_log_fs_extra(),
> * the record counts returned by audit_count_records().
> 
> Keep ASSERT for operations whose side effects later checks depend on,
> such as renames, links and file removals.
> 
> Signed-off-by: Günther Noack <redacted>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261104-selftests-refactor-v2-0-c52f23f7ce33@gmail.com?part=27

```
