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

Re: [libvirt] Need help with running libvirt-test-api



Hi,

I can confirmed it's a bug introduced by commit e55e0ce9, you can revert it or apply the patch in the attachments.

On Fri, Jun 9, 2017 at 12:27 AM, <lmurthy codeaurora org> wrote:
Hi All,
  I am new to libvirt; to create a virtual machine using libvirt-test-API framework, I am starting with "repos/domain/linux_domain.conf".
  Before starting the script, I downloaded Fedora-Server-DVD-aarch64-23.iso under /var/lib/libvirt/images, and changed the parameter "testfullimagepath" under global.cfg to reflect the path of iso image.
On trying to run the script using python libvirt-test-api --casefile /home/fedora/libvirt-test-API/cases/linux_domain.conf -l 1
I am getting below error message. Please let me know how to resolve this.


Log file:
root null-8cfdf006971f:~/libvirt-test-API# python libvirt-test-api --casefile /home/ubuntu/libvirt-test-API/cases/linux_domain.conf -l 1

Parameter guestname is required
the No.1 : domain:install_linux_cdrom

Parameter guestname is required
the No.2 : domain:install_linux_check

Parameter guestname is required
the No.3 : domain:shutdown

Parameter guestname is required
the No.4 : domain:start

Parameter guestname is required
the No.5 : domain:guest_time

Parameter guestname is required
the No.6 : domain:set_guest_time

Parameter guestname is required
the No.8 : domain:securitylabel

Parameter guestname is required
the No.9 : domain:coredump_with_format

Parameter guestname is required
the No.10 : domain:destroy

Parameter guestname is required
the No.11 : domain:undefine

Parameter guestname is required
the No.12 : domain:define

Parameter guestname is required
the No.13 : domain:suspend

Parameter guestname is required
the No.14 : domain:resume

Parameter guestname is required
the No.15 : domain:autostart

Parameter guestname is required
the No.16 : domain:ifstats

Parameter guestname is required
the No.17 : domain:blkstats

Parameter guestname is required
the No.18 : domain:dump

Parameter guestname is required
the No.19 : domain:attach_disk

Parameter guestname is required
the No.20 : domain:detach_disk

Parameter guestname is required
the No.21 : domain:cpu_affinity

Parameter guestname is required
the No.22 : domain:balloon_memory

Parameter guestname is required
the No.23 : domain:open_graphicsfd

Parameter guestname is required
the No.24 : domain:domain_fsfreeze

Parameter guestname is required
the No.25 : domain:domain_fsthaw

Parameter guestname is required
the No.26 : virconn:connection_security_model

Parameter guestname is required
the No.27 : domain:cpu_status

Parameter guestname is required
the No.28 : domain:set_memory_period

Parameter guestname is required
the No.29 : domain:add_del_iothread

Parameter guestname is required
the No.30 : domain:pin_iothread

Parameter guestname is required
the No.31 : domain:info_iothread

Parameter guestname is required
the No.32 : domain:fsinfo

Parameter guestname is required
the No.33 : domain:set_user_passwd

root null-8cfdf006971f:~/libvirt-test-API#
root null-8cfdf006971f:~/libvirt-test-API#

--
libvir-list mailing list
libvir-list redhat com
https://www.redhat.com/mailman/listinfo/libvir-list



--
Best Regards,
Kairui Song
From 033b0aa9605a6a33e0ef86f248ed9f2adea8d44e Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong redhat com>
Date: Fri, 9 Jun 2017 14:34:28 +0800
Subject: [PATCH] Fix parsing error

commit e55e0ce tried to fix some style problem but it got
tripped_casename getting wrongly initialized during the praser loop.
This could fix it and raise an Exception if it is accessed before
initialized, which means the config file is malformed.

Change-Id: Idc9961be779a860ec1728d795d3d86576e59b498
---
 src/parser.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/parser.py b/src/parser.py
index 3ed6813..49e5d6e 100644
--- a/src/parser.py
+++ b/src/parser.py
@@ -315,16 +315,19 @@ class CaseFileParser(object):
     def parse(self, fh, list):
         """ For the testcase name parsing. """
 
+        tripped_casename = ""
         while True:
             if self.debug:
                 self.debug_print("the list is", list)
 
             indent = self.get_next_line_indent(fh)
-            tripped_casename = ""
             if indent < 0:
                 break
             elif indent > 0:
                 if indent == 4:
+                    if not tripped_casename:
+                        raise exception.CaseConfigfileError(
+                            "get option before case!")
                     if self.debug:
                         self.debug_print("we begin to parse the option line")
                     list = self.option_parse(fh, list, tripped_casename)
-- 
2.9.3


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