|
38 | 38 | lpar2_name - name of destination lpar for move operation |
39 | 39 | loop_num - number of times to run loop |
40 | 40 | ''' |
| 41 | +import time |
41 | 42 | import unittest |
42 | 43 | import logging |
43 | 44 | import os.path |
44 | 45 | from os import path |
45 | 46 | import OpTestConfiguration |
46 | 47 | import OpTestLogger |
| 48 | +from testcases.grub import Grub |
47 | 49 | from common import OpTestHMC, OpTestFSP |
48 | 50 | from common import OpTestHMC |
49 | 51 | from common.OpTestSystem import OpSystemState |
50 | 52 | from common.OpTestConstants import OpTestConstants as BMC_CONST |
51 | 53 | from random import randint |
52 | 54 | from common.OpTestSystem import OpSystemState |
53 | 55 | from common.OpTestSOL import OpSOLMonitorThread |
| 56 | +from common import OpTestInstallUtil |
| 57 | +from common.OpTestUtil import OpTestUtil |
| 58 | + |
54 | 59 | log = OpTestLogger.optest_logger_glob.get_logger(__name__) |
55 | 60 | class OpTestDlpar(unittest.TestCase): |
56 | 61 | def setUp(self): |
57 | 62 | conf = OpTestConfiguration.conf |
| 63 | + self.op_test_util = OpTestUtil(conf) |
| 64 | + self.distro = self.op_test_util.distro_name() |
58 | 65 | self.cv_SYSTEM = conf.system() |
59 | 66 | self.console = self.cv_SYSTEM.console |
60 | 67 | conf = OpTestConfiguration.conf |
@@ -315,6 +322,42 @@ def runTest(self): |
315 | 322 | log.debug("Deleting smt script") |
316 | 323 | self.console.run_command("rm ./smt_script") |
317 | 324 |
|
| 325 | + |
| 326 | +class DlparMemHotplug(OpTestDlpar, unittest.TestCase): |
| 327 | + """Class for DLPAR Memory hotplug Tests |
| 328 | + This class executes test cases from OpTestDlpar.DlparMemBasic. |
| 329 | + |
| 330 | + Step 1 : memory_hotplug.memmap_on_memory=0 * test dlpar memory add, memory remove |
| 331 | + Step 2 : memory_hotplug.memmap_on_memory=1 * test dlpar memory add, memory remove |
| 332 | + Step 3 : memory_hotplug.memmap_on_memory=force * test dlpar memory add, memory remove |
| 333 | + """ |
| 334 | + def setUp(self): |
| 335 | + super(DlparMemHotplug, self).setUp() |
| 336 | + |
| 337 | + def runTest(self): |
| 338 | + OpIUobj = OpTestInstallUtil.InstallUtil() |
| 339 | + test_settings = [0,1,'force'] |
| 340 | + for setting in test_settings: |
| 341 | + OpIUobj.update_kernel_cmdline( |
| 342 | + self.distro, |
| 343 | + args=f"memory_hotplug.memmap_on_memory={setting}", |
| 344 | + reboot=True, |
| 345 | + reboot_cmd=True |
| 346 | + ) |
| 347 | + # Establish SSH connection |
| 348 | + con = self.cv_SYSTEM.cv_HOST.get_ssh_connection() |
| 349 | + log.debug("Memory hotplug with setting: %s", setting) |
| 350 | + log.debug("=================") |
| 351 | + # Add memory resource |
| 352 | + self.AddRemove("mem", "-q", "a", self.mem_resource) |
| 353 | + log.debug("Memory hotplug removal with setting: %s", setting) |
| 354 | + log.debug("=================") |
| 355 | + # Remove memory resource |
| 356 | + self.AddRemove("mem", "-q", "r", self.mem_resource) |
| 357 | + log.debug("Remove Memory hotplug as part of cleanup with setting: %s", setting) |
| 358 | + OpIUobj.update_kernel_cmdline(self.distro, remove_args=f"memory_hotplug.memmap_on_memory={setting}", |
| 359 | + reboot=True, reboot_cmd=True) |
| 360 | + |
318 | 361 | def tearDown(self): |
319 | 362 | self.console_thread.console_terminate() |
320 | 363 | #reboot machine & delete script smt_script |
|
0 commit comments