Skip to content

Commit

Permalink
aws: update ec2-hibinit-agent version and increase volume size accord…
Browse files Browse the repository at this point in the history
…ingly

Signed-off-by: Frank Liang <[email protected]>
  • Loading branch information
liangxiao1 committed Nov 14, 2024
1 parent 8334675 commit 1b8867e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion os_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '0.3.0'
__codedate__ = '20241026'
__codedate__ = '20241114'
6 changes: 4 additions & 2 deletions os_tests/libs/resources_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
5 changes: 4 additions & 1 deletion os_tests/libs/utils_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
'''
Expand Down
7 changes: 4 additions & 3 deletions os_tests/tests/test_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1343,8 +1343,9 @@ def test_hibernate_resume(self):
N/A
maintainer:
[email protected]
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
Expand All @@ -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)
Expand Down

0 comments on commit 1b8867e

Please sign in to comment.