]> xenbits.xensource.com Git - xenrt-citrix/xenrt.git/commitdiff
Added irregular name decorators
authorDan Lamping <daniel.lamping@citrix.com>
Thu, 12 Nov 2015 16:47:30 +0000 (16:47 +0000)
committerDan Lamping <daniel.lamping@citrix.com>
Thu, 12 Nov 2015 16:47:30 +0000 (16:47 +0000)
exec/testcases/xenserver/tc/ring0/ring0linux.py
exec/xenrt/interfaces.py
exec/xenrt/lib/generic/instance.py
exec/xenrt/lib/generic/staticos.py
exec/xenrt/lib/xenserver/guest.py
exec/xenrt/objects.py

index 63ea7d27bafcc0c73481b38788b972a36fce0552..a078ff6c7e2b77719a5f459239a587c047b469c4 100644 (file)
@@ -3,6 +3,7 @@ from xenrt.lazylog import log, step
 
 import yaml
 
+@xenrt.irregularName
 class xst(object):
     def __init__(self, host, name):
         self.host = host
@@ -14,6 +15,7 @@ class xst(object):
     def path(self, f):
         return "/sys/kernel/debug/xst/%s/%s" % (self.name, f)
 
+    @xenrt.irregularName
     def set_params(self, params):
         for p in params:
             self.host.execdom0("echo %d > %s" % (p[1], self.path(p[0])))
index fa5e27f50cb7d2ffe0e3eefe0f66d12ad7167c75..f6f199b87967712a15bffce77a40d760fe912a49 100644 (file)
@@ -1,3 +1,4 @@
+import xenrt
 from zope.interface import Interface, Attribute
 
 __all__=["Toolstack", "OSParent", "OS", "InstallMethodPV", "InstallMethodIso", "InstallMethodIsoWithAnswerFile"]
@@ -87,30 +88,39 @@ class OSParent(Interface):
 
     _osParent_hypervisorType = Attribute("Hypervisor (or native) on which the OS is running")
 
+    @xenrt.irregularName
     def _osParent_getIP(trafficType, timeout, level):
         """Get the IP for the OS"""
 
+    @xenrt.irregularName
     def _osParent_getPort(trafficType):
         """Get the port for the traffic type"""
 
+    @xenrt.irregularName
     def _osParent_setIP(ip):
         """Set the IP for the OS"""
 
+    @xenrt.irregularName
     def _osParent_start():
         """Start the OS container (VM/host)"""
 
+    @xenrt.irregularName
     def _osParent_stop():
         """Stop the OS container (VM/host)"""
 
+    @xenrt.irregularName
     def _osParent_ejectIso():
         """Eject the ISO from the OS container"""
 
+    @xenrt.irregularName
     def _osParent_setIso(isoName, isoRepo):
         """Set the ISO to the specified iso"""
 
+    @xenrt.irregularName
     def _osParent_pollPowerState(state, timeout, level, pollperiod):
         """Poll for a change in power state"""
 
+    @xenrt.irregularName
     def _osParent_getPowerState():
         """Get the current power state"""
 
index 506c3d4bc903b0d7eb4c27fdc0f40fc5428e09ef..d1388f2c2bd17a744fbe15900b5c349abd24f697 100644 (file)
@@ -30,10 +30,12 @@ class Instance(object):
         self.special = {}
 
     @property
+    @xenrt.irregularName
     def _osParent_name(self):
         return self.name
 
     @property
+    @xenrt.irregularName
     def _osParent_hypervisorType(self):
         return self.toolstack.instanceHypervisorType(self)
 
@@ -57,6 +59,7 @@ class Instance(object):
         self.toolstack.discoverInstanceAdvancedNetworking(self)
         self.os.populateFromExisting()
 
+    @xenrt.irregularName
     def _osParent_pollPowerState(self, state, timeout=600, level=xenrt.RC_FAIL, pollperiod=15):
         """Poll for reaching the specified state"""
         deadline = xenrt.timenow() + timeout
@@ -69,12 +72,14 @@ class Instance(object):
                           (self.name, state), level)
             xenrt.sleep(15, log=False)
 
