diff --git a/dlpar/dlpar_main.py b/dlpar/dlpar_main.py index 45a792fa8..1482a0b69 100644 --- a/dlpar/dlpar_main.py +++ b/dlpar/dlpar_main.py @@ -164,9 +164,14 @@ def mem_payload_data(curr_mem, lmb, max_value=0): result_list = [] current_sum = 0 index_value = lmb + cmd = 'htxcmdline -query -mdt mdt.*' if max_value == 0: - # Calculate 80% of curr_mem - max_value = curr_mem * 0.8 + cmd_output = process.system_output(cmd, ignore_status=True).decode() + if 'IDLE' not in cmd_output: + max_value = curr_mem * 0.4 + else: + # Calculate 80% of curr_mem + max_value = curr_mem * 0.8 # Ensure max_value is divisible by lmb max_value += lmb - (max_value % lmb) current_sum = 0 @@ -368,6 +373,8 @@ def test_mix_cpu(self): self.fail("Cpu remove Command failed \ please check the logs") self.log.info("====>%s cpu got removed====>\n " % vp) + file_to_remove = 'config.txt' + os.remove(file_to_remove) def test_mem_add(self): Mem_obj = Memory(self.sorted_payload, log='memory.log') @@ -426,8 +433,6 @@ def test_mem_mix(self): self.fail("MEM remove Command failed please check the logs") self.log.info( "====>%s memory got removed====>\n " % rem) - file_to_remove = 'config.txt' - os.remove(file_to_remove) def test_cpu_move(self): if self.lpar_mode == 'dedicated':