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

Ut coverage #58

Open
wants to merge 41 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6d3b2df
UT_coverage for file gofsutil_mount_unix.go
sakshi-garg1 Dec 5, 2024
c0aaf8f
fs UT coverage
KshitijaKakde Dec 5, 2024
0beb4ea
fs UT coverage
KshitijaKakde Dec 5, 2024
799e2f4
Updated UTS for gofsutil_mount_linux file
karthikk92 Dec 6, 2024
254aa8a
To increase gofsutil.go coverage
sakshi-garg1 Dec 6, 2024
f7667ca
Update gofsutil_mount_unix_test.go
sakshi-garg1 Dec 6, 2024
cd7b72e
Update gofsutil_mount_unix_test.go
sakshi-garg1 Dec 6, 2024
7a451c5
Update gofsutil_mount_unix_test.go
sakshi-garg1 Dec 6, 2024
1872a37
Duplicate testcase name
sakshi-garg1 Dec 6, 2024
29d5158
Update gofsutil_unix_test.go
sakshi-garg1 Dec 6, 2024
165b9fa
Update gofsutil_mount_unix_test.go
sakshi-garg1 Dec 9, 2024
03d0f28
Making package as gofsutil
sakshi-garg1 Dec 9, 2024
3106be6
Increasing gofsutil_mount_unix.go coverage
sakshi-garg1 Dec 9, 2024
e376bc7
Delete gofsutil_mount_unix_test.go
sakshi-garg1 Dec 9, 2024
ea1237c
Update gofsutil_mount_test.go
sakshi-garg1 Dec 9, 2024
0d823c6
Update gofsutil_unix_test.go
sakshi-garg1 Dec 9, 2024
9a06a8c
Update gofsutil_mount_test.go
sakshi-garg1 Dec 9, 2024
d84f6aa
Update gofsutil_mount_test.go
sakshi-garg1 Dec 9, 2024
a3cefb5
added UT for gofsutil file
chaganti-rajitha Jan 20, 2025
0b9bcb3
improved the coverage to 48.5%
niranjan-n1 Jan 20, 2025
4f9c48d
improved the coverage to 48.5%
niranjan-n1 Jan 20, 2025
996749b
improved the coverage to 48.7%
niranjan-n1 Jan 20, 2025
2f1f651
increased the coverage to 49.7%
niranjan-n1 Jan 21, 2025
cab932e
Increased the coverage to 54.9
chaganti-rajitha Jan 21, 2025
6312084
improved coverage to 52.5%
niranjan-n1 Jan 21, 2025
f3c0b2f
Merge branch 'UT_coverage' of https://github.com/dell/gofsutil into U…
niranjan-n1 Jan 21, 2025
f50cc15
increased the coverage to 60%
niranjan-n1 Jan 21, 2025
9c4c81d
Merge branch 'main' into UT_coverage
niranjan-n1 Jan 21, 2025
ae8ec3f
commented out the failing test
niranjan-n1 Jan 21, 2025
b6f0474
Merge branch 'UT_coverage' of https://github.com/dell/gofsutil into U…
niranjan-n1 Jan 21, 2025
b8603e4
increased coverage to 61.5%
niranjan-n1 Jan 22, 2025
5d6c05e
Commented failing functions in github actions
chaganti-rajitha Jan 23, 2025
2a75b6c
Commented failing functions in github actions
chaganti-rajitha Jan 23, 2025
a5d6a0b
fixed lint issues
chaganti-rajitha Jan 23, 2025
07dc2fb
increased coverage to 52 from 51 after commenting failed functions
chaganti-rajitha Jan 23, 2025
651628c
increase UT to 51.8
chaganti-rajitha Jan 23, 2025
b03fa98
removed failing code
chaganti-rajitha Jan 23, 2025
2543f72
added test case
chaganti-rajitha Jan 29, 2025
38a01f6
fixed failing test case
chaganti-rajitha Jan 29, 2025
45fd4bd
fixed lint issue
chaganti-rajitha Jan 29, 2025
bc4a661
Fixed failing test case
chaganti-rajitha Jan 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions gofsutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ var (
ErrNotImplemented = errors.New("not implemented")

// fs is the default FS instance.
fs FSinterface = &FS{ScanEntry: defaultEntryScanFunc, SysBlockDir: "/sys/block"}
fs FSinterface = &FS{ScanEntry: defaultEntryScanFunc}

multipathDevDiskByID = "/dev/disk/by-id/"
)

// ContextKey is a variable containing context-keys
Expand All @@ -102,11 +104,6 @@ func UseMockFS() {
fs = &mockfs{ScanEntry: defaultEntryScanFunc}
}

// UseMockSysBlockDir creates a file system for testing.
func UseMockSysBlockDir(mockSysBlockDir string) {
fs = &FS{ScanEntry: defaultEntryScanFunc, SysBlockDir: mockSysBlockDir}
}

// GetDiskFormat uses 'lsblk' to see if the given disk is unformatted.
func GetDiskFormat(ctx context.Context, disk string) (string, error) {
return fs.GetDiskFormat(ctx, disk)
Expand Down
5 changes: 3 additions & 2 deletions gofsutil_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ import (
"golang.org/x/sys/unix"
)

// SysBlockDir is used to set the directory of block devices.
var SysBlockDir = "/sys/block"

// FS provides many filesystem-specific functions, such as mount, format, etc.
type FS struct {
// ScanEntry is the function used to process mount table entries.
ScanEntry EntryScanFunc
// SysBlockDir is used to set the directory of block devices.
SysBlockDir string
}

// GetDiskFormat uses 'lsblk' to see if the given disk is unformatted.
Expand Down
Loading