diff --git a/os_tests/__init__.py b/os_tests/__init__.py index d64c3c24..14b82118 100644 --- a/os_tests/__init__.py +++ b/os_tests/__init__.py @@ -1,2 +1,2 @@ __version__ = '0.3.0' -__codedate__ = '20241026' \ No newline at end of file +__codedate__ = '20241114' \ No newline at end of file diff --git a/os_tests/libs/resources_aws.py b/os_tests/libs/resources_aws.py index 18b7c61c..31538848 100644 --- a/os_tests/libs/resources_aws.py +++ b/os_tests/libs/resources_aws.py @@ -120,11 +120,13 @@ def create(self, wait=True, enable_efa=True, enable_hibernation=False, enable_en except Exception as error: LOG.info('Cannot determin root device name, use default {}'.format(self.root_device_name)) - if enable_hibernation and self.volume_size < 50: + # needs to increase default volume size to 50(not sufficient some times) to launch instance with hibernation enabled + # now set it to 80 + if enable_hibernation and self.volume_size < 80: if not self.hibernation_support: LOG.info("instance do not support hibernation") return False - self.volume_size = 50 + self.volume_size = 80 LOG.info('hibernation_support enabled, change volume size to {}'.format(self.volume_size)) if enable_enclave and self.volume_size < 50: LOG.info('create with enclave enabled, change volume size to {}'.format(self.volume_size)) diff --git a/os_tests/libs/utils_lib.py b/os_tests/libs/utils_lib.py index a55137d8..88b913fc 100644 --- a/os_tests/libs/utils_lib.py +++ b/os_tests/libs/utils_lib.py @@ -1183,8 +1183,11 @@ def pkg_install(test_instance, pkg_name=None, pkg_url=None, force=False, rmt_nod if force: cmd = cmd + " --force" run_cmd(test_instance, cmd, timeout=1200) - if not is_pkg_installed(test_instance, pkg_name=pkg_name, rmt_node=rmt_node, vm=vm): + if not is_pkg_installed(test_instance, pkg_name=pkg_name, rmt_node=rmt_node, vm=vm) and not force: test_instance.skipTest("Cannot install {} automatically!".format(pkg_name)) + elif not is_pkg_installed(test_instance, pkg_name=pkg_name, rmt_node=rmt_node, vm=vm) and force: + # when try to install pkg with force=True, we suspect it is must for test continue, so fail the case directly + test_instance.fail("Cannot install {} automatically!") def is_rhsm_registered(test_instance, cancel_case=False, timeout=600, rmt_node=None, vm=None): ''' diff --git a/os_tests/tests/test_lifecycle.py b/os_tests/tests/test_lifecycle.py index b3f6ace8..b03a80be 100644 --- a/os_tests/tests/test_lifecycle.py +++ b/os_tests/tests/test_lifecycle.py @@ -1343,8 +1343,9 @@ def test_hibernate_resume(self): N/A maintainer: xiliang@redhat.com - description: + description: | Test system hibernation and process is still running after resumed + For aws, please check for prerequisites https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html#hibernation-prereqs-supported-instance-families key_steps: | 1. enable hibernation on system 2. start a test process, eg. sleep 1800 @@ -1371,11 +1372,11 @@ def test_hibernate_resume(self): utils_lib.init_connection(self, timeout=self.ssh_timeout) product_id = utils_lib.get_os_release_info(self, field='VERSION_ID') if float(product_id) >= 8.0 and float(product_id) < 9.0: - pkg_url='https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/e/ec2-hibinit-agent-1.0.5-1.el8.noarch.rpm' + pkg_url='https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/e/ec2-hibinit-agent-1.0.9-1.el8.noarch.rpm' elif float(product_id) < 8.0: self.skipTest('not supported earlier than rhel8') else: - pkg_url = "https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/e/ec2-hibinit-agent-1.0.5-1.el9.noarch.rpm" + pkg_url = "https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/e/ec2-hibinit-agent-1.0.9-1.el9.noarch.rpm" utils_lib.pkg_install(self, pkg_name='ec2-hibinit-agent', pkg_url=pkg_url, force=True) cmd = 'sudo systemctl is-enabled hibinit-agent.service' output = utils_lib.run_cmd(self, cmd)