本文整理汇总了Python中comoonics.ComSystem.getExecMode方法的典型用法代码示例。如果您正苦于以下问题:Python ComSystem.getExecMode方法的具体用法?Python ComSystem.getExecMode怎么用?Python ComSystem.getExecMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类comoonics.ComSystem
的用法示例。
在下文中一共展示了ComSystem.getExecMode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testFilesystemCopyObject2
# 需要导入模块: from comoonics import ComSystem [as 别名]
# 或者: from comoonics.ComSystem import getExecMode [as 别名]
def testFilesystemCopyObject2(self):
from comoonics import ComSystem
_xml="""
<copyset type="filesystem" name="save-tmp">
<source type="filesystem">
<device id="sourcerootfs" name="/dev/vg_vmware_cluster_sr/lv_sharedroot" options="skipmount">
<filesystem type="gfs"/>
<mountpoint name="/">
<option value="lock_nolock" name="lockproto"/>
<option value="hdfhgg" name="locktable"/>
</mountpoint>
</device>
</source>
<destination type="filesystem">
<device id="destrootfs" name="/dev/vg_vmware_cluster_srC/lv_sharedroot">
<filesystem clustername="vmware_cluster" type="gfs"/>
<mountpoint name="/var/lib/com-ec/dest">
<option value="lock_nolock" name="lockproto"/>
<option value="jhdshf" name="locktable"/>
</mountpoint>
</device>
</destination>
</copyset>
"""
oldexecmode=ComSystem.getExecMode()
ComSystem.setExecMode(ComSystem.SIMULATE)
self.__testCopyset(_xml)
ComSystem.setExecMode(oldexecmode)
示例2: _testMethod
# 需要导入模块: from comoonics import ComSystem [as 别名]
# 或者: from comoonics.ComSystem import getExecMode [as 别名]
def _testMethod(self, method, execmode, *params):
oldmode=ComSystem.getExecMode()
ComSystem.clearSimCommands()
ComSystem.setExecMode(execmode)
try:
method(*params)
except Exception, e:
import traceback
traceback.print_exc()
self.fail("Could not execute %s method on with parameters %s, Error: %s" %(method, params, e))
示例3:
# 需要导入模块: from comoonics import ComSystem [as 别名]
# 或者: from comoonics.ComSystem import getExecMode [as 别名]
self.xml="""
<device id="sourcerootfs" name="/dev/vg_vmware_cluster_sr/lv_sharedroot">
<filesystem type="ocfs2"/>
<mountpoint name="/"/>
</device>
"""
self.simmethods=["mount -t ocfs2 -o defaults /dev/vg_vmware_cluster_sr/lv_sharedroot /",
"umount /dev/vg_vmware_cluster_sr/lv_sharedroot",
"umount /",
"yes | mkfs -t ocfs2 -F /dev/vg_vmware_cluster_sr/lv_sharedroot",
"ocfs2.fsck -y /dev/vg_vmware_cluster_sr/lv_sharedroot",
"tunefs.ocfs2 -L /dev/vg_vmware_cluster_sr/lv_sharedroot mylabel",
"tunefs.ocfs2 -L /dev/vg_vmware_cluster_sr/lv_sharedroot"
]
self.name="ocfs2"
BaseTestFileSystem.__init__(self, method)
testclasses=[TestGfsFileSystem, TestExt2FileSystem, TestExt3FileSystem, TestOcfs2FileSystem]
testmethods=[ "testMount", "testUmountDev", "testUmountDir", "testGetName", "testFormatDevice", "testLabelDevice", "testCheckFs", "testGetLabel" ]
if __name__ == "__main__":
oldmode=ComSystem.getExecMode()
ComSystem.setExecMode(ComSystem.SIMULATE)
#import sys;sys.argv = ['', 'Test.testName']
suite=unittest.TestSuite()
for testclass in testclasses:
for testmethod in testmethods:
suite.addTest(testclass(testmethod))
runner=unittest.TextTestRunner()
runner.run(suite)
ComSystem.setExecMode(oldmode)