+    @xenrt.irregularName
     def _osParent_getPort(self, trafficType):
         if self.inboundmap.has_key(trafficType):
             return self.inboundmap[trafficType][1]
         else:
             return self.os.tcpCommunicationPorts[trafficType] 
 
+    @xenrt.irregularName
     def _osParent_getIP(self, trafficType=None, timeout=600, level=xenrt.RC_ERROR):
         if trafficType:
             if trafficType == "OUTBOUND":
@@ -96,12 +101,15 @@ class Instance(object):
             return self.mainip
         return self.toolstack.getInstanceIP(self, timeout, level)
 
+    @xenrt.irregularName
     def _osParent_setIP(self, ip):
         raise xenrt.XRTError("Not implemented")
 
+    @xenrt.irregularName
     def _osParent_start(self):
         self.toolstackStart()
 
+    @xenrt.irregularName
     def _osParent_stop(self):
         self.stop()
 
@@ -181,15 +189,18 @@ class Instance(object):
     def getPowerState(self):
         return self.toolstack.getInstancePowerState(self)
 
+    @xenrt.irregularName
     def _osParent_getPowerState(self):
         return self.getPowerState()
 
+    @xenrt.irregularName
     def _osParent_setIso(self, isoName, isoRepo=None):
         return self.setIso(isoName, isoRepo)
 
     def setIso(self, isoName, isoRepo=None):
         return self.toolstack.setInstanceIso(self, isoName, isoRepo)
 
+    @xenrt.irregularName
     def _osParent_ejectIso(self):
         return self.ejectIso()
 
index 564b5d408a1ba0a35e616f14a86b07551ddfe982..ce18554c99ae6fbde306ecfaa76a9af0726d7ead 100644 (file)
@@ -13,38 +13,49 @@ class StaticOS(object):
         self.os = xenrt.lib.opsys.osFactory(self.distro, self)
 
     @property
+    @xenrt.irregularName
     def _osParent_name(self):
         return "Static-%s" % self.mainip
 
     @property
+    @xenrt.irregularName
     def _osParent_hypervisorType(self):
         return None
 
+    @xenrt.irregularName
     def _osParent_pollPowerState(self, state, timeout=600, level=xenrt.RC_FAIL, pollperiod=15):
         """Poll for reaching the specified state"""
         raise xenrt.XRTError("Not supported")
 
+    @xenrt.irregularName
     def _osParent_getIP(self, trafficType=None, timeout=600, level=xenrt.RC_ERROR):
         return self.mainip
 
+    @xenrt.irregularName
     def _osParent_getPort(self, trafficType):
         return None
 
+    @xenrt.irregularName
     def _osParent_getPowerState(self):
         raise xenrt.XRTError("Not implemented")
 
+    @xenrt.irregularName
     def _osParent_setIP(self, ip):
         raise xenrt.XRTError("Not implemented")
 
+    @xenrt.irregularName
     def _osParent_start(self):
         raise xenrt.XRTError("Not implemented")
 
+    @xenrt.irregularName
     def _osParent_stop(self):
         raise xenrt.XRTError("Not implemented")
 
+    @xenrt.irregularName
     def _osParent_setIso(self, isoName, isoRepo=None):
         raise xenrt.XRTError("Not implemented")
 
+    @xenrt.irregularName
     def _osParent_ejectIso(self):
         raise xenrt.XRTError("Not implemented")
 
index ddd65e31a8a4a36affc512f6a3e0612901f9d5e1..7e67a3d3a2661b63761d709da6bd1662e9123cea 100755 (executable)
@@ -102,9 +102,11 @@ class Guest(xenrt.GenericGuest):
         self.memory = None # Default to template memory.
         self.vcpus = None # Default to template vcpus.
 
+    @xenrt.irregularName
     def _osParent_ejectIso(self):
         self.changeCD(None)
 
+    @xenrt.irregularName
     def _osParent_setIso(self, isoName, isoRepo=None):
         self.changeCD(isoName)
 
index a0938d90ec55606c2a290fb87a8a90459de7eb34..8db5479499db8288580f8b325d4aa332effc7f1e 100755 (executable)
@@ -4517,14 +4517,17 @@ class GenericHost(GenericPlace):
     ##### Methods from OSParent #####
 
     @property
+    @xenrt.irregularName
     def _osParent_name(self):
         return self.getName()
 
     @property
+    @xenrt.irregularName
     def _osParent_hypervisorType(self):
         # This refers to the Hypervisor type of the control domain, which for most purposes can assumed to be Native
         return xenrt.HypervisorType.native
 
+    @xenrt.irregularName
     def _osParent_getIP(self, trafficType=None, timeout=600, level=xenrt.RC_ERROR):
         if self.machine and self.use_ipv6:
             return self.machine.ipaddr6
@@ -4532,9 +4535,11 @@ class GenericHost(GenericPlace):
             return self.machine.ipaddr
         return None
 
+    @xenrt.irregularName
     def _osParent_getPort(self, trafficType):
         return None
 
+    @xenrt.irregularName
     def _osParent_setIP(self,ip):
         if self.machine:
             obj = IPy.IP(ip)
@@ -4545,24 +4550,30 @@ class GenericHost(GenericPlace):
         else:
             raise xenrt.XRTError("No host Object Found")
 
+    @xenrt.irregularName
     def _osParent_start(self):
         self.machine.powerctl.on()
 
+    @xenrt.irregularName
     def _osParent_stop(self):
         self.machine.powerctl.off()
 
+    @xenrt.irregularName
     def _osParent_ejectIso(self):
         # TODO implement this with Virtual Media
         raise xenrt.XRTError("Not implemented")
 
+    @xenrt.irregularName
     def _osParent_setIso(self, isoName, isoRepo=None):
         # TODO implement this with Virtual Media
         raise xenrt.XRTError("Not implemented")
 
+    @xenrt.irregularName
     def _osParent_pollPowerState(self, state, timeout=600, level=xenrt.RC_FAIL, pollperiod=15):
         """Poll for reaching the specified state"""
         raise xenrt.XRTError("Not supported")
 
+    @xenrt.irregularName
     def _osParent_getPowerState(self):
         """Get the current power state"""
         raise xenrt.XRTError("Not supported")
@@ -7107,41 +7118,52 @@ class GenericGuest(GenericPlace):
     ##### Methods from OSParent #####
 
     @property
+    @xenrt.irregularName
     def _osParent_name(self):
         return self.name
 
     @property
+    @xenrt.irregularName
     def _osParent_hypervisorType(self):
         return xenrt.HypervisorType.unknown
 
+    @xenrt.irregularName
     def _osParent_getIP(self, trafficType=None, timeout=600, level=xenrt.RC_ERROR):
         # TODO add arp sniffing capabilities here
         return self.mainip
 
+    @xenrt.irregularName
     def _osParent_getPort(self, trafficType):
         return None
 
+    @xenrt.irregularName
     def _osParent_setIP(self,ip):
         self.mainip = ip
 
+    @xenrt.irregularName
     def _osParent_start(self):
         self.lifecycleOperation("vm-start")
 
+    @xenrt.irregularName
     def _osParent_stop(self):
         self.lifecycleOperation("vm-shutdown")
 
+    @xenrt.irregularName
     def _osParent_ejectIso(self):
         # TODO implement this with ISO SRs
         raise xenrt.XRTError("Not implemented")
 
+    @xenrt.irregularName
     def _osParent_setIso(self, isoName, isoRepo=None):
         # TODO implement this with ISO SRs
         raise xenrt.XRTError("Not implemented")
 
+    @xenrt.irregularName
     def _osParent_pollPowerState(self, state, timeout=600, level=xenrt.RC_FAIL, pollperiod=15):
         """Poll for reaching the specified state"""
         self.poll(self.STATE_MAPPING[state], timeout, level, pollperiod)
 
+    @xenrt.irregularName
     def _osParent_getPowerState(self):
         """Get the current power state"""
         return [x for x in self.STATE_MAPPING.keys() if self.STATE_MAPPING[x] == self.getState()][0]