-
Notifications
You must be signed in to change notification settings - Fork 88
Added Dlpar_mem_hotplug Tescase #903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -466,9 +466,14 @@ def update_kernel_cmdline(self, distro, args="", remove_args="", reboot=True, | |
if reboot and (req_args or req_remove_args): | ||
# Reboot the host for the kernel command to reflect | ||
if reboot_cmd: | ||
# Always reopen console fresh to avoid stale session after first reboot | ||
self.cv_SYSTEM.console.close() | ||
raw_pty = self.cv_SYSTEM.console.get_console() | ||
raw_pty.sendline("reboot") | ||
raw_pty.expect("login:", timeout=900) | ||
login_patterns = [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you facing issues with only "login:" prompt? Trying to understand why we need login_patterns. If its really needed, can you use re expression to match any prompt ending with login: |
||
"login:", "root login:", "Ubuntu login:", "Password:", | ||
] | ||
raw_pty.expect(login_patterns, timeout=900) | ||
else: | ||
self.cv_SYSTEM.goto_state(OpSystemState.OFF) | ||
self.cv_SYSTEM.goto_state(OpSystemState.OS) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,23 +38,30 @@ | |
lpar2_name - name of destination lpar for move operation | ||
loop_num - number of times to run loop | ||
''' | ||
import time | ||
import unittest | ||
import logging | ||
import os.path | ||
from os import path | ||
import OpTestConfiguration | ||
import OpTestLogger | ||
from testcases.grub import Grub | ||
from common import OpTestHMC, OpTestFSP | ||
from common import OpTestHMC | ||
from common.OpTestSystem import OpSystemState | ||
from common.OpTestConstants import OpTestConstants as BMC_CONST | ||
from random import randint | ||
from common.OpTestSystem import OpSystemState | ||
from common.OpTestSOL import OpSOLMonitorThread | ||
from common import OpTestInstallUtil | ||
from common.OpTestUtil import OpTestUtil | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove additional line |
||
log = OpTestLogger.optest_logger_glob.get_logger(__name__) | ||
class OpTestDlpar(unittest.TestCase): | ||
def setUp(self): | ||
conf = OpTestConfiguration.conf | ||
self.op_test_util = OpTestUtil(conf) | ||
self.distro = self.op_test_util.distro_name() | ||
self.cv_SYSTEM = conf.system() | ||
self.console = self.cv_SYSTEM.console | ||
conf = OpTestConfiguration.conf | ||
|
@@ -315,6 +322,43 @@ def runTest(self): | |
log.debug("Deleting smt script") | ||
self.console.run_command("rm ./smt_script") | ||
|
||
|
||
class Dlpar_mem_hotplug(OpTestDlpar, unittest.TestCase): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please use standard convention of writing class name? |
||
"""Class for DLPAR Memory hotplug Tests | ||
This class executes test cases from OpTestDlpar.DlparMemBasic. | ||
|
||
Step 1 : memory_hotplug.memmap_on_memory=0 * test dlpar memory add, memory remove | ||
Step 2 : memory_hotplug.memmap_on_memory=1 * test dlpar memory add, memory remove | ||
Step 3 : memory_hotplug.memmap_on_memory=force * test dlpar memory add, memory remove | ||
""" | ||
|
||
def setUp(self): | ||
super(Dlpar_mem_hotplug, self).setUp() | ||
|
||
def runTest(self): | ||
obj = OpTestInstallUtil.InstallUtil() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can obj be replaced with something more meaningful |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove additional line |
||
test_settings = [0, 1, 'force'] | ||
for setting in test_settings: | ||
obj.update_kernel_cmdline( | ||
self.distro, | ||
args=f"memory_hotplug.memmap_on_memory={setting}", | ||
reboot=True, | ||
reboot_cmd=True | ||
) | ||
# Establish SSH connection | ||
con = self.cv_SYSTEM.cv_HOST.get_ssh_connection() | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove all additional lines. |
||
log.debug("Memory hotplug with setting: %s", setting) | ||
log.debug("=================") | ||
# Add memory resource | ||
self.AddRemove("mem", "-q", "a", self.mem_resource) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Additional lines |
||
#log.debug("Memory hotplug removal with setting: %s", setting) | ||
log.debug("=================") | ||
# Remove memory resource | ||
self.AddRemove("mem", "-q", "r", self.mem_resource) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove additional line |
||
def tearDown(self): | ||
self.console_thread.console_terminate() | ||
#reboot machine & delete script smt_script | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below we are anyway opening new console, is it really required?
Also, when reboot is executed, all the consoles will become inactive anyway right?