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 validation to self_update and no_self_update scenarios #10908
Conversation
select_console('install-shell'); | ||
assert_script_run('test -z "$(ls -A /download)"', | ||
fail_message => '/download directory is NOT empty, expected to be empty as no updates should be downloaded'); | ||
assert_script_run('! grep /var/log/YaST2/y2log -e "Trying installer update"', |
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.
Can i ask you to try the usage of --files-without-match. i kinda dislike the use of !
when there is another way, so it makes the expression more readable. For instance grep /var/log/YaST2/y2log --files-without-match -e "Trying installer update"
it greps what files do not have the expression "..." and returns 0
if file found have it.
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.
Hmm, I need to check how exactly that flag works, because the idea is that finds files that do not contain this string, so I'm not 100% sure if it will return 0
in case no files found. Let me try it out.
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.
Somehow grep -L 'Trying installer update' /var/log/YaST2/y2log
gives 1
as a return code, even though it lists /var/log/YaST2/y2log
as file without that string. Feels like a bug to me.
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.
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.
So the only thing I can propose here is to rewrite this line with script_run
and compare return code in perl code directly. Do you think this is better than negation of the bash command?
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.
you still need the -e
flag. Can you try?
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.
The command I've used is equivalent to grep /var/log/YaST2/y2log -L -e 'BLA'
so result is same, and as you can see on the screenshot it works just fine and returns the file, as it doesn't contain the string. I will check if that's expected, and file the bug against grep.
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.
I have just one recommendation to avoid negation in the expression. let me know what do you think. Other than that it is good to go for me.
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.
As per the discussion i think it is good to go
In order to test self update, we decided to use SLES product repo, as contains just couple of packages and has trusted certificate, so no need to process additional pop-up.
For validation we use internal knowledge about how updates are applied, namely downloaded in
/download
directory and then each update is mounted as `/mount/yast_*'.In negative scenario we check log entries and that directory is empty. As for distribution there are no updates available, directory would still remain empty. We will request QAM team to enable this scenario for the released updates to make sure no updates are downloaded even if are available.
As next iteration we are going to publish updates in the stub repo and validate that installer runs never version of the package.
See poo#69238.
Verification runs.
Test suite description update in the test plan.