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

Add test for EFI log processing #1324

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

elkoniu
Copy link

@elkoniu elkoniu commented Oct 23, 2024

'/usr/libexec/anaconda/log-capture' is an util to generate runtime logs. This commit adds test validating output of this util.

Copy link
Contributor

@M4rtinK M4rtinK left a comment

Choose a reason for hiding this comment

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

Looks good to me - thanks! :)

Just added some suggestions for using fragments to provide generic/boilerplate bits in the kickstart via kickstart fragments. :)

efi-log.ks.in Outdated
%ksappend repos/default.ks
network --bootproto=dhcp

bootloader --timeout=1
Copy link
Contributor

Choose a reason for hiding this comment

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

I think other than the %post script this kickstart tests does not really need anything special, right ? In that case I would suggest using of the "common boilerplate" kickstart fragments instead to inject the common things. For example this one:

https://github.com/rhinstaller/kickstart-tests/blob/master/fragments/shared/common/common_no_payload.ks

A similar (mainly needs to do stuff in %post) kickstart tests that uses this fragment:

%ksappend common/common_no_payload.ks

Copy link
Author

Choose a reason for hiding this comment

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

Updated according to suggestion.


%end

%post
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Updated according to suggestion

'/usr/libexec/anaconda/log-capture' is an util to generate runtime logs.
This commit adds test validating output of this util.
@elkoniu
Copy link
Author

elkoniu commented Oct 30, 2024

@M4rtinK thanks for the review. I have updated the code following your guidelines. Also I have split test cases in half: check if the util exists, call the util and expect 0 return code. Do you thing this is good enough validation?

@elkoniu elkoniu marked this pull request as ready for review October 30, 2024 23:48
@KKoukiou
Copy link
Contributor

KKoukiou commented Nov 1, 2024

/test-tmt

@KKoukiou
Copy link
Contributor

KKoukiou commented Nov 1, 2024

/test-os-variants

@M4rtinK
Copy link
Contributor

M4rtinK commented Nov 1, 2024

@M4rtinK thanks for the review. I have updated the code following your guidelines. Also I have split test cases in half: check if the util exists, call the util and expect 0 return code. Do you thing this is good enough validation?

Agreed with the split - like this we can easily see from the logs what exactly went wrong, nice! :)

As for validation - it creates a tarball, right ? I guess we could check the file exists and is of non-zero size ? But I leave it up to you, given we already check the return code. :)

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