memhotplug.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:avocado-misc-tests 作者: avocado-framework-tests 项目源码 文件源码
def dlpar_mem_hotplug(self):
        if 'ppc' in platform.processor() and 'PowerNV' not in open('/proc/cpuinfo', 'r').read():
            if "mem_dlpar=yes" in process.system_output("drmgr -C", ignore_status=True, shell=True):
                init_mem = memory.meminfo.MemTotal.kb
                self.log.info("\nDLPAR remove memory operation\n")
                for _ in range(len(self.blocks_hotpluggable) / 2):
                    process.run(
                        "drmgr -c mem -d 5 -w 30 -r", shell=True, ignore_status=True, sudo=True)
                if memory.meminfo.MemTotal.kb >= init_mem:
                    self.log.warn("dlpar mem could not complete")
                self.run_stress()
                init_mem = memory.meminfo.MemTotal.kb
                self.log.info("\nDLPAR add memory operation\n")
                for _ in range(len(self.blocks_hotpluggable) / 2):
                    process.run(
                        "drmgr -c mem -d 5 -w 30 -a", shell=True, ignore_status=True, sudo=True)
                if init_mem < memory.meminfo.MemTotal.kb:
                    self.log.warn("dlpar mem could not complete")
            else:
                self.log.info('UNSUPPORTED: dlpar not configured..')
        else:
            self.log.info("UNSUPPORTED: Test not supported on this platform")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号