Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#288 from animeshk08/node-server-test
Browse files Browse the repository at this point in the history
Tests: Add unit test and run tests with root privileges
  • Loading branch information
k8s-ci-robot committed May 24, 2020
2 parents d3db834 + 57ce226 commit a3e8d0d
Show file tree
Hide file tree
Showing 6 changed files with 444 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v2

- name: Test
run: go test -covermode=count -coverprofile=profile.cov ./pkg/...
run: sudo go test -covermode=count -coverprofile=profile.cov ./pkg/...

- name: Send coverage
env:
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ before_install:
- GO111MODULE=off go get github.com/mattn/goveralls

script:
- go test -covermode=count -coverprofile=profile.cov ./pkg/...
- sudo -E env "PATH=$PATH" go test -covermode=count -coverprofile=profile.cov ./pkg/...
- $GOPATH/bin/goveralls -coverprofile=profile.cov -service=travis-ci
Empty file modified Makefile
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions pkg/azurefile/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,13 @@ func (d *Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolu

klog.V(2).Infof("NodeUnstageVolume: CleanupMountPoint %s", stagingTargetPath)
if err := CleanupSMBMountPoint(d.mounter, stagingTargetPath, false); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmount staing target %q: %v", stagingTargetPath, err)
return nil, status.Errorf(codes.Internal, "failed to unmount staging target %q: %v", stagingTargetPath, err)
}

targetPath := filepath.Join(filepath.Dir(stagingTargetPath), proxyMount)
klog.V(2).Infof("NodeUnstageVolume: CleanupMountPoint %s", targetPath)
if err := CleanupMountPoint(d.mounter, targetPath, false); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmount staing target %q: %v", targetPath, err)
return nil, status.Errorf(codes.Internal, "failed to unmount staging target %q: %v", targetPath, err)
}
klog.V(2).Infof("NodeUnstageVolume: unmount %s successfully", stagingTargetPath)

Expand Down
Loading

0 comments on commit a3e8d0d

Please sign in to comment.