Skip to content

Do not run btrfs tests if btrfs kernel module is not loaded#5539

Merged
dmcgowan merged 1 commit intocontainerd:masterfrom
alakesh:btrfs-test
May 27, 2021
Merged

Do not run btrfs tests if btrfs kernel module is not loaded#5539
dmcgowan merged 1 commit intocontainerd:masterfrom
alakesh:btrfs-test

Conversation

@alakesh
Copy link
Copy Markdown
Contributor

@alakesh alakesh commented May 26, 2021

Check if btrfs module is loaded. if not do not run btrfs test.

Signed-off-by: Alakesh Haloi [email protected]

@k8s-ci-robot
Copy link
Copy Markdown

Hi @alakesh. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented May 26, 2021

Build succeeded.

@samuelkarp
Copy link
Copy Markdown
Member

/ok-to-test


// TODO: Check for btrfs in /proc/module and skip if not loaded
procModules, err := ioutil.ReadFile("/proc/modules")
if err == nil && !bytes.Contains(procModules, []byte("btrfs")) {
Copy link
Copy Markdown
Member

@samuelkarp samuelkarp May 26, 2021

Choose a reason for hiding this comment

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

Considering procModules is already a string, why use bytes.Contains instead of strings.Contains?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Readfile function returns a []byte type hence thought of using it like that. Could also convert it to a string and then use strings.Contain() but both approaches look similar.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, I misread the code.

Copy link
Copy Markdown
Member

@samuelkarp samuelkarp left a comment

Choose a reason for hiding this comment

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

LGTM

@dmcgowan dmcgowan merged commit 925ff5a into containerd:master May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants