add system interface to enable testing

Add system interface to enable testing of the linux syscalls.

Change-Id: Ia135695de4ae8ed561516b8355f03c7191523780
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/test/internal_sys_mock.hpp b/test/internal_sys_mock.hpp
new file mode 100644
index 0000000..42abe2f
--- /dev/null
+++ b/test/internal_sys_mock.hpp
@@ -0,0 +1,30 @@
+#pragma once
+
+#include "internal/sys.hpp"
+
+#include <unistd.h>
+
+#include <gmock/gmock.h>
+
+namespace blobs
+{
+namespace flash
+{
+namespace internal
+{
+
+class InternalSysMock : public Sys
+{
+  public:
+    virtual ~InternalSysMock() = default;
+
+    MOCK_CONST_METHOD2(open, int(const char*, int));
+    MOCK_CONST_METHOD1(close, int(int));
+    MOCK_CONST_METHOD6(mmap, void*(void*, size_t, int, int, int, off_t));
+    MOCK_CONST_METHOD2(munmap, int(void*, size));
+    MOCK_CONST_METHOD0(getpagesize, int());
+};
+
+} // namespace internal
+} // namespace flash
+} // namespace blobs