当前位置: 首页>>代码示例>>Python>>正文


Python ComSystem.getExecMode方法代码示例

本文整理汇总了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)
开发者ID:Open-Sharedroot,项目名称:Open-Sharedroot-cluster-suite,代码行数:30,代码来源:testComFilesystemCopyset.py

示例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))
开发者ID:MarcGrimme,项目名称:comoonics-cluster-suite,代码行数:12,代码来源:testComFileSystem.py

示例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)
开发者ID:MarcGrimme,项目名称:comoonics-cluster-suite,代码行数:33,代码来源:testComFileSystem.py


注:本文中的comoonics.ComSystem.getExecMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。