diff --git a/test/libtest/test.cpp b/test/libtest/test.cpp
index 9d537ea08698..ff0c9fc02e15 100644
--- a/test/libtest/test.cpp
+++ b/test/libtest/test.cpp
@@ -5,6 +5,7 @@
  * test.cpp - libcamera test base class
  */
 
+#include <sys/stat.h>
 #include "test.h"
 
 Test::Test()
@@ -29,3 +30,13 @@ int Test::execute()
 
 	return ret;
 }
+
+bool Test::path_exists(const char *p)
+{
+	struct stat sb;
+
+	if (stat(p, &sb) == 0)
+		return true;
+
+	return false;
+}
diff --git a/test/libtest/test.h b/test/libtest/test.h
index 18b430f428c7..f21cc15e8743 100644
--- a/test/libtest/test.h
+++ b/test/libtest/test.h
@@ -21,6 +21,8 @@ public:
 
 	int execute();
 
+	bool path_exists(const char *p);
+
 protected:
 	virtual int init() { return 0; }
 	virtual int run() = 0;
