test: Remove uses of O_TMPFILE

`O_TMPFILE` requires file system support, which may not be available in
certain environments, usually containerized ones. So do not use it.

A new function is added for tests to be able to create unnamed temporary
files using `libcamera::MemFd` as the implementation.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
Barnabás Pőcze
2026-01-28 15:19:45 +01:00
parent 78b9890a0f
commit b181327131
6 changed files with 39 additions and 30 deletions

View File

@@ -189,7 +189,7 @@ protected:
private:
int createFd()
{
fd_ = open("/tmp", O_TMPFILE | O_RDWR, S_IRUSR | S_IWUSR);
fd_ = test::createTemporaryFile().release();
if (fd_ < 0)
return TestFail;