[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [test-API PATCH 3/7] domainAPI: Add wrapper method to work with domain's console connections



On 03/21/2012 08:46 PM, Peter Krempa wrote:
This patch adds a wrapper that enables work with consoles in the
test-API.
---
  lib/domainAPI.py |    9 +++++++++
  1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/lib/domainAPI.py b/lib/domainAPI.py
index 91f2ba3..bc0069b 100644
--- a/lib/domainAPI.py
+++ b/lib/domainAPI.py
@@ -878,6 +878,15 @@ class DomainAPI(object):
              code = e.get_error_code()
              raise exception.LibvirtAPI(message, code)

+    def openConsole(self, domname, device, stream, flags = 0):
+        try:
+            dom_obj = self.get_domain_by_name(domname)
+            st_obj = stream.getStream()


we could get the st_obj in testcase then pass it into openConsole If so, st_obj could be reused in the following statement in testcase
            like:

                st_obj = stream.getStream()
                dom.openConsole(domname, None, st_obj)
                receivedData = st_obj.recv(1024)
(the last statement probably resides in a registered stream callback function via eventAddCallback API)


            Thanks for the patch.

            Guannan Ren


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]