Ejemplo n.º 1
0
 def test_mount_failure(self):
     cmd = nfs_primarystorage_plugin.MountCmd()
     cmd.url = 'this_is_a_wrong_path'
     cmd.mountPath = os.path.join('/mnt', uuidhelper.uuid())
     callurl = kvmagent._build_url_for_test([nfs_primarystorage_plugin.MOUNT_PATH])
     ret = http.json_dump_post(callurl, cmd)
     rsp = jsonobject.loads(ret)
     self.assertFalse(rsp.success, rsp.error)
 def mount(self):
     cmd = nfs_primarystorage_plugin.MountCmd()
     cmd.url = self.NFS_URL
     cmd.mountPath = os.path.join('/mnt', uuidhelper.uuid())
     callurl = kvmagent._build_url_for_test([nfs_primarystorage_plugin.MOUNT_PATH])
     ret = http.json_dump_post(callurl, cmd)
     rsp = jsonobject.loads(ret)
     self.assertTrue(rsp.success, rsp.error)
     self.assertTrue(linux.is_mounted(cmd.url, cmd.mountPath))