-
Notifications
You must be signed in to change notification settings - Fork 99
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
test(ci): adding wrapper for vg and pv operations #317
Conversation
What is the rationale behind these wrappers? Sometime earlier we discussed that we'll leave these operations as it exists today, until we integrate to a common mechanism to manage lvm including Mayastor LVM backend. |
This is going to be used in the ci tests. We have scenarios where there is multiple vg in the node, there is a scenario to do vgextend ans see provisioning work. |
1340667
to
73b136d
Compare
5dd59bd
to
f1a328c
Compare
can you please squash the relevant commits. I see commits |
tests/utils.go
Outdated
filename, "--show", | ||
} | ||
|
||
stdout_loop, _, err := execAtLocal("sudo", nil, args_loop...) |
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.
We can run the test using sudo, e.g.: https://github.com/openebs/dynamic-localpv-provisioner/blob/v3.5.x/Makefile#L146
If the test is using a shell script, e.g. test.sh, run it using sudo bash -c "./test.sh"
We should not call sudo implicitly like so.
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 main ci script in lvm repo runs as non-root user in github actions. Most of the work done inside that script is doing sudo
today e.g. sudo vgcreate
. These new wrappers seem to be emulating same.
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.
This feels like tech debt. But oh well.
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.
We could have a wrapper for calls which require sudo. In general IMHO it's better to use sudo only for operations which need it rather than blindly run everything with sudo as that seems a lot more dangerous.
c01df96
to
52bcb45
Compare
Signed-off-by: Abhilash Shetty <[email protected]>
c8a3188
to
24b56ef
Compare
Why is this PR required? What issue does it fix?:
This PR adds required wrapper funcations for PV and VG operations. Its required for new tests to be automated
What this PR does?:
Same as above
Does this PR require any upgrade changes?:
NA
Checklist:
<type>(<scope>): <subject>