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

NVMe Command constant needs to use full path #53

Closed
wants to merge 1 commit into from
Closed

Conversation

karthikk92
Copy link
Contributor

@karthikk92 karthikk92 commented Nov 13, 2024

Description

NVMeCommand constant needs to use full path

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#1549

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

How Has This Been Tested?

Image build pointing to gonvme branch and installed powerstore driver and ran basic scale testing

UTs added and now coverage increased from 20% to 21.3%
image (5)

UTS covered under this PR: #54, once this is merged, will merge present PR.

gonvme_tcp_fc.go Outdated Show resolved Hide resolved
gonvme_tcp_fc.go Outdated
Comment on lines 70 to 76
if nvme.getChrootDirectory() != "/" {
command = append([]string{"chroot", nvme.getChrootDirectory()}, "which", DefaultNVMeCommand)
} else {
command = []string{"which", DefaultNVMeCommand}
}
log.Infof("NVMe %s",command)
path, err := exec.Command(command[0], command[1:]...).Output()
Copy link
Contributor

@donatwork donatwork Nov 14, 2024

Choose a reason for hiding this comment

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

This does not solve the original problem reported in the GitHub issue. You are still at the mercy of finding the command from the PATH. My interpretation of the original issue is to hard code the path to the nvme command. You could instead try some well known paths, e.g. [/bin/nvme, /usr/bin/nvme, ...] and pick the first one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@donatwork as discussed yesterday, we tried checking the different possible paths as its updated in commits, but its not working as expected as it checks the path locally and throws path does not exist.
image

Copy link
Contributor Author

@karthikk92 karthikk92 Nov 18, 2024

Choose a reason for hiding this comment

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

@donatwork as discussed code changes done with list of paths now and updated in the PR.

@karthikk92 karthikk92 force-pushed the nvme_update branch 2 times, most recently from a2ded98 to 95be92c Compare November 15, 2024 09:50
@karthikk92
Copy link
Contributor Author

Will add Single PR for Both defect fix and UT coverage

@karthikk92 karthikk92 closed this Nov 21, 2024
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