Skip to content

Commit

Permalink
fix(filesystem): repair block device test and GH workflow parameters (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
peknur authored Sep 25, 2023
1 parent 6bb0c52 commit 11c8739
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
branches: ["main"]
pull_request:
paths:
- driver/**
- internal/**
- cmd/**
- vendor/**
- go.*
- .github/**
Expand Down
8 changes: 4 additions & 4 deletions internal/filesystem/filesystem_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,14 @@ func mountBlockDevice(t *testing.T, m *LinuxFilesystem, partition string) error
mountPath := filepath.Join(os.TempDir(), fmt.Sprintf("%s-mount-path-%d", driverName, time.Now().Unix()))
defer os.RemoveAll(mountPath)

return mount(t, m, partition, mountPath, "bind")
return mount(t, m, partition, mountPath, "", "bind")
}

func mount(t *testing.T, m *LinuxFilesystem, source, target, fsType string) error {
func mount(t *testing.T, m *LinuxFilesystem, source, target, fsType string, opts ...string) error {
t.Helper()

if err := m.Mount(context.Background(), source, target, fsType); err != nil {
return fmt.Errorf("Mount failed with error: %w", err)
if err := m.Mount(context.Background(), source, target, fsType, opts...); err != nil {
return fmt.Errorf("Mount %s %s => %s failed with error: %w", fsType, source, target, err)
}
isMounted, err := m.IsMounted(context.Background(), target)
if err != nil {
Expand Down

0 comments on commit 11c8739

Please sign in to comment.