You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2015/03/12 07:04:57 UTC

[05/12] git commit: updated refs/heads/master to c27c694

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c27c6943/plugins/hypervisors/ovm3/src/test/java/com/cloud/hypervisor/ovm3/objects/RepositoryTest.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ovm3/src/test/java/com/cloud/hypervisor/ovm3/objects/RepositoryTest.java b/plugins/hypervisors/ovm3/src/test/java/com/cloud/hypervisor/ovm3/objects/RepositoryTest.java
new file mode 100644
index 0000000..eaf6612
--- /dev/null
+++ b/plugins/hypervisors/ovm3/src/test/java/com/cloud/hypervisor/ovm3/objects/RepositoryTest.java
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http:www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package com.cloud.hypervisor.ovm3.objects;
+
+import org.junit.Test;
+
+public class RepositoryTest {
+    ConnectionTest con = new ConnectionTest();
+    Repository repo = new Repository(con);
+    XmlTestResultTest results = new XmlTestResultTest();
+
+    private String REPOID = "f12842ebf5ed3fe78da1eb0e17f5ede8";
+    private String MGRID = "d1a749d4295041fb99854f52ea4dea97";
+    private String REPOALIAS = "OVS Repository";
+    private String REMOTENFS = "cs-mgmt:/volumes/cs-data/primary/ovm";
+    private String LOCALMOUNT = "/OVS/Repositories/f12842ebf5ed3fe78da1eb0e17f5ede8";
+    private String REPOVERSION = "3.0";
+    private String REPOSTATUS = "Mounted";
+    private String ISO = "systemvm.iso";
+    private String TEMPLATE = "0b53acb1-6554-41b8-b1e1-7b27a01b6acb";
+    private String DISK = "cfb5ee12-b99d-41d1-a5b2-44dea36c9de1.raw";
+    private String VM = "7efbdbe0-3d01-3b22-a8a0-1d41c6f2502f";
+    private String REPODISCOVERXML = "<string>"
+            + "&lt;?xml version=\"1.0\" ?&gt;"
+            + "&lt;Discover_Repositories_Result&gt;" + "&lt;RepositoryList&gt;"
+            + "&lt;Repository Name=\""
+            + REPOID
+            + "\"&gt;"
+            + "&lt;Version&gt;"
+            + REPOVERSION
+            + "&lt;/Version&gt;"
+            + "&lt;Manager_UUID&gt;"
+            + MGRID
+            + "&lt;/Manager_UUID&gt;"
+            + "&lt;Repository_UUID&gt;"
+            + REPOID
+            + "&lt;/Repository_UUID&gt;"
+            + "&lt;Repository_Alias&gt;"
+            + REPOALIAS
+            + "&lt;/Repository_Alias&gt;"
+            + "&lt;Assemblies/&gt;"
+            + "&lt;Templates&gt;"
+            + "&lt;Template Name=\""
+            + TEMPLATE
+            + "\"&gt;"
+            + "&lt;File&gt;"
+            + TEMPLATE
+            + ".raw&lt;/File&gt;"
+            + "&lt;/Template&gt;"
+            + "&lt;Template Name=\"7d5c29db-6343-4431-b509-9646b45cc31b\"&gt;"
+            + "&lt;File&gt;7d5c29db-6343-4431-b509-9646b45cc31b.raw&lt;/File&gt;"
+            + "&lt;/Template&gt;"
+            + "&lt;/Templates&gt;"
+            + "&lt;VirtualMachines&gt;"
+            + "&lt;VirtualMachine Name=\""
+            + VM
+            + "\"&gt;"
+            + "&lt;File&gt;vm.cfg&lt;/File&gt;"
+            + "&lt;/VirtualMachine&gt;"
+            + "&lt;VirtualMachine Name=\"pool\"&gt;"
+            + "&lt;File&gt;ovspoolfs.img&lt;/File&gt;"
+            + "&lt;/VirtualMachine&gt;"
+            + "&lt;VirtualMachine Name=\"4fb50e31-b032-3012-b70b-7e27c2acdfe2\"&gt;"
+            + "&lt;File&gt;vm.cfg&lt;/File&gt;"
+            + "&lt;/VirtualMachine&gt;"
+            + "&lt;VirtualMachine Name=\"5ffe3ddc-606d-3fec-a956-67638f7ba838\"&gt;"
+            + "&lt;File&gt;vm.cfg&lt;/File&gt;"
+            + "&lt;/VirtualMachine&gt;"
+            + "&lt;VirtualMachine Name=\"14fc3846-45e5-3c08-ad23-432ceb07407b\"&gt;"
+            + "&lt;File&gt;vm.cfg&lt;/File&gt;"
+            + "&lt;/VirtualMachine&gt;"
+            + "&lt;/VirtualMachines&gt;"
+            + "&lt;VirtualDisks&gt;"
+            + "&lt;Disk&gt;"
+            + DISK
+            + "&lt;/Disk&gt;"
+            + "&lt;Disk&gt;b92dd5c5-0f24-4cca-b86a-153ac6e950a8.raw&lt;/Disk&gt;"
+            + "&lt;Disk&gt;d144c278-0825-41d5-b9c6-8bb21f3dd1e7.raw&lt;/Disk&gt;"
+            + "&lt;Disk&gt;99650d9f-c7ee-42df-92e3-6cafc0876141.raw&lt;/Disk&gt;"
+            + "&lt;/VirtualDisks&gt;"
+            + "&lt;ISOs&gt;"
+            + "&lt;ISO&gt;"
+            + ISO
+            + "&lt;/ISO&gt;"
+            + "&lt;/ISOs&gt;"
+            + "&lt;/Repository&gt;"
+            + "&lt;/RepositoryList&gt;"
+            + "&lt;/Discover_Repositories_Result&gt;" + "</string>";
+    private String REPODBDISCOVERXML = "<string>"
+            + "&lt;?xml version=\"1.0\" ?&gt;"
+            + "&lt;Discover_Repository_Db_Result&gt;"
+            + "&lt;RepositoryDbList&gt;" + "&lt;Repository Uuid=\""
+            + REPOID
+            + "\"&gt;"
+            + "&lt;Fs_location&gt;"
+            + REMOTENFS
+            + "&lt;/Fs_location&gt;"
+            + "&lt;Mount_point&gt;"
+            + LOCALMOUNT
+            + "&lt;/Mount_point&gt;"
+            + "&lt;Filesystem_type&gt;nfs&lt;/Filesystem_type&gt;"
+            + "&lt;Version&gt;"
+            + REPOVERSION
+            + "&lt;/Version&gt;"
+            + "&lt;Alias&gt;"
+            + REPOALIAS
+            + "&lt;/Alias&gt;"
+            + "&lt;Manager_uuid&gt;"
+            + MGRID
+            + "&lt;/Manager_uuid&gt;"
+            + "&lt;Status&gt;"
+            + REPOSTATUS
+            + "&lt;/Status&gt;"
+            + "&lt;/Repository&gt;"
+            + "&lt;/RepositoryDbList&gt;"
+            + "&lt;/Discover_Repository_Db_Result&gt;" + "</string>";
+
+    /*
+     * @Test Create a test repo that mimics the above so we can test against a
+     * live box... public void testCreateRepo() throws Ovm3ResourceException {
+     * con.setResult(null); repo.createRepo(REMOTENFS, LOCALMOUNT, REPOID,
+     * REPOALIAS); }
+     */
+    @Test
+    public void testDiscoverRepoBase() throws Ovm3ResourceException {
+        con.setResult(results.simpleResponseWrapWrapper(this.REPODISCOVERXML));
+        repo.discoverRepo(REPOID);
+        results.basicStringTest(repo.getRepo(REPOID).getUuid(), REPOID);
+        results.basicStringTest(repo.getRepo(REPOID).getAlias(), REPOALIAS);
+        results.basicStringTest(repo.getRepo(REPOID).getVersion(), REPOVERSION);
+        results.basicStringTest(repo.getRepo(REPOID).getManagerUuid(), MGRID);
+    }
+
+    @Test
+    public void testDiscoverRepoDetails() throws Ovm3ResourceException {
+        con.setResult(results.simpleResponseWrapWrapper(this.REPODISCOVERXML));
+        repo.discoverRepo(REPOID);
+        results.basicBooleanTest(results.basicListHasString(repo
+                .getRepo(REPOID).getRepoVirtualDisks(), DISK), true);
+        results.basicBooleanTest(results.basicListHasString(repo
+                .getRepo(REPOID).getRepoVirtualMachines(), VM), true);
+        results.basicBooleanTest(results.basicListHasString(repo
+                .getRepo(REPOID).getRepoTemplates(), TEMPLATE + ".raw"), true);
+        results.basicBooleanTest(results.basicListHasString(repo
+                .getRepo(REPOID).getRepoISOs(), ISO), true);
+        results.basicBooleanTest(results.basicListHasString(repo
+                .getRepo(REPOID).getRepoISOs(), VM), false);
+    }
+
+    @Test
+    public void testDiscoverRepoDb() throws Ovm3ResourceException {
+        con.setResult(results.simpleResponseWrapWrapper(this.REPODBDISCOVERXML));
+        repo.discoverRepoDb();
+        results.basicStringTest(repo.getRepoDb(REPOID).getUuid(), REPOID);
+        results.basicStringTest(repo.getRepoDb(REPOID).getAlias(), REPOALIAS);
+        results.basicStringTest(repo.getRepoDb(REPOID).getVersion(),
+                REPOVERSION);
+        results.basicStringTest(repo.getRepoDb(REPOID).getManagerUuid(), MGRID);
+        results.basicStringTest(repo.getRepoDb(REPOID).getMountPoint(),
+                LOCALMOUNT);
+        results.basicStringTest(repo.getRepoDb(REPOID).getFsLocation(),
+                REMOTENFS);
+        results.basicStringTest(repo.getRepoDb(REPOID).getStatus(), REPOSTATUS);
+        results.basicStringTest(repo.getRepoDb(REPOID).getFilesystemType(),
+                "nfs");
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c27c6943/plugins/hypervisors/ovm3/src/test/java/com/cloud/hypervisor/ovm3/objects/StoragePluginTest.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ovm3/src/test/java/com/cloud/hypervisor/ovm3/objects/StoragePluginTest.java b/plugins/hypervisors/ovm3/src/test/java/com/cloud/hypervisor/ovm3/objects/StoragePluginTest.java
new file mode 100644
index 0000000..b041508
--- /dev/null
+++ b/plugins/hypervisors/ovm3/src/test/java/com/cloud/hypervisor/ovm3/objects/StoragePluginTest.java
@@ -0,0 +1,358 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http:www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package com.cloud.hypervisor.ovm3.objects;
+
+import static org.junit.Assert.assertNotNull;
+import java.io.File;
+
+import org.junit.Test;
+
+import com.cloud.hypervisor.ovm3.objects.StoragePlugin.FileProperties;
+import com.cloud.hypervisor.ovm3.objects.StoragePlugin.StorageDetails;
+
+public class StoragePluginTest {
+    ConnectionTest con = new ConnectionTest();
+    StoragePlugin sPt = new StoragePlugin(con);
+    XmlTestResultTest results = new XmlTestResultTest();
+    String NFSHOST = "nfs-store-1";
+    String NFSPATH = "/volumes/cs-data/primary";
+    String NFSMNT = "/nfsmnt";
+    String FSPROPUUID = sPt.deDash(sPt.newUuid());
+    String FSMNTUUID = sPt.newUuid();
+    String POOLUUID = sPt.deDash(FSMNTUUID);
+    String FILE = "a.file";
+    Long SIZE = 2096898048L;
+    String STORAGEPLUGINXML = "<string>"
+            + "&lt;?xml version=\"1.0\" ?&gt;"
+            + "&lt;Discover_Storage_Plugins_Result&gt;"
+            + "&lt;storage_plugin_info_list&gt;"
+            + "&lt;storage_plugin_info plugin_impl_name=\"oracle.ocfs2.OCFS2.OCFS2Plugin\"&gt;"
+            + "&lt;fs_api_version&gt;1,2,7&lt;/fs_api_version&gt;"
+            + "&lt;generic_plugin&gt;False&lt;/generic_plugin&gt;"
+            + "&lt;plugin_version&gt;0.1.0-38&lt;/plugin_version&gt;"
+            + "&lt;filesys_type&gt;LocalFS&lt;/filesys_type&gt;"
+            + "&lt;extended_api_version&gt;None&lt;/extended_api_version&gt;"
+            + "&lt;plugin_desc&gt;Oracle OCFS2 File system Storage Connect Plugin&lt;/plugin_desc&gt;"
+            + "&lt;cluster_required&gt;True&lt;/cluster_required&gt;"
+            + "&lt;plugin_name&gt;Oracle OCFS2 File system&lt;/plugin_name&gt;"
+            + "&lt;fs_extra_info_help&gt;None&lt;/fs_extra_info_help&gt;"
+            + "&lt;required_api_vers&gt;1,2,7&lt;/required_api_vers&gt;"
+            + "&lt;file_extra_info_help&gt;None&lt;/file_extra_info_help&gt;"
+            + "&lt;ss_extra_info_help&gt;None&lt;/ss_extra_info_help&gt;"
+            + "&lt;filesys_name&gt;ocfs2&lt;/filesys_name&gt;"
+            + "&lt;vendor_name&gt;Oracle&lt;/vendor_name&gt;"
+            + "&lt;plugin_type&gt;ifs&lt;/plugin_type&gt;"
+            + "&lt;abilities&gt;"
+            + "&lt;resize_is_sync&gt;YES&lt;/resize_is_sync&gt;"
+            + "&lt;clone_is_sync&gt;YES&lt;/clone_is_sync&gt;"
+            + "&lt;access_control&gt;NO&lt;/access_control&gt;"
+            + "&lt;custom_clone_name&gt;YES&lt;/custom_clone_name&gt;"
+            + "&lt;require_storage_name&gt;NO&lt;/require_storage_name&gt;"
+            + "&lt;backing_device_type&gt;DEVICE_SINGLE&lt;/backing_device_type&gt;"
+            + "&lt;splitclone_while_open&gt;NO&lt;/splitclone_while_open&gt;"
+            + "&lt;custom_snap_name&gt;YES&lt;/custom_snap_name&gt;"
+            + "&lt;snapshot&gt;ONLINE&lt;/snapshot&gt;"
+            + "&lt;splitclone&gt;UNSUPPORTED&lt;/splitclone&gt;"
+            + "&lt;snap_is_sync&gt;YES&lt;/snap_is_sync&gt;"
+            + "&lt;snapclone&gt;ONLINE&lt;/snapclone&gt;"
+            + "&lt;splitclone_is_sync&gt;NO&lt;/splitclone_is_sync&gt;"
+            + "&lt;clone&gt;ONLINE&lt;/clone&gt;"
+            + "&lt;resize&gt;ONLINE&lt;/resize&gt;"
+            + "&lt;snapclone_is_sync&gt;YES&lt;/snapclone_is_sync&gt;"
+            + "&lt;/abilities&gt;"
+            + "&lt;/storage_plugin_info&gt;"
+            + "&lt;storage_plugin_info plugin_impl_name=\"oracle.generic.SCSIPlugin.GenericPlugin\"&gt;"
+            + "&lt;storage_types&gt;SAN,iSCSI&lt;/storage_types&gt;"
+            + "&lt;generic_plugin&gt;True&lt;/generic_plugin&gt;"
+            + "&lt;plugin_version&gt;1.1.0&lt;/plugin_version&gt;"
+            + "&lt;extended_api_version&gt;1,2,9&lt;/extended_api_version&gt;"
+            + "&lt;plugin_desc&gt;Oracle Storage Connect Plugin for Generic FC and iSCSI&lt;/plugin_desc&gt;"
+            + "&lt;plugin_name&gt;Oracle Generic SCSI Plugin&lt;/plugin_name&gt;"
+            + "&lt;sa_api_version&gt;1,2,7&lt;/sa_api_version&gt;"
+            + "&lt;required_api_vers&gt;1,2,7&lt;/required_api_vers&gt;"
+            + "&lt;ss_extra_info_help&gt;None&lt;/ss_extra_info_help&gt;"
+            + "&lt;se_extra_info_help&gt;None&lt;/se_extra_info_help&gt;"
+            + "&lt;vendor_name&gt;Oracle&lt;/vendor_name&gt;"
+            + "&lt;plugin_type&gt;isa&lt;/plugin_type&gt;"
+            + "&lt;abilities&gt;"
+            + "&lt;resize_is_sync&gt;UNSUPPORTED&lt;/resize_is_sync&gt;"
+            + "&lt;clone_is_sync&gt;UNSUPPORTED&lt;/clone_is_sync&gt;"
+            + "&lt;access_control&gt;NO&lt;/access_control&gt;"
+            + "&lt;custom_clone_name&gt;UNSUPPORTED&lt;/custom_clone_name&gt;"
+            + "&lt;require_storage_name&gt;UNSUPPORTED&lt;/require_storage_name&gt;"
+            + "&lt;custom_snap_name&gt;UNSUPPORTED&lt;/custom_snap_name&gt;"
+            + "&lt;snapshot&gt;UNSUPPORTED&lt;/snapshot&gt;"
+            + "&lt;splitclone&gt;UNSUPPORTED&lt;/splitclone&gt;"
+            + "&lt;snap_is_sync&gt;UNSUPPORTED&lt;/snap_is_sync&gt;"
+            + "&lt;snapclone&gt;UNSUPPORTED&lt;/snapclone&gt;"
+            + "&lt;splitclone_is_sync&gt;UNSUPPORTED&lt;/splitclone_is_sync&gt;"
+            + "&lt;clone&gt;UNSUPPORTED&lt;/clone&gt;"
+            + "&lt;resize&gt;UNSUPPORTED&lt;/resize&gt;"
+            + "&lt;snapclone_is_sync&gt;UNSUPPORTED&lt;/snapclone_is_sync&gt;"
+            + "&lt;/abilities&gt;"
+            + "&lt;/storage_plugin_info&gt;"
+            + "&lt;storage_plugin_info plugin_impl_name=\"oracle.generic.NFSPlugin.GenericNFSPlugin\"&gt;"
+            + "&lt;fs_api_version&gt;1,2,7&lt;/fs_api_version&gt;"
+            + "&lt;generic_plugin&gt;True&lt;/generic_plugin&gt;"
+            + "&lt;plugin_version&gt;1.1.0&lt;/plugin_version&gt;"
+            + "&lt;filesys_type&gt;NetworkFS&lt;/filesys_type&gt;"
+            + "&lt;extended_api_version&gt;None&lt;/extended_api_version&gt;"
+            + "&lt;plugin_desc&gt;Oracle Generic Network File System Storage Connect Plugin&lt;/plugin_desc&gt;"
+            + "&lt;cluster_required&gt;False&lt;/cluster_required&gt;"
+            + "&lt;plugin_name&gt;Oracle Generic Network File System&lt;/plugin_name&gt;"
+            + "&lt;fs_extra_info_help&gt;None&lt;/fs_extra_info_help&gt;"
+            + "&lt;required_api_vers&gt;1,2,7&lt;/required_api_vers&gt;"
+            + "&lt;file_extra_info_help&gt;None&lt;/file_extra_info_help&gt;"
+            + "&lt;ss_extra_info_help&gt;None&lt;/ss_extra_info_help&gt;"
+            + "&lt;filesys_name&gt;NFS&lt;/filesys_name&gt;"
+            + "&lt;vendor_name&gt;Oracle&lt;/vendor_name&gt;"
+            + "&lt;plugin_type&gt;ifs&lt;/plugin_type&gt;"
+            + "&lt;abilities&gt;"
+            + "&lt;resize_is_sync&gt;UNSUPPORTED&lt;/resize_is_sync&gt;"
+            + "&lt;clone_is_sync&gt;UNSUPPORTED&lt;/clone_is_sync&gt;"
+            + "&lt;access_control&gt;NO&lt;/access_control&gt;"
+            + "&lt;custom_clone_name&gt;UNSUPPORTED&lt;/custom_clone_name&gt;"
+            + "&lt;require_storage_name&gt;NO&lt;/require_storage_name&gt;"
+            + "&lt;backing_device_type&gt;UNSUPPORTED&lt;/backing_device_type&gt;"
+            + "&lt;splitclone_while_open&gt;UNSUPPORTED&lt;/splitclone_while_open&gt;"
+            + "&lt;custom_snap_name&gt;UNSUPPORTED&lt;/custom_snap_name&gt;"
+            + "&lt;snapshot&gt;UNSUPPORTED&lt;/snapshot&gt;"
+            + "&lt;splitclone&gt;UNSUPPORTED&lt;/splitclone&gt;"
+            + "&lt;snap_is_sync&gt;UNSUPPORTED&lt;/snap_is_sync&gt;"
+            + "&lt;snapclone&gt;UNSUPPORTED&lt;/snapclone&gt;"
+            + "&lt;splitclone_is_sync&gt;UNSUPPORTED&lt;/splitclone_is_sync&gt;"
+            + "&lt;clone&gt;UNSUPPORTED&lt;/clone&gt;"
+            + "&lt;resize&gt;UNSUPPORTED&lt;/resize&gt;"
+            + "&lt;snapclone_is_sync&gt;UNSUPPORTED&lt;/snapclone_is_sync&gt;"
+            + "&lt;/abilities&gt;" + "&lt;/storage_plugin_info&gt;"
+            + "&lt;/storage_plugin_info_list&gt;"
+            + "&lt;/Discover_Storage_Plugins_Result&gt;" + "</string>";
+    String NFSMOUNTRESPONSEXML = "<struct>" + "<member>"
+            + "<name>status</name>" + "<value><string></string></value>"
+            + "</member>" + "<member>" + "<name>uuid</name>"
+            + "<value><string>"
+            + FSPROPUUID
+            + "</string></value>"
+            + "</member>"
+            + "<member>"
+            + "<name>ss_uuid</name>"
+            + "<value><string>"
+            + FSMNTUUID
+            + "</string></value>"
+            + "</member>"
+            + "<member>"
+            + "<name>size</name>"
+            + "<value><string>263166853120</string></value>"
+            + "</member>"
+            + "<member>"
+            + "<name>free_sz</name>"
+            + "<value><string>259377299456</string></value>"
+            + "</member>"
+            + "<member>"
+            + "<name>state</name>"
+            + "<value><string>1</string></value>"
+            + "</member>"
+            + "<member>"
+            + "<name>mount_options</name>"
+            + "<value><array><data>"
+            + "</data></array></value>"
+            + "</member>"
+            + "<member>"
+            + "<name>access_grp_names</name>"
+            + "<value><array><data>"
+            + "</data></array></value>"
+            + "</member>"
+            + "<member>"
+            + "<name>access_path</name>"
+            + "<value><string>"
+            + NFSHOST
+            + ":"
+            + NFSPATH
+            + "</string></value>"
+            + "</member>"
+            + "<member>"
+            + "<name>name</name>"
+            + "<value><string>nfs:"
+            + NFSPATH
+            + "</string></value>" + "</member>" + "</struct>";
+    public String getNfsMountResponseXml() {
+        return NFSMOUNTRESPONSEXML;
+    }
+
+    public String getNfsFileSystemInfo() {
+        return NFSFILESYSTEMINFO;
+    }
+    public String getFileCreateXml() {
+        return FILECREATEXML;
+    }
+    public Long getFileSize() {
+        return SIZE;
+    }
+    public String getPoolUuid() {
+        return POOLUUID;
+    }
+    public String getFileName() {
+        return FILE;
+    }
+    String NFSFILESYSTEMINFO = NFSMOUNTRESPONSEXML;
+    String FILECREATEXML = "<struct>" + "<member>" + "<name>fr_type</name>"
+            + "<value><string>File</string></value>" + "</member>" + "<member>"
+            + "<name>ondisk_sz</name>" + "<value><string>0</string></value>"
+            + "</member>" + "<member>" + "<name>fs_uuid</name>"
+            + "<value><string>" + FSMNTUUID + "</string></value>" + "</member>"
+            + "<member>" + "<name>file_path</name>"
+            + "<value><string>/OVS/Repositories/" + POOLUUID + "/VirtualDisks/"
+            + FILE + "</string></value>" + "</member>" + "<member>"
+            + "<name>file_sz</name>" + "<value><string>" + SIZE
+            + "</string></value>" + "</member>" + "</struct>";
+
+    @Test
+    public void testNFSStorageMountCreation() throws Ovm3ResourceException {
+        con.setResult(results.simpleResponseWrapWrapper(NFSMOUNTRESPONSEXML));
+        StorageDetails sd = sPt.storagePluginMountNFS(NFSHOST, NFSPATH,
+                FSMNTUUID, NFSMNT);
+        con.setResult(results.simpleResponseWrapWrapper(NFSMOUNTRESPONSEXML));
+        NFSMNT = NFSMNT + File.separator + FSMNTUUID;
+        sd = sPt.storagePluginMountNFS(NFSHOST, NFSPATH, FSMNTUUID, NFSMNT);
+        results.basicLongTest(Long.valueOf(sd.getSize()), 263166853120L);
+        results.basicLongTest(Long.valueOf(sd.getFreeSize()), 259377299456L);
+        results.basicStringTest(sd.getName(), "nfs:" + NFSPATH);
+        results.basicStringTest(sd.getUuid(), FSPROPUUID);
+        results.basicStringTest(sd.getDetailsRelationalUuid(),FSMNTUUID);
+    }
+
+    @Test
+    public void testNFSStorageUnmount() throws Ovm3ResourceException {
+        con.setResult(results.getNil());
+        results.basicBooleanTest(sPt.storagePluginUnmountNFS(NFSHOST, NFSPATH, FSMNTUUID, NFSMNT));
+    }
+
+    @Test(expected = Ovm3ResourceException.class)
+    public void testStoragePluginIncorrectSsUuid() throws Ovm3ResourceException {
+        sPt.getStorageDetails().setDetailsRelationalUuid(FSMNTUUID);
+    }
+
+    @Test(expected = Ovm3ResourceException.class)
+    public void testStoragePluginIncorrectMntUuid()
+            throws Ovm3ResourceException {
+        sPt.getStorageDetails().setUuid(FSPROPUUID);
+    }
+
+    @Test(expected = Ovm3ResourceException.class)
+    public void testStoragePluginIncorrectUuid() throws Ovm3ResourceException {
+        sPt.getStorageServer().setUuid(FSMNTUUID);
+    }
+
+    @Test(expected = Ovm3ResourceException.class)
+    public void testStoragePluginNFSmountInvalidUuid()
+            throws Ovm3ResourceException {
+        NFSMOUNTRESPONSEXML = NFSMOUNTRESPONSEXML.replaceAll(FSPROPUUID,
+                sPt.deDash(FSMNTUUID));
+        con.setResult(results.simpleResponseWrapWrapper(NFSMOUNTRESPONSEXML));
+        assertNotNull(sPt.storagePluginMountNFS(NFSHOST, NFSPATH,
+                FSPROPUUID, NFSMNT));
+    }
+
+    @Test
+    public void testStorageFileCreation() throws Ovm3ResourceException {
+        con.setResult(results.simpleResponseWrapWrapper(FILECREATEXML));
+        FileProperties file = sPt.storagePluginCreate(FSMNTUUID, NFSHOST, FILE,
+                SIZE, false);
+        file.getOnDiskSize();
+    }
+
+    @Test(expected = Ovm3ResourceException.class)
+    public void testStorageFileCreationFileExistS()
+            throws Ovm3ResourceException {
+        con.setResult(results
+                .errorResponseWrap("exceptions OSError:[Errno.17] File exists "
+                        + FILE));
+        FileProperties file = sPt.storagePluginCreate(FSMNTUUID, NFSHOST, FILE,
+                SIZE, false);
+        file.getSize();
+    }
+
+    @Test
+    public void testStorageFileInfo() throws Ovm3ResourceException {
+        con.setResult(results.simpleResponseWrapWrapper(FILECREATEXML));
+        FileProperties file = sPt.storagePluginGetFileInfo(FSMNTUUID, NFSHOST,
+                FILE);
+        file.getName();
+        file.getUuid();
+        file.getType();
+        file.getSize();
+    }
+
+    @Test
+    public void testDiscoverStoragePlugins() throws Ovm3ResourceException {
+        con.setResult(results.simpleResponseWrapWrapper(STORAGEPLUGINXML));
+        for (String plugin : sPt.discoverStoragePlugins()) {
+            sPt.checkStoragePluginProperties(plugin, "plugin_version");
+            sPt.checkStoragePluginAbility(plugin, "snapshot");
+        }
+    }
+
+    @Test(expected = Ovm3ResourceException.class)
+    public void testCheckStoragePluginBogusPlugin()
+            throws Ovm3ResourceException {
+        con.setResult(results.simpleResponseWrapWrapper(STORAGEPLUGINXML));
+        sPt.checkStoragePluginProperties("bogus", "plugin_version");
+    }
+
+    @Test(expected = Ovm3ResourceException.class)
+    public void testCheckStoragePluginBogusProperty()
+            throws Ovm3ResourceException {
+        con.setResult(results.simpleResponseWrapWrapper(STORAGEPLUGINXML));
+        sPt.checkStoragePluginAbility(sPt.getPluginType(), "blabla");
+    }
+
+    @Test
+    public void testMounts() throws Ovm3ResourceException {
+        con.setResult(results.simpleResponseWrapWrapper(NFSMOUNTRESPONSEXML));
+        sPt.storagePluginListFs(NFSHOST);
+    }
+
+    @Test
+    public void testGetFileSystemInfo() throws Ovm3ResourceException {
+        con.setResult(results.simpleResponseWrapWrapper(NFSMOUNTRESPONSEXML));
+        sPt.storagePluginGetFileSystemInfo(FSPROPUUID, FSMNTUUID, NFSHOST,
+                NFSPATH);
+    }
+
+    @Test
+    public void testStoragepluginDestroy() throws Ovm3ResourceException {
+        con.setResult(results.getNil());
+        sPt.storagePluginDestroy(FSMNTUUID, FILE);
+    }
+
+    @Test(expected = Ovm3ResourceException.class)
+    public void testStoragepluginDestroyWrongUUID()
+            throws Ovm3ResourceException {
+        con.setResult(results.getNil());
+        sPt.storagePluginDestroy(FSPROPUUID, FILE);
+    }
+
+    @Test
+    public void testStoragePluginSwitch() throws Ovm3ResourceException {
+        con.setResult(results.simpleResponseWrapWrapper(STORAGEPLUGINXML));
+        sPt.setISCSI();
+        sPt.setNFS();
+        sPt.setOCFS2();
+    }
+}