-
Notifications
You must be signed in to change notification settings - Fork 280
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
MicroOS: Add basic tests for Toolbox #12038
Conversation
@dfaggioli @thkukuk FYI |
LGTM . |
Thanks. No, docker is not part of MicroOS/SLE Micro |
tests/microos/toolbox.pm
Outdated
my $image = is_sle_micro ? 'opensuse/toolbox:latest' : 'suse/sle-micro/5.0/toolbox:latest'; | ||
my $expected = is_sle_micro ? 'opensuse' : 'sles'; | ||
assert_script_run 'echo -e "REGISTRY=' . $registry . '\nIMAGE=' . $image . '" > ~/.toolboxrc'; | ||
validate_script_output 'toolbox cat /etc/os-release', sub { m/${expected}/ }, timeout => 180; |
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.
why not check_os_release($expected, 'PRETTY_NAME', 'toolbox');
would it work?
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.
tried and it doesn't work, cause it does toolbox grep -e '^PRETTY_NAME\b' /etc/os-release
and it complains toolbox: invalid option -- 'e'
.
So, we would need to tweak the function to achieve issuing toolbox -- grep -e '^PRETTY_NAME\b' /etc/os-release
, but I don't think it's needed for this single thing.
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.
CI fails, just some minor comments.
For TW, I am still facing some issues that are already solved in toolbox repo, but are not pushed to the image yet. |
I am ready with the PR but I would like to wait until getting latest toolbox fixes in TW. Currently failing in some bug already fixed in toolbox: http://fromm.arch.suse.de/tests/293#step/toolbox/46 |
Latest code works on SLE Micro but fails in TW due to this issue: openSUSE/microos-toolbox#25 Will remove |
record_info('ISSUE', 'https://github.com/kubic-project/microos-toolbox/issues/23'); | ||
} | ||
script_run 'toolbox run -c devel -- zypper lr'; # this command will fail in SLE Micro toolbox as there are no repos | ||
assert_script_run 'toolbox run -c devel -- zypper -n in python3' unless is_sle_micro; |
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.
are you testing zypper
here ? than I would go for something less error prone and more stable to not dive into all surprises which python3
might bring ...
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 just followed the same thing we do in container tests. But you are right, we could just tests something more meaningful for a toolbox use case (htop, nmap, ...)
|
||
our $user = 'test_user'; | ||
|
||
sub cleanup { |
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.
Maybe, I can call clean_container_host
from here but I need to keep userdel -rf $user
anyways.
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.
3 options possible and I don't have strong opinion which one is better here ... :
- leave things as it is right now .
- call cleanup from
containers/common.pm
here to avoid duplication with podman part of cleanup - increase amount of
if
's incontainers/common.pm
and merge altogether
each choice has down and up sides so I am not sure ....
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.
Option 2 for now :)
They are applicable for SLE Micro and openSUSE MicroOS
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.
LGTM
@Vogtinator this one is also ready, any other change requested? |
They are applicable for SLE Micro and openSUSE MicroOS