Skip to content
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

guest os booting: add new modular case for direct kernel boot #5073

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

meinaLi
Copy link
Contributor

@meinaLi meinaLi commented Aug 1, 2023

This PR mainly automates:
VIRT-297126 - Boot vm with direct kernel

@meinaLi
Copy link
Contributor Author

meinaLi commented Aug 1, 2023

# avocado run --vt-type libvirt --test-runner=runner --vt-machine-type q35 guest_os_booting.direct_kernel_boot.start_guest
JOB ID     : 4594ae10367dba5500102ae42d3da6680813831e
JOB LOG    : /var/lib/avocado/job-results/job-2023-07-31T23.28-4594ae1/job.log
 (1/1) type_specific.io-github-autotest-libvirt.guest_os_booting.direct_kernel_boot.start_guest: PASS (104.60 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /var/lib/avocado/job-results/job-2023-07-31T23.28-4594ae1/results.html
JOB TIME   : 107.86 s

@meinaLi meinaLi marked this pull request as draft August 1, 2023 03:43
@meinaLi meinaLi force-pushed the direct_kernel branch 3 times, most recently from 74fd151 to e5f3fc3 Compare August 11, 2023 08:20
@meinaLi meinaLi force-pushed the direct_kernel branch 3 times, most recently from 0b87733 to 734de75 Compare August 15, 2023 03:37
@meinaLi meinaLi marked this pull request as ready for review August 15, 2023 07:58
Comment on lines 40 to 43
direct_kernel_dict = eval(params.get("direct_kernel_dict", "{}")
% (boot_initrd, boot_vmlinuz))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will fail if direct_kernel_dict is {}, can you try format()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work with an error. So here I only removed {} in it.

:param dest_file: The dest file path
:param test: Avocado test object
"""
if utils_package.package_install("wget"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we recommend installing packages for host in ci

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can configure it in jobs.yaml. But for wget package I'm just curious that if we use avocado.utils.download, don't we need to configure it in jobs.yaml, is that right?

if utils_package.package_install("wget"):
if url.count("URL"):
test.cancel("Please provide the url %s" % url)
download_cmd = "wget %s -O %s" % (url, dest_file)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please reuse avocado.utils.download

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the function download_url in guest_os_booting_base.py and directly use url_download in avocado.utils.download.

vmxml.set_memory(memory_value)
vmxml.set_current_mem(memory_value)
vmxml.sync()
test.log.info("The final guest xml is %s", vmxml)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
test.log.info("The final guest xml is %s", vmxml)
test.log.debug("The final guest xml is %s", vmxml)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Copy link
Contributor

@Yingshun Yingshun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Others LGTM

@chloerh chloerh merged commit ba94749 into autotest:master Sep 28, 2023
4 checks passed
@meinaLi meinaLi deleted the direct_kernel branch October 8, 2023 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants