test: Move vpnor tests to vpnor directory

In the spirit of things that are together should be kept together. The
repository layout now better corresponds to upstream with the exception
of the vpnor directory and some modifications to Makefile.am

Change-Id: I16d59a3c9ee846065f6a8c83eb4459715d525f3f
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/vpnor/test/tmpd.cpp b/vpnor/test/tmpd.cpp
new file mode 100644
index 0000000..723bf56
--- /dev/null
+++ b/vpnor/test/tmpd.cpp
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: Apache-2.0
+// Copyright (C) 2018 IBM Corp.
+
+#include "vpnor/test/tmpd.hpp"
+
+namespace openpower
+{
+namespace virtual_pnor
+{
+namespace test
+{
+
+namespace fs = std::experimental::filesystem;
+
+size_t VpnorRoot::write(const std::string &name, const void *data, size_t len)
+{
+    // write() is for test environment setup - always write to ro section
+    fs::path path = root / "ro" / name;
+
+    if (!fs::exists(path))
+        /* It's not in the ToC */
+        throw std::invalid_argument(name);
+
+    std::ofstream(path).write((const char *)data, len);
+
+    return len;
+}
+
+size_t VpnorRoot::patch(const std::string &name, const void *data, size_t len)
+{
+    if (!fs::exists(root / "ro" / name))
+        /* It's not in the ToC */
+        throw std::invalid_argument(name);
+
+    std::ofstream(root / "patch" / name).write((const char *)data, len);
+
+    return len;
+}
+
+} // test
+} // virtual_pnor
+} // openpower