[test-API 12/17] Substitute 'guest"' with 'domain"'

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

 



% for i in $(grep 'guest"' * -r | awk -F':' '{print $1}'| uniq); do \
    sed -i -e 's/guest"/domain"/g' $i; \
  done

This also affects the codes like:

-    url = global_parser.get_value("guest", gname + "src")
-    dict['kickstart'] = global_parser.get_value("guest", gname + "ks")
+    url = global_parser.get_value("domain", gname + "src")
+    dict['kickstart'] = global_parser.get_value("domain", gname + "ks")

A follow up patch will change the property 'guest' into 'domain'
---
 .../en-US/Writing_a_test_case.xml                  |    4 ++--
 repos/domain/balloon_memory.py                     |    2 +-
 repos/domain/cpu_affinity.py                       |    2 +-
 repos/domain/cpu_topology.py                       |   10 +++++-----
 repos/domain/domain_blkinfo.py                     |    2 +-
 repos/domain/domain_uuid.py                        |    2 +-
 repos/domain/domblkinfo.py                         |    2 +-
 repos/domain/install_linux_cdrom.py                |    6 +++---
 repos/domain/install_linux_check.py                |    6 +++---
 repos/domain/install_linux_net.py                  |    8 ++++----
 repos/domain/install_windows_cdrom.py              |    6 +++---
 repos/domain/restore.py                            |    2 +-
 repos/domain/save.py                               |    2 +-
 repos/domain/update_devflag.py                     |    2 +-
 .../multiple_thread_block_on_domain_create.py      |    6 +++---
 repos/snapshot/file_flag.py                        |    2 +-
 repos/snapshot/flag_check.py                       |    2 +-
 utils/utils.py                                     |    2 +-
 18 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/docs/User_Guide/libvirt-test-API_Guide/en-US/Writing_a_test_case.xml b/docs/User_Guide/libvirt-test-API_Guide/en-US/Writing_a_test_case.xml
index dec8bd7..5502cc3 100644
--- a/docs/User_Guide/libvirt-test-API_Guide/en-US/Writing_a_test_case.xml
+++ b/docs/User_Guide/libvirt-test-API_Guide/en-US/Writing_a_test_case.xml
@@ -238,8 +238,8 @@ def install_domain(dict):
 
     logger.info('get system environment information')
     global_parser = global_parser.GlobalParser(envfile)
-    url = global_parser.get_value("guest", gname + "src")
-    dict['kickstart'] = global_parser.get_value("guest", gname + "ks")
+    url = global_parser.get_value("domain", gname + "src")
+    dict['kickstart'] = global_parser.get_value("domain", gname + "ks")
     logger.debug('install source: \n    %s' %url)
     logger.debug('kisckstart file: \n    %s' %dict['kickstart'])
 
diff --git a/repos/domain/balloon_memory.py b/repos/domain/balloon_memory.py
index d48ea3b..dd3eafc 100644
--- a/repos/domain/balloon_memory.py
+++ b/repos/domain/balloon_memory.py
@@ -169,7 +169,7 @@ def balloon_memory(params):
     newdomxml = redefine_memory_size(domobj, domname, maxmem)
     logger.debug('''new domain %s xml :\n%s''' %(domname, newdomxml))
 
-    logger.info("undefine the original guest")
+    logger.info("undefine the original domain")
     try:
         domobj.undefine()
     except libvirtError, e:
diff --git a/repos/domain/cpu_affinity.py b/repos/domain/cpu_affinity.py
index 38ab5e3..47cd30a 100644
--- a/repos/domain/cpu_affinity.py
+++ b/repos/domain/cpu_affinity.py
@@ -81,7 +81,7 @@ def set_vcpus(util, domobj, domain_name, vcpu):
     newdomxml = redefine_vcpu_number(domobj, domain_name, vcpu)
     logger.debug('''new domain %s xml :\n%s''' %(domain_name, newdomxml))
 
-    logger.info("undefine the original guest")
+    logger.info("undefine the original domain")
     try:
         domobj.undefine()
     except libvirtError, e:
diff --git a/repos/domain/cpu_topology.py b/repos/domain/cpu_topology.py
index 5e95057..50876da 100644
--- a/repos/domain/cpu_topology.py
+++ b/repos/domain/cpu_topology.py
@@ -58,9 +58,9 @@ def add_cpu_xml(domobj, guestname, sockets, cores, threads, logger):
     return doc.toxml()
 
 def domain_undefine(domobj, logger):
-    """undefine original guest"""
+    """undefine original domain"""
     try:
-        logger.info("undefine guest")
+        logger.info("undefine domain")
         domobj.undefine()
         logger.info("undefine the domain is successful")
     except libvirtError, e:
@@ -74,7 +74,7 @@ def domain_undefine(domobj, logger):
 def domain_define(domobj, domxml, logger):
     """define new domain xml"""
     try:
-        logger.info("define guest")
+        logger.info("define domain")
         conn = domobj._conn;
         conn.defineXML(domxml)
         logger.info("success to define new domain xml description")
@@ -87,13 +87,13 @@ def domain_define(domobj, domxml, logger):
     return 0
 
 def domain_start(domobj, guestname, util, logger):
-    """start guest"""
+    """start domain"""
     timeout = 600
     ip = ''
     mac = utils.get_dom_mac_addr(guestname)
 
     try:
-        logger.info("start guest")
+        logger.info("start domain")
         domobj.create()
     except libvirtError, e:
         logger.error("API error message: %s, error code is %s" \
diff --git a/repos/domain/domain_blkinfo.py b/repos/domain/domain_blkinfo.py
index 5845550..eb946c9 100644
--- a/repos/domain/domain_blkinfo.py
+++ b/repos/domain/domain_blkinfo.py
@@ -91,7 +91,7 @@ def domblkinfo(params):
     conn = sharedmod.libvirtobj['conn']
 
     if not check_domain_exists(conn, guestname, logger):
-        logger.error("need a defined guest")
+        logger.error("need a defined domain")
         return 1
 
     logger.info("the output of virsh domblkinfo is:")
diff --git a/repos/domain/domain_uuid.py b/repos/domain/domain_uuid.py
index a3ad9e4..f4fc588 100644
--- a/repos/domain/domain_uuid.py
+++ b/repos/domain/domain_uuid.py
@@ -58,7 +58,7 @@ def domuuid(params):
     conn = sharedmod.libvirtobj['conn']
 
     if not check_domain_exists(conn, guestname, logger):
-        logger.error("need a defined guest")
+        logger.error("need a defined domain")
         return 1
 
     domobj = conn.lookupByName(guestname)
diff --git a/repos/domain/domblkinfo.py b/repos/domain/domblkinfo.py
index 9510e49..1a2007a 100644
--- a/repos/domain/domblkinfo.py
+++ b/repos/domain/domblkinfo.py
@@ -91,7 +91,7 @@ def domblkinfo(params):
     conn = sharedmod.libvirtobj['conn']
 
     if not check_domain_exists(conn, guestname, logger):
-        logger.error("need a defined guest")
+        logger.error("need a defined domain")
         return 1
 
     logger.info("the output of virsh domblkinfo is:")
diff --git a/repos/domain/install_linux_cdrom.py b/repos/domain/install_linux_cdrom.py
index 4588333..3005f2e 100644
--- a/repos/domain/install_linux_cdrom.py
+++ b/repos/domain/install_linux_cdrom.py
@@ -227,8 +227,8 @@ def install_linux_cdrom(params):
     logger.info("the environment file is %s" % envfile)
 
     global_parser = global_parser.GlobalParser(envfile)
-    ostree = global_parser.get_value("guest", os_type + "_" +os_arch)
-    ks = global_parser.get_value("guest", os_type + "_" +os_arch + "_http_ks")
+    ostree = global_parser.get_value("domain", os_type + "_" +os_arch)
+    ks = global_parser.get_value("domain", os_type + "_" +os_arch + "_http_ks")
 
     logger.debug('install source: \n    %s' % ostree)
     logger.debug('kisckstart file: \n    %s' % ks)
@@ -331,7 +331,7 @@ def install_linux_cdrom(params):
     if interval == 2400:
         if 'rhel3u9' in guestname:
             logger.info(
-            "domain installaton will be destoryed forcelly for rhel3u9 guest")
+            "domain installaton will be destoryed forcelly for rhel3u9 domain")
             domobj.destroy()
             logger.info("boot domain vm off harddisk")
             ret =  prepare_boot_domain(domobj, params, logger, installtype)
diff --git a/repos/domain/install_linux_check.py b/repos/domain/install_linux_check.py
index ea1d41e..62b39bb 100644
--- a/repos/domain/install_linux_check.py
+++ b/repos/domain/install_linux_check.py
@@ -88,12 +88,12 @@ def install_linux_check(params):
     if utils.do_ping(ipaddr, 20) == 1:
         logger.info("ping current domain successfull")
     else:
-        logger.error("Error: can't ping current guest")
+        logger.error("Error: can't ping current domain")
         Test_Result = 1
         return Test_Result
 
     # Creat file and read file in guest.
-    logger.info("check point2: creat and read dirctory/file in guest")
+    logger.info("check point2: creat and read dirctory/file in domain")
     if utils.create_dir(ipaddr, "root", "redhat") == 0:
         logger.info("create dir - /tmp/test successfully")
         if utils.write_file(ipaddr, "root", "redhat") == 0:
@@ -157,7 +157,7 @@ def install_linux_check(params):
     if utils.run_wget_app(ipaddr, "root", "redhat", file_url, logger) == 0:
         logger.info("run wget successfully in guest.")
     else:
-        logger.error("Error: fail to run wget in guest")
+        logger.error("Error: fail to run wget in domain")
         Test_Result = 1
         return Test_Result
 
diff --git a/repos/domain/install_linux_net.py b/repos/domain/install_linux_net.py
index dd350f4..81a25bf 100644
--- a/repos/domain/install_linux_net.py
+++ b/repos/domain/install_linux_net.py
@@ -197,14 +197,14 @@ def install_linux_net(params):
     # and installation method from global.cfg
 
     if installmethod == 'http':
-        ks = global_parser.get_value("guest", os_type + "_" + os_arch +
+        ks = global_parser.get_value("domain", os_type + "_" + os_arch +
                                 "_http_ks")
     elif installmethod == 'ftp':
-        ks = global_parser.get_value("guest", os_type + "_" + os_arch + "_ftp_ks")
+        ks = global_parser.get_value("domain", os_type + "_" + os_arch + "_ftp_ks")
     elif installmethod == "nfs":
-        ks = global_parser.get_value("guest", os_type + "_" + os_arch + "_nfs_ks")
+        ks = global_parser.get_value("domain", os_type + "_" + os_arch + "_nfs_ks")
 
-    ostree = global_parser.get_value("guest", os_type + "_" + os_arch)
+    ostree = global_parser.get_value("domain", os_type + "_" + os_arch)
 
     logger.debug('install source: \n    %s' % ostree)
     logger.debug('kisckstart file: \n    %s' % ks)
diff --git a/repos/domain/install_windows_cdrom.py b/repos/domain/install_windows_cdrom.py
index f6f03d7..7982391 100644
--- a/repos/domain/install_windows_cdrom.py
+++ b/repos/domain/install_windows_cdrom.py
@@ -261,8 +261,8 @@ def install_windows_cdrom(params):
 
     # Get iso file based on domain os and arch from global.cfg
     global_parser = global_parser.GlobalParser(envfile)
-    iso_file = global_parser.get_value("guest", os_type + '_' + os_arch)
-    cdkey = global_parser.get_value("guest", "%s_%s_key" % (os_type, os_arch))
+    iso_file = global_parser.get_value("domain", os_type + '_' + os_arch)
+    cdkey = global_parser.get_value("domain", "%s_%s_key" % (os_type, os_arch))
 
     windows_unattended_path = os.path.join(HOME_PATH,
                               "repos/domain/windows_unattended")
@@ -429,7 +429,7 @@ def install_windows_cdrom_clean(params):
 
     envfile = os.path.join(HOME_PATH, 'global.cfg')
     global_parser = global_parser.GlobalParser(envfile)
-    iso_file = global_parser.get_value("guest", os_type + '_' + os_arch)
+    iso_file = global_parser.get_value("domain", os_type + '_' + os_arch)
 
     status, iso_local_path = prepare_iso(iso_file, ISO_MOUNT_POINT)
     if os.path.exists(iso_local_path):
diff --git a/repos/domain/restore.py b/repos/domain/restore.py
index 99fbd50..b221c9f 100644
--- a/repos/domain/restore.py
+++ b/repos/domain/restore.py
@@ -28,7 +28,7 @@ def get_domain_ipaddr(*args):
         logger.info("ping current domain successfull")
         return ipaddr
     else:
-        logger.error("Error: can't ping current guest")
+        logger.error("Error: can't ping current domain")
         return None
 
 def check_domain_status(*args):
diff --git a/repos/domain/save.py b/repos/domain/save.py
index 50eef09..9db0667 100644
--- a/repos/domain/save.py
+++ b/repos/domain/save.py
@@ -28,7 +28,7 @@ def get_domain_ipaddr(*args):
         logger.info("ping current domain successfull")
         return ipaddr
     else:
-        logger.error("Error: can't ping current guest")
+        logger.error("Error: can't ping current domain")
         return None
 
 def check_domain_status(*args):
diff --git a/repos/domain/update_devflag.py b/repos/domain/update_devflag.py
index e87b1e5..6a6641a 100644
--- a/repos/domain/update_devflag.py
+++ b/repos/domain/update_devflag.py
@@ -78,7 +78,7 @@ def create_image(params, util, img_name):
     return True
 
 def check_device_in_domain(params, util, domip):
-    """Check updated device in guest"""
+    """Check updated device in domain"""
     logger = params['logger']
 
     if params['devtype'] == 'cdrom':
diff --git a/repos/regression/multiple_thread_block_on_domain_create.py b/repos/regression/multiple_thread_block_on_domain_create.py
index c4f6732..967b1b9 100644
--- a/repos/regression/multiple_thread_block_on_domain_create.py
+++ b/repos/regression/multiple_thread_block_on_domain_create.py
@@ -118,8 +118,8 @@ def multiple_thread_block_on_domain_create(params):
 
     envfile = os.path.join(homepath, 'global.cfg')
     global_parser = global_parser.GlobalParser(envfile)
-    ostree = global_parser.get_value("guest", os_type + "_" + arch)
-    ks = global_parser.get_value("guest", os_type + "_" + arch +
+    ostree = global_parser.get_value("domain", os_type + "_" + arch)
+    ks = global_parser.get_value("domain", os_type + "_" + arch +
                                 "_http_ks")
 
     # download vmlinuz and initrd.img
@@ -130,7 +130,7 @@ def multiple_thread_block_on_domain_create(params):
     urllib.urlretrieve(initrdpath, '/var/lib/libvirt/boot/initrd.img')
 
 
-    name = "guest"
+    name = "domain"
     start_num = num.split('-')[0]
     end_num = num.split('-')[1]
     thread_pid = []
diff --git a/repos/snapshot/file_flag.py b/repos/snapshot/file_flag.py
index df22b5c..dffbefb 100644
--- a/repos/snapshot/file_flag.py
+++ b/repos/snapshot/file_flag.py
@@ -57,7 +57,7 @@ def file_flag(params):
     conn = sharedmod.libvirtobj['conn']
 
     if not check_domain_running(conn, guestname, logger):
-        logger.error("need a running guest")
+        logger.error("need a running domain")
         return 1
 
     logger.info("get the mac address of vm %s" % guestname)
diff --git a/repos/snapshot/flag_check.py b/repos/snapshot/flag_check.py
index a4cf7cd..4699a67 100644
--- a/repos/snapshot/flag_check.py
+++ b/repos/snapshot/flag_check.py
@@ -46,7 +46,7 @@ def flag_check(params):
     conn = sharedmod.libvirtobj['conn']
 
     if not check_domain_running(conn, guestname, logger):
-        logger.error("need a running guest")
+        logger.error("need a running domain")
         return 1
 
     logger.info("get the mac address of vm %s" % guestname)
diff --git a/utils/utils.py b/utils/utils.py
index a216fa7..da68718 100644
--- a/utils/utils.py
+++ b/utils/utils.py
@@ -246,7 +246,7 @@ def get_capacity_suffix_size(capacity):
     return dicts
 
 def dev_num(guestname, device):
-    """Get disk or interface number in the guest"""
+    """Get disk or interface number in the domain"""
     cur = commands.getoutput("pwd")
     cmd = "sh %s/utils/dev_num.sh %s %s" % (cur, guestname, device)
     num = int(commands.getoutput(cmd))
-- 
1.7.7.3

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